Skip to content

Commit

Permalink
Release apk in workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
letwebdev committed Oct 9, 2023
1 parent 4b220df commit 3947198
Showing 1 changed file with 37 additions and 2 deletions.
39 changes: 37 additions & 2 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,19 @@ on:

jobs:
build:

runs-on: ubuntu-latest

steps:
- name: Checkout
- uses: actions/checkout@v3

- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'npm'
- name: Install npm dependencies
run: npm install

- name: set up JDK 19
uses: actions/setup-java@v3
with:
Expand All @@ -32,3 +33,37 @@ jobs:
run: npm run bump
- name: Build apk
run: npm run build-apk

uses: actions/upload-artifact@v1
with:
name: apk
path: './android/app/build/outputs/apk/debug/app-debug.apk'
release:
name: Release APK
needs: apk
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
steps:
- name: Download APK from build
uses: actions/download-artifact@v1
with:
name: apk
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
- name: Upload Release APK
id: upload_release_asset
uses: actions/upload-release-asset@v1.0.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: './android/app/build/outputs/apk/debug/app-debug.apk'
asset_name: hackernews-${{github.ref}}.apk
asset_content_type: application/zip

0 comments on commit 3947198

Please sign in to comment.