Skip to content

Commit

Permalink
upload url fix
Browse files Browse the repository at this point in the history
  • Loading branch information
himanshu-wedensday committed Apr 18, 2024
1 parent 82af98e commit 63fd498
Showing 1 changed file with 26 additions and 11 deletions.
37 changes: 26 additions & 11 deletions .github/workflows/android-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,23 +42,38 @@ jobs:
name: app-release
path: ./android/app/build/outputs/apk/release/app-release.apk

- name: Create GitHub Release
create_release:
name: Create GitHub Release
runs-on: ubuntu-latest
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Create Release
id: create_release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref_name }}
run: |
gh release create "$tag" \
--repo="$GITHUB_REPOSITORY" \
--title="${GITHUB_REPOSITORY#*/} ${tag#v}" \
--generate-notes
- name: Upload APK to GitHub Release
tag=$(echo "${GITHUB_REF#refs/tags/}")
gh release create "$tag" \
--repo="$GITHUB_REPOSITORY" \
--title="${GITHUB_REPOSITORY#*/} ${tag}" \
--generate-notes
shell: bash

upload_asset:
name: Upload APK to GitHub Release
runs-on: ubuntu-latest
needs: create_release
steps:
- name: Download Release URL
id: get_release_url
run: echo "::set-output name=upload_url::$(gh release view ${{ github.repository }} ${GITHUB_REF#refs/tags/} --json upload_url -q)"
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
upload_url: ${{ needs.create_release.outputs.upload_url }}
asset_path: ./android/app/build/outputs/apk/release/app-release.apk
asset_name: react-native-template.apk
asset_content_type: application/vnd.android.package-archive

0 comments on commit 63fd498

Please sign in to comment.