Deployment Workflow #15
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 Release App Bundle | |
on: workflow_dispatch | |
jobs: | |
# version: | |
# name: Create version number | |
# runs-on: ubuntu-latest | |
# steps: | |
# - uses: actions/checkout@v3 | |
# - name: Install GitVersion | |
# uses: gittools/actions/gitversion/[email protected] | |
# with: | |
# versionSpec: "5.x" | |
# - name: Use GitVersion | |
# id: gitversion | |
# uses: gittools/actions/gitversion/[email protected] | |
# # 3 | |
# - name: Create version.txt with nuGetVersion | |
# run: echo ${{ steps.gitversion.outputs.nuGetVersion }} > version.txt | |
# # 4 | |
# - name: Upload version.txt | |
# uses: actions/upload-artifact@v2 | |
# with: | |
# name: gitversion | |
# path: version.txt | |
build: | |
name: Create android build | |
#needs: version | |
runs-on: ubuntu-latest | |
steps: | |
# - name: Get version | |
# uses: actions/download-artifact@v2 | |
# with: | |
# name: gitversion | |
# - name: Create new file without newline char from version.txt | |
# run: tr -d '\n' < version.txt > version1.txt | |
# - name: Read version | |
# id: version | |
# uses: juliangruber/read-file-action@v1 | |
# with: | |
# path: version1.txt | |
# - name: Update version in YAML | |
# run: | |
# sed -i 's/99.99.99+99/${{ steps.version.outputs.content }}+${{ github.run_number }}/g' pubspec.yaml | |
- name: Decode Keystore | |
id: decode_keystore | |
uses: timheuer/base64-to-file@v1 | |
with: | |
fileName: "keystore/key.jks" | |
encodedString: ${{ secrets.RELEASE_KEY }} | |
- uses: actions/checkout@v3 | |
- name: set up JDK 1.8 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: zulu | |
java-version: 12.x | |
cache: gradle | |
- uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: "3.0.0" | |
channel: "stable" | |
cache: true | |
- name: Get dependencies | |
run: flutter upgrade && flutter pub get | |
- name: Start Release build | |
run: flutter build appbundle | |
env: | |
SIGNING_KEY_ALIAS: ${{ secrets.ALIAS }} | |
SIGNING_KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }} | |
SIGNING_STORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }} | |
- name: Upload Android release | |
uses: actions/upload-artifact@v2 | |
with: | |
name: Build Artifacts | |
path: app/build/outputs/bundle/release/app-release.aab | |
deploy: | |
name: Deploy Android Build | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v1 | |
- name: Get Android Build from artifacts | |
uses: actions/download-artifact@v2 | |
with: | |
name: android-release | |
- name: Release Build to internal track | |
uses: r0adkll/upload-google-play@v1 | |
with: | |
serviceAccountJsonPlainText: ${{ secrets.PLAYSTORE_ACCOUNT_KEY }} | |
packageName: com.workout_manager | |
releaseFiles: app-release.aab | |
track: alpha | |
status: completed |