-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
app releasing and ci / cd init (#99)
* example app is signable & releasable in internal SBB store * example android app can be released using android_release.yml workflow * tests are automatically run on every commit * added pub scorer workflow, runs on pushes to main - creates report
- Loading branch information
1 parent
fd49d8a
commit 25a52fd
Showing
57 changed files
with
201 additions
and
211 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
name: android_release | ||
on: workflow_dispatch | ||
|
||
jobs: | ||
build-and-release: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Set up JDK 11. | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: 11 | ||
distribution: temurin | ||
|
||
- name: Checkout design_system_flutter code. | ||
uses: actions/checkout@v4 | ||
|
||
- name: Write Keystore from base64 encoded secret. | ||
id: write_keystore | ||
uses: timheuer/[email protected] | ||
with: | ||
fileName: "fdsm_keystore.jks" | ||
fileDir: "./example/android/app/keys" | ||
encodedString: ${{ secrets.KEYSTORE_64 }} | ||
|
||
- name: Parse flutter version and channel specified in .fvm into env vars. | ||
uses: kuhnroyal/flutter-fvm-config-action@v1 | ||
|
||
- name: Clone flutter version specified in .fvm. | ||
uses: subosito/flutter-action@v2 | ||
with: | ||
flutter-version: ${{ steps.fvm-config-action.outputs.FLUTTER_VERSION }} | ||
channel: ${{ steps.fvm-config-action.outputs.FLUTTER_CHANNEL }} | ||
|
||
- name: Run flutter doctor. | ||
run: flutter doctor -v | ||
|
||
- name: Install dependencies. | ||
run: flutter pub get | ||
working-directory: example | ||
|
||
- name: Build appbundle. | ||
run: flutter build appbundle --no-pub | ||
working-directory: example | ||
env: | ||
KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }} | ||
KEY_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }} | ||
SIGNING_KEY_ALIAS: ${{ secrets.SIGNING_KEY_ALIAS }} | ||
|
||
- name: Create Signing Report. | ||
run: ./gradlew signingReport | ||
working-directory: example/android | ||
|
||
- name: Upload appbundle as artifact. | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: app-release.aab | ||
path: example/build/app/outputs/bundle/release/ | ||
retention-days: 1 | ||
|
||
- name: Write Google SA json from base64 encoded secret. | ||
id: write_google_sa | ||
uses: timheuer/[email protected] | ||
with: | ||
fileName: "gp_service_account.json" | ||
fileDir: "./example/android/app/keys" | ||
encodedString: ${{ secrets.GOOGLE_PLAYSTORE_SERVICE_ACCOUNT_64 }} | ||
|
||
- name: Release using GPP. | ||
run: ./gradlew publishBundle --artifact-dir ../build/app/outputs/bundle/release/ | ||
working-directory: example/android |
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Workflow evaluates the score on pub.dev. | ||
# Runs on each push to main. | ||
|
||
name: pubdev_score | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
scoring: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Clone repository. | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: main | ||
- name: Evaluate Score | ||
uses: axel-op/dart-package-analyzer@v3 | ||
with: | ||
githubToken: ${{ secrets.GITHUB_TOKEN }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# Runs flutter test on every push. | ||
# Failed goldens are uploaded and can be seen in the artifact summary of the job. | ||
|
||
name: test | ||
|
||
on: | ||
push: | ||
|
||
jobs: | ||
test: | ||
runs-on: macos-latest | ||
|
||
steps: | ||
- name: Checkout design_system_flutter code. | ||
uses: actions/checkout@v4 | ||
|
||
- name: Parse flutter version and channel specified in .fvm into env vars. | ||
uses: kuhnroyal/flutter-fvm-config-action@v1 | ||
|
||
- name: Clone flutter version specified in .fvm. | ||
uses: subosito/flutter-action@v2 | ||
with: | ||
flutter-version: ${{ steps.fvm-config-action.outputs.FLUTTER_VERSION }} | ||
channel: ${{ steps.fvm-config-action.outputs.FLUTTER_CHANNEL }} | ||
|
||
- name: Run flutter doctor. | ||
run: flutter doctor -v | ||
|
||
- name: Install dependencies. | ||
run: flutter pub get | ||
|
||
- name: Run flutter test. | ||
id: test | ||
run: flutter test | ||
|
||
- name: Upload goldens if tests fail. | ||
uses: actions/upload-artifact@v3 | ||
if: ${{ failure() && steps.test.conclusion == 'failure' }} | ||
with: | ||
name: goldens | ||
path: test/failures/ | ||
|
||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,9 @@ | |
.history | ||
.svn/ | ||
|
||
# no keystores | ||
*.jks | ||
|
||
# IntelliJ related | ||
*.iml | ||
*.ipr | ||
|
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,19 @@ | ||
# example | ||
# Showcase App - Flutter DSM | ||
|
||
A new Flutter project. | ||
This showcase app illustrates the components of the design_system_flutter package. | ||
|
||
## Getting Started | ||
|
||
This project is a starting point for a Flutter application. | ||
* Install `fvm`, following the instructions [here](https://fvm.app/docs/getting_started/installation). | ||
* For running this application locally, run the following command from your shell: | ||
|
||
A few resources to get you started if this is your first Flutter project: | ||
```shell | ||
|
||
- [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab) | ||
- [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook) | ||
fvm flutter run | ||
|
||
For help getting started with Flutter, view our | ||
[online documentation](https://flutter.dev/docs), which offers tutorials, | ||
samples, guidance on mobile development, and a full API reference. | ||
``` | ||
This will install all the necessary dependencies and run the application on your local emulator. | ||
|
||
## Deployment | ||
|
||
This app is built and deployed using github actions. Check the `android_release.yml` inside `./.github/workflows`. The necessary secrets are set within the repository. They are also securely stored by the SBB AppBakery Team. |
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
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
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
2 changes: 1 addition & 1 deletion
2
example/android/app/src/main/kotlin/ch/sbb/mds/example/example/MainActivity.kt
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package ch.sbb.mds.example.example | ||
package ch.sbb.fdsm.example | ||
|
||
import androidx.annotation.NonNull | ||
|
||
|
Binary file modified
BIN
+2.76 KB
(620%)
example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+1.71 KB
(500%)
example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+3.62 KB
(610%)
example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+5.58 KB
(650%)
example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+7.5 KB
(630%)
example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,3 @@ org.gradle.jvmargs=-Xmx1536M | |
|
||
android.useAndroidX=true | ||
android.enableJetifier=true | ||
android.enableR8=true |
This file was deleted.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed
BIN
-51.9 KB
example/ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon-1024.png
Binary file not shown.
Binary file removed
BIN
-1.26 KB
example/ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
Binary file not shown.
Binary file removed
BIN
-1.97 KB
example/ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
Binary file not shown.
Binary file removed
BIN
-1.9 KB
example/ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
Binary file not shown.
Binary file removed
BIN
-2.74 KB
example/ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
Diff not rendered.
Binary file removed
BIN
-2.5 KB
example/ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
Diff not rendered.
Binary file removed
BIN
-3.65 KB
example/ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
Diff not rendered.
Binary file removed
BIN
-3.65 KB
example/ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
Diff not rendered.
Binary file removed
BIN
-5.36 KB
example/ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
Diff not rendered.
Binary file removed
BIN
-622 Bytes
example/ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon-ipad-20.png
Diff not rendered.
Binary file removed
BIN
-1.26 KB
example/ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
Diff not rendered.
Binary file removed
BIN
-891 Bytes
example/ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon-ipad-29.png
Diff not rendered.
Binary file removed
BIN
-1.26 KB
example/ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon-ipad-40.png
Diff not rendered.
Binary file removed
BIN
-2.5 KB
example/ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
Diff not rendered.
Binary file removed
BIN
-2.46 KB
example/ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon-ipad-76.png
Diff not rendered.
Binary file removed
BIN
-4.43 KB
example/ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
Diff not rendered.
Binary file removed
BIN
-4.92 KB
example/ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
Diff not rendered.
Oops, something went wrong.