Automated-CI-Android #14
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Automated-CI-Android | |
on: | |
workflow_dispatch: | |
inputs: | |
tag_name: | |
description: "Tag name for release. If set to nightly, the release will be a pre-release." | |
required: false | |
default: nightly | |
jobs: | |
Automated-CI-Android: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Install Java | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
- name: Install Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
channel: 'stable' | |
- name: Prepare Flutter Dependencies | |
run: | | |
flutter pub get | |
flutter pub global activate intl_utils | |
flutter pub global run intl_utils:generate | |
- name: Import Secrets | |
uses: actions/checkout@v2 | |
with: | |
repository: DanXi-Dev/DanXi-secrets | |
path: secrets | |
ssh-key: ${{ secrets.SECRETS_SSH_KEY }} | |
- name: Populate Secrets | |
run: | | |
mv -f secrets/sksl_default.json CI/sksl_default.json | |
mv -f secrets/key.properties android/key.properties | |
mv -f secrets/danxi.keystore android/danxi.keystore | |
- name: Build APK | |
run: | | |
dart build_release.dart --target android --versionCode dummy | |
- if: github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name != 'nightly' | |
name: Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: build/app/outputs/flutter-apk/app-release.apk | |
prerelease: false | |
tag_name: ${{ github.event.inputs.tag_name }} | |
name: Release ${{ github.ref }} | |
generate_release_notes: true | |
fail_on_unmatched_files: true | |
- if: github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name == 'nightly' | |
name: Release Nightly | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: build/app/outputs/flutter-apk/app-release.apk | |
prerelease: true | |
tag_name: nightly | |
name: Nightly build | |
generate_release_notes: true | |
fail_on_unmatched_files: true |