diff --git a/.github/workflows/android-build.yml b/.github/workflows/android-build.yml index 51e883e..3a76932 100644 --- a/.github/workflows/android-build.yml +++ b/.github/workflows/android-build.yml @@ -45,40 +45,29 @@ jobs: path: ./android/app/build/outputs/apk/release/app-release.apk # Path to the generated release APK create_release: - name: Create GitHub Release + name: Create Release runs-on: ubuntu-latest - needs: build - outputs: - upload_url: ${{ steps.create_release.outputs.upload_url }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: + - name: Checkout code + uses: actions/checkout@v2 - name: Create Release id: create_release - run: | - tag=$(echo "${GITHUB_REF#refs/tags/}") - gh release create "$tag" \ - --repo="$GITHUB_REPOSITORY" \ - --title="${GITHUB_REPOSITORY#*/} $tag" \ - --notes "Release notes for $tag" # Add custom release notes as needed - shell: bash - - upload_asset: - name: Upload APK to GitHub Release - runs-on: ubuntu-latest - needs: create_release - steps: - - name: Get Release Upload URL - id: get_release_url - run: | - upload_url=$(gh release view ${{ github.repository }} ${GITHUB_REF#refs/tags/} --json upload_url -q) - echo "::set-output name=upload_url::$upload_url" - - name: Upload Release Asset + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token + with: + tag_name: ${{ github.ref }} + release_name: Release ${{ github.ref }} + draft: false + prerelease: false + - name: Upload APK to Release + id: upload-release-asset uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - upload_url: ${{ needs.create_release.outputs.upload_url }} - asset_path: ./android/app/build/outputs/apk/release/app-release.apk - asset_name: app-release-${{ github.run_number }}.apk # Set a unique asset name - asset_content_type: application/vnd.android.package-archive + upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps + asset_path: ./app/build/outputs/apk/debug/app-debug.apk + asset_name: app-debug.apk + asset_content_type: application/zip + \ No newline at end of file