From db821b4856168bb141674ee7c00b8ab624a2d281 Mon Sep 17 00:00:00 2001 From: Remy Moll Date: Wed, 18 Sep 2024 16:07:20 +0200 Subject: [PATCH] cleanup and documentation --- .../frontend_trigger_deployment.yaml | 3 ++- .../.github/workflows/build_app_android.yaml | 6 ++--- frontend/README.md | 24 +++++++++++++++---- 3 files changed, 25 insertions(+), 8 deletions(-) diff --git a/.gitea/workflows/frontend_trigger_deployment.yaml b/.gitea/workflows/frontend_trigger_deployment.yaml index e662ffe..163e477 100644 --- a/.gitea/workflows/frontend_trigger_deployment.yaml +++ b/.gitea/workflows/frontend_trigger_deployment.yaml @@ -2,10 +2,11 @@ on: push: tags: - v* + jobs: push-to-remote: # We want to use the macos runner provided by github actions. This requires to push to a remote first. - # After the push we can use the action under .github/actions/ to deploy properly using fastlane on macos. + # After the push we can use the action under frontend/.github/actions/ to deploy properly using fastlane on macos. runs-on: ubuntu-latest steps: - name: Checkout code diff --git a/frontend/.github/workflows/build_app_android.yaml b/frontend/.github/workflows/build_app_android.yaml index 45e9bcf..231dba5 100644 --- a/frontend/.github/workflows/build_app_android.yaml +++ b/frontend/.github/workflows/build_app_android.yaml @@ -8,13 +8,13 @@ jobs: runs-on: macos-lastest steps: - uses: actions/checkout@v2 - + - name: Set up ruby env uses: ruby/setup-ruby@v1.138.0 with: ruby-version: 3.2.1 bundler-cache: true - + - name: Setup java for android build uses: actions/setup-java@v4 with: @@ -33,7 +33,7 @@ jobs: echo "VERSION=${REF_NAME//v}" >> $GITHUB_ENV - name: Run fastlane lane - run: bundle exec fastlane android build + run: bundle exec fastlane deploy working-directory: android env: VERSION_NAME: ${{outputs.version.VERSION}} diff --git a/frontend/README.md b/frontend/README.md index 0aa8bd9..ea008c1 100644 --- a/frontend/README.md +++ b/frontend/README.md @@ -26,16 +26,32 @@ To update the icons, change the `flutter_launcher_icons.yaml` configuration file dart run flutter_launcher_icons ``` +### Deploying a new version +To truly deploy a new version of the application, i.e. to the official app stores, a special CI step is required. This listens for new tags. To create a new tag position yourself on the main branch and run +```bash +git tag -a v -m "Release " +git push origin v +``` +We adhere to the [Semantic Versioning](https://semver.org/) standard, so the tag should be of the form `v0.1.8` for example. -## Deployment (using fastlane) -The application is deployed to the Google Play Store and the Apple App Store using fastlane: -[https://docs.fastlane.tools/](https://docs.fastlane.tools/) +## Fastlane - in depth +The application is deployed to the Google Play Store and the Apple App Store using fastlane: [https://docs.fastlane.tools/](https://docs.fastlane.tools/) -Fastlane is installed as a Ruby gem. Since the bundler-gemfile is scoped to a single directory, a gemfile is included in both the `android` and `ios` directories. Once installed, the usage is +Fastlane is installed as a Ruby gem. Since the bundler-gemfile is scoped to a single directory, a `Gemfile` is included in both the `android` and `ios` directories. Once installed, the usage is ```bash cd frontend/android # or ios bundle install bundle exec fastlane ``` This is reused in the CI/CD pipeline to automate the deployment process. + +Fastlane assumes mutliple secrets to be present as files in the platform directories. These are: +- for android: + - `secrets.properties` used by gradle to load secrets needed at execution time + - `release.keystore` used by gradle to sign the apk + - `google-key.json` used by fastlane to authenticate with the Google Play Store +- for ios: + - TODO + +These files are stored as secrets in the GitHub repository so that the CI pipeline can access them. \ No newline at end of file