Merge branch 'main' of https://github.com/NeXTormer/NeverSkip #211
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: build_for_android | |
on: | |
push: | |
tag: | |
- "v*.*.*" | |
jobs: | |
build_aab: | |
runs-on: ubuntu-20.04 | |
if: ${{ startsWith(github.ref, 'refs/tags/v') }} | |
steps: | |
# Setup Java environment in order to build the Android app. | |
- uses: actions/checkout@v1 | |
- uses: actions/setup-java@v1 | |
with: | |
java-version: '12.x' | |
# Flutter Setup | |
- uses: subosito/flutter-action@v1 | |
with: | |
channel: 'stable' | |
flutter-version: '3.7.9' | |
- run: flutter pub get | |
- name: Dectypt keys | |
run: | | |
echo "${{ secrets.ANDROID_RELEASE_KEYSTORE }}" > android/release.keystore.asc | |
echo "${{ secrets.KEY_PROPERTIES }}" > android/key.properties.asc | |
gpg -d --passphrase "${{ secrets.ANDROID_RELEASE_KEYSTORE_PASSPHRASE }}" --batch android/release.keystore.asc > android/app/release.keystore | |
gpg -d --passphrase "${{ secrets.ANDROID_RELEASE_KEYSTORE_PASSPHRASE }}" --batch android/key.properties.asc > android/key.properties | |
- name: Get Tag name (version code) | |
uses: olegtarasov/[email protected] | |
id: tagName | |
with: | |
tagRegex: 'v([0-9]+.[0-9]+.[0-9]+)' # Optional. Returns specified group text as tag name. Full tag string is returned if regex is not defined. | |
tagRegexGroup: 1 # Optional. Default is 1. | |
- name: Build AAB | |
run: flutter build appbundle --release --build-number ${{ github.run_number }} --build-name ${{ env.GIT_TAG_NAME }} | |
- name: Create Github Release | |
uses: ncipollo/release-action@v1 | |
with: | |
artifacts: "build/app/outputs/bundle/release/*.aab" | |
token: ${{ secrets.PERSONAL_RELEASE_TOKEN }} | |
- name: Save APPBUNDLE to Artifacts | |
uses: actions/upload-artifact@v2 | |
with: | |
tag: ${{ env.GIT_TAG_NAME }} | |
name: APPBUNDLE | |
path: build/app/outputs/bundle/release/app-release.aab | |
# release_android_beta: | |
# name: Release Android Artifacts to beta track | |
# needs: [build_aab] | |
# runs-on: self-hosted | |
# steps: | |
# - uses: actions/checkout@v1 | |
# - name: Get APPBUNDLE from Artifacts | |
# uses: actions/download-artifact@v2 | |
# with: | |
# name: APPBUNDLE | |
# - name: Release APPBUNDLE to internal track | |
# uses: r0adkll/upload-google-play@v1 | |
# with: | |
# serviceAccountJsonPlainText: ${{ secrets.GOOGLE_SERVICE_JSONKEY }} | |
# packageName: io.hawkford.fredericapp | |
# releaseFile: app-release.aab | |
# track: beta | |
# whatsNewDirectory: distribution/whatsnew | |