diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index ff41aa5..da78fdd 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -10,57 +10,28 @@ on: jobs: build: runs-on: ubuntu-latest - + permissions: + contents: write steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Set up JDK - uses: actions/setup-java@v2 + uses: actions/setup-java@v4 with: distribution: 'zulu' java-version: '17' - - name: Cache Gradle packages - uses: actions/cache@v2 - with: - path: | - ~/.gradle/caches - ~/.gradle/wrapper - key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} - restore-keys: | - ${{ runner.os }}-gradle - - name: Grant execute permission for gradlew run: chmod +x ./Android-app/gradlew - name: Build with Gradle run: ./gradlew build working-directory: ./Android-app - - - name: Upload APK - uses: actions/upload-artifact@v2 - with: - name: app-release.apk - path: Android-app/app/build/outputs/apk/release/app-release-unsigned.apk - - - name: Create Release - id: create_release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: ${{ github.sha }} - release_name: Release ${{ github.sha }} - draft: false - prerelease: false - - name: Upload Release Asset - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Release + uses: softprops/action-gh-release@v2 with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: Android-app/app/build/outputs/apk/release/app-release-unsigned.apk - asset_name: app-release-unsigned.apk - asset_content_type: application/vnd.android.package-archive + files: | + Android-app/app/build/outputs/apk/release/app-release-unsigned.apk + tag_name: v0.0.1-android