cleanup and documentation

This commit is contained in:
Remy Moll 2024-09-18 16:07:20 +02:00
parent d4066a1726
commit db821b4856
3 changed files with 25 additions and 8 deletions

@ -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

@ -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}}

@ -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<name> -m "Release <name>"
git push origin v<name>
```
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 <lane>
```
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.