Skip to content

Commit

Permalink
Add CI for building the app for Android (#51)
Browse files Browse the repository at this point in the history
* Add CI for building the app for Android

* change release config
  • Loading branch information
ueman authored Jul 1, 2024
1 parent c5094a4 commit b800718
Showing 1 changed file with 60 additions and 0 deletions.
60 changes: 60 additions & 0 deletions .github/workflows/build_app.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
on:
workflow_dispatch:
inputs:
buildNumber:
description: 'Build Number'
required: true
type: string
versionName:
description: 'Version Name'
required: true
type: string

name: Test, Build and Release apk

jobs:
build:
defaults:
run:
working-directory: ./app
name: Build APK
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
flutter-version-file: app/pubspec.yaml # path to pubspec.yaml
# write key.properties
#- run: echo "$KEY_PROPERTIES" > android/key.properties
# env:
# KEY_PROPERTIES: ${{ secrets.key_properties }}
# write key.keystore
#- run: mkdir android/key
#- run: echo "$KEY_KEYSTORE" | base64 --decode > android/key/key.keystore
# env:
# KEY_KEYSTORE: ${{ secrets.key_keystore }}
- run: flutter pub get
- run: flutter analyze .
#- run: flutter build apk --build-number $GITHUB_RUN_NUMBER
- run: flutter build apk --build-number ${{ inputs.buildNumber }} --build-name ${{ inputs.versionName }}
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ inputs.buildNumber }}
release_name: Release ${{ inputs.versionName }}-${{ inputs.buildNumber }}
draft: false
prerelease: true
- name: Upload Release APK
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
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/app/outputs/apk/release/app-release.apk
asset_name: cards.apk
asset_content_type: application/vnd.android.package-archive

0 comments on commit b800718

Please sign in to comment.