beta #6
Workflow file for this run
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
# Copyright (c) 2022 Sharezone UG (haftungsbeschränkt) | |
# Licensed under the EUPL-1.2-or-later. | |
# | |
# You may obtain a copy of the Licence at: | |
# https://joinup.ec.europa.eu/software/page/eupl | |
# | |
# SPDX-License-Identifier: EUPL-1.2 | |
name: beta | |
concurrency: | |
# Our Android & iOS builds require unique build numbers. Therefore, we should | |
# never build a new version while a build is already running. This is why we | |
# use the branch name as a concurrency group. This way, we can only build one | |
# version per branch at the same time. | |
group: app-release | |
on: | |
workflow_dispatch: | |
inputs: | |
ios-changelog: | |
type: string | |
description: | | |
iOS changelog: Used for the App Store release notes. If the changelog | |
is not provided, the deployment for iOS will be skipped. Use %0A for | |
line breaks. | |
# For web deployments, we don't have a changelog. | |
deploy-web-app: | |
type: boolean | |
description: | | |
Whether to deploy the web app. If this is set to false, the web | |
deployment will be skipped. | |
android-changelog: | |
type: string | |
description: | | |
Android changelog: Used for the Google Play Store release notes. If the | |
changelog is not provided, the deployment for Android will be skipped. | |
Use %0A for line breaks. | |
# Set permissions to none. | |
# | |
# Using the broad default permissions is considered a bad security practice | |
# and would cause alerts from our scanning tools. | |
permissions: {} | |
env: | |
CI_CD_DART_SCRIPTS_PACKAGE_PATH: "tools/sz_repo_cli/" | |
jobs: | |
deploy-ios: | |
# We skip the deployment if no changelog is provided because we assume that | |
# nothing has changed in the iOS app and therefore no new version is needed. | |
if: github.event.inputs.ios-changelog != '' | |
runs-on: macos-13 | |
timeout-minutes: 120 | |
steps: | |
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac | |
- name: Install Codemagic CLI Tools | |
run: pip3 install codemagic-cli-tools==0.43.0 | |
- name: Set Flutter version from FVM config file to environment variables | |
uses: kuhnroyal/flutter-fvm-config-action@6ffa30473b346f7d7c63cf9e03e6a886f940a72b | |
- uses: subosito/flutter-action@48cafc24713cca54bbe03cdc3a423187d413aafa | |
with: | |
flutter-version: ${{ env.FLUTTER_VERSION }} | |
channel: ${{ env.FLUTTER_CHANNEL }} | |
# Use format expected by FVM. | |
# Else this won't be recognized as an installed version when setting | |
# '.../flutter' as the FVM Flutter version cache folder. | |
cache-path: "${{ runner.tool_cache }}/flutter/:version:" | |
- name: Install FVM | |
run: | | |
flutter pub global activate fvm 2.4.1 | |
fvm config --cache-path '${{ runner.tool_cache }}/flutter' | |
- name: Install Sharezone Repo CLI | |
run: | | |
fvm flutter pub global activate --source path "$CI_CD_DART_SCRIPTS_PACKAGE_PATH" | |
echo $(pwd)/bin >> $GITHUB_PATH | |
- name: Deploy | |
env: | |
# The following secrets are used by the Codemagic CLI tool. It's important | |
# to use the same names as the CLI tool expects. | |
CERTIFICATE_PRIVATE_KEY: ${{ secrets.SHAREZONE_CERTIFICATE_PRIVATE_KEY }} | |
APP_STORE_CONNECT_KEY_IDENTIFIER: ${{ secrets.SHAREZONE_APP_STORE_CONNECT_KEY_IDENTIFIER }} | |
APP_STORE_CONNECT_ISSUER_ID: ${{ secrets.SHAREZONE_APP_STORE_CONNECT_ISSUER_ID }} | |
APP_STORE_CONNECT_PRIVATE_KEY: ${{ secrets.SHAREZONE_APP_STORE_CONNECT_PRIVATE_KEY }} | |
run: | | |
DECODED_CHANGELOG=$(echo -e "${{ github.event.inputs.ios-changelog }}") | |
sz deploy ios \ | |
--stage beta \ | |
--whats-new "$DECODED_CHANGELOG" \ | |
--export-options-plist=$HOME/export_options.plist | |
deploy-web-app: | |
if: github.event.inputs.deploy-web-app == 'true' | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac | |
- name: Set Flutter version from FVM config file to environment variables | |
uses: kuhnroyal/flutter-fvm-config-action@6ffa30473b346f7d7c63cf9e03e6a886f940a72b | |
- uses: subosito/flutter-action@48cafc24713cca54bbe03cdc3a423187d413aafa | |
with: | |
flutter-version: ${{ env.FLUTTER_VERSION }} | |
channel: ${{ env.FLUTTER_CHANNEL }} | |
# Use format expected by FVM. | |
# Else this won't be recognized as an installed version when setting | |
# '.../flutter' as the FVM Flutter version cache folder. | |
cache-path: "${{ runner.tool_cache }}/flutter/:version:" | |
- name: Install FVM | |
run: | | |
flutter pub global activate fvm 2.4.1 | |
fvm config --cache-path '${{ runner.tool_cache }}/flutter' | |
- name: Install Sharezone Repo CLI | |
run: | | |
fvm flutter pub global activate --source path "$CI_CD_DART_SCRIPTS_PACKAGE_PATH" | |
echo $(pwd)/bin >> $GITHUB_PATH | |
- name: Install Firebase CLI | |
run: sudo npm i -g [email protected] | |
- name: Build and deploy web-app | |
env: | |
SHAREZONE_PROD_KEY: ${{ secrets.FIREBASE_HOSTING_PROD_KEY }} | |
run: | | |
echo $SHAREZONE_PROD_KEY > sharezone-prod-key.json | |
sz deploy web-app \ | |
--stage beta \ | |
--message "Workflow $GITHUB_JOB, commit $GITHUB_SHA" \ | |
--credentials sharezone-prod-key.json | |
deploy-android: | |
# We skip the deployment if no changelog is provided because we assume that | |
# nothing has changed in the Android app and therefore no new version is needed. | |
if: github.event.inputs.android-changelog != '' | |
runs-on: ubuntu-22.04 | |
timeout-minutes: 120 | |
steps: | |
- name: Changelog | |
run: | | |
echo "Android changelog:" | |
echo -e "${{ github.event.inputs.android-changelog }}" | |
echo "Android changelog (decoded):" | |
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 | |
- name: Install Codemagic CLI Tools | |
run: pip3 install codemagic-cli-tools==0.43.0 | |
- name: Setup signing | |
working-directory: app/android | |
env: | |
KEYSTORE_STRING: ${{ secrets.SHAREZONE_ANDROID_APP_KEYSTORE_STRING }} | |
KEY_PASSWORD: ${{ secrets.SHAREZONE_ANDROID_APP_KEY_PASSWORD }} | |
KEY_ALIAS: ${{ secrets.SHAREZONE_ANDROID_APP_KEY_ALIAS }} | |
STORE_PASSWORD: ${{ secrets.SHAREZONE_ANDROID_APP_STORE_PASSWORD }} | |
run: | | |
echo $KEYSTORE_STRING | base64 -di > app/key.jks | |
echo "storePassword=$STORE_PASSWORD" >> key.properties | |
echo "keyPassword=$KEY_PASSWORD" >> key.properties | |
echo "keyAlias=$KEY_ALIAS" >> key.properties | |
echo "storeFile=key.jks" >> key.properties | |
- name: Set Flutter version from FVM config file to environment variables | |
uses: kuhnroyal/flutter-fvm-config-action@6ffa30473b346f7d7c63cf9e03e6a886f940a72b | |
- uses: subosito/flutter-action@48cafc24713cca54bbe03cdc3a423187d413aafa | |
with: | |
flutter-version: ${{ env.FLUTTER_VERSION }} | |
channel: ${{ env.FLUTTER_CHANNEL }} | |
# Use format expected by FVM. | |
# Else this won't be recognized as an installed version when setting | |
# '.../flutter' as the FVM Flutter version cache folder. | |
cache-path: "${{ runner.tool_cache }}/flutter/:version:" | |
- name: Install FVM | |
run: | | |
flutter pub global activate fvm 2.4.1 | |
fvm config --cache-path '${{ runner.tool_cache }}/flutter' | |
- name: Install Fastlane | |
run: sudo gem install fastlane -v 2.214.0 | |
- name: Install Sharezone Repo CLI | |
run: | | |
fvm flutter pub global activate --source path "$CI_CD_DART_SCRIPTS_PACKAGE_PATH" | |
echo $(pwd)/bin >> $GITHUB_PATH | |
- name: Set up Google Play credentials | |
env: | |
GOOGLE_PLAY_SERVICE_ACCOUNT_JSON: ${{ secrets.SHAREZONE_GOOGLE_PLAY_SERVICE_ACCOUNT_JSON }} | |
working-directory: app | |
run: | | |
mkdir private_keys && cd private_keys | |
echo $GOOGLE_PLAY_SERVICE_ACCOUNT_JSON > google-play-gserviceaccount.json | |
- name: Deploy | |
run: | | |
DECODED_CHANGELOG=$(echo -e "${{ github.event.inputs.android-changelog }}") | |
echo $DECODED_CHANGELOG | |
sz deploy android \ | |
--stage beta \ | |
--whats-new "$DECODED_CHANGELOG" |