Deploy client to Play Store internal testing track #42
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: deploy-android-internal-testing | |
run-name: Deploy client to Play Store internal testing track | |
on: | |
push: | |
branches: | |
- deploy-client | |
paths: | |
- "client/pubspec.yaml" | |
- ".github/workflows/deploy-android-internal-testing.yml" | |
concurrency: | |
group: ${{ github.workflow }} | |
cancel-in-progress: true | |
jobs: | |
validate-version-bumped: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: android-client-internal-testing | |
- name: Read current version | |
id: current-version | |
uses: jbutcher5/[email protected] | |
with: | |
file: "./client/pubspec.yaml" | |
key-path: '["version"]' | |
- uses: actions/checkout@v3 | |
- name: Read new version | |
id: new-version | |
uses: jbutcher5/[email protected] | |
with: | |
file: "./client/pubspec.yaml" | |
key-path: '["version"]' | |
- name: Check new version greater than current | |
run: test $(printf '${{ steps.new-version.outputs.data }}\n${{ steps.current-version.outputs.data }}' | sort -V | head -n1) != '${{ steps.new-version.outputs.data }}' | |
- name: Extract build numbers | |
run: | | |
echo "current_build_number=$(echo '${{ steps.current-version.outputs.data }}' | sed 's/^[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*+\([0-9][0-9]*\)$/\1/')" >> $GITHUB_ENV | |
echo "new_build_number=$(echo '${{ steps.new-version.outputs.data }}' | sed 's/^[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*+\([0-9][0-9]*\)$/\1/')" >> $GITHUB_ENV | |
- name: Check new build number greater than current | |
run: test '${{ env.new_build_number }}' -gt '${{ env.current_build_number }}' | |
validate-server-api: | |
runs-on: ubuntu-latest | |
needs: | |
- validate-version-bumped | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
path: deploy-client | |
- uses: actions/checkout@v3 | |
with: | |
ref: server-production | |
path: server-production | |
- uses: bufbuild/buf-setup-action@v1 | |
with: | |
github_token: ${{ github.token }} | |
- name: Check that new client API is not ahead of server API | |
uses: bufbuild/buf-breaking-action@v1 | |
with: | |
input: "server-production/proto" | |
against: "deploy-client/proto" | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
needs: | |
- validate-version-bumped | |
- validate-server-api | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: subosito/flutter-action@v2 | |
with: | |
channel: "stable" | |
- run: cd client && flutter pub get | |
- run: cd client && flutter build appbundle | |
- name: Sign Release | |
uses: r0adkll/sign-android-release@v1 | |
with: | |
releaseDirectory: client/build/app/outputs/bundle/release | |
signingKeyBase64: ${{ secrets.PLAY_STORE_SIGNING_KEY }} | |
alias: ${{ secrets.KEY_STORE_ALIAS }} | |
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }} | |
- name: Deploy to internal testing | |
uses: r0adkll/[email protected] | |
with: | |
serviceAccountJsonPlainText: ${{ secrets.PLAY_STORE_SERVICE_ACCOUNT }} | |
packageName: dk.bjarkebjarke.survival_list | |
releaseFiles: client/build/app/outputs/bundle/release/app-release.aab | |
track: internal | |
status: draft | |
whatsNewDirectory: client/whatsnew | |
mappingFile: client/build/app/outputs/mapping/release/mapping.txt | |
debugSymbols: client/build/app/intermediates/merged_native_libs/release/out/lib | |
android-client-internal-testing-tag: | |
runs-on: ubuntu-latest | |
needs: build-and-deploy | |
permissions: | |
contents: write | |
id-token: write | |
steps: | |
- name: Tag Repo | |
uses: richardsimko/update-tag@v1 | |
with: | |
tag_name: android-client-internal-testing | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |