Skip to content

Commit

Permalink
build sequence
Browse files Browse the repository at this point in the history
  • Loading branch information
himanshu-wedensday committed Apr 18, 2024
1 parent 98767e0 commit f01210f
Showing 1 changed file with 18 additions and 29 deletions.
47 changes: 18 additions & 29 deletions .github/workflows/android-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit f01210f

Please sign in to comment.