Skip to content

Commit 7c117c7

Browse files
chore: setup build environment and add GitHub Actions workflow (#13)(#34)
* chore: update launch icon for Android main * chore: create alpha environment and change icon * chore: create beta environment and change icon * chore: create prod android and change icon * chore: chnage name app * chore: prod env and icon update (iOS) * chore: alpha env and icon update (iOS) * chore: beta env and icon update (iOS) * chore: add firebase config google-services android * chore: add firebase config google-services ios * chore: add action.yml configuration * chore: add workflows build.yaml configuration file * chore: update tests to ensure they pass * fix: update Dart SDK version in pubspec.yaml * chore: update name demo app * chore: add dartdoc-gh-pages.yml to generate docs * chore: update GitHub Actions configuration * chore: add branch conditions to workflow * chore: add token and artifact_name for deployment * chore: deploy Dartdoc to docs directory * Set provisioning profile for alpha release and beta release * Add entitlements to fix TestFlight warning * chore: fix project dependencies to latest versions * fix : dartdoc deployment job github-pages --------- Co-authored-by: Florent Maitre <florent.maitre@orange.com>
1 parent 62a77cb commit 7c117c7

File tree

241 files changed

+2788
-250
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

241 files changed

+2788
-250
lines changed

.github/actions/setup/action.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: setup
2+
description: Setup environment
3+
runs:
4+
using: "composite"
5+
steps:
6+
- name: Setup Java
7+
uses: actions/setup-java@v3
8+
with:
9+
distribution: 'zulu'
10+
java-version: '17'
11+
12+
- name: Setup Flutter
13+
uses: subosito/flutter-action@v2

.github/workflows/build.yml

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- develop
8+
tags:
9+
- '[0-9]+.[0-9]+.[0-9]+'
10+
11+
pull_request:
12+
types: [opened, synchronize, reopened]
13+
14+
jobs:
15+
test:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v3
20+
with:
21+
fetch-depth: 0
22+
23+
- name: Setup environment
24+
uses: ./.github/actions/setup
25+
26+
- name: Run app tests
27+
shell: bash
28+
run: |
29+
cd app
30+
flutter test
31+
32+
- name: Run library tests
33+
shell: bash
34+
run: |
35+
cd library
36+
flutter test
37+
38+
build-android:
39+
runs-on: ubuntu-latest
40+
needs: test
41+
steps:
42+
- name: Checkout code
43+
uses: actions/checkout@v3
44+
with:
45+
fetch-depth: 0
46+
47+
- name: Setup environment
48+
uses: ./.github/actions/setup
49+
50+
- name: Determine build flavor
51+
id: determine_flavor
52+
run: echo "::set-output name=flavor::$(if [[ ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') }} ]]; then echo "prod"; else echo "beta"; fi)"
53+
54+
- name: Build Android app
55+
shell: bash
56+
run: |
57+
cd app
58+
flutter build apk --flavor=${{ steps.determine_flavor.outputs.flavor }}
59+
flutter build appbundle --flavor=${{ steps.determine_flavor.outputs.flavor }}
60+
61+
- name: Store Android app artifacts
62+
uses: actions/upload-artifact@v4
63+
with:
64+
name: android-app
65+
path: |
66+
app/build/app/outputs/flutter-apk/*.apk
67+
app/build/app/outputs/bundle/*/*.aab
68+
69+
build-ios:
70+
runs-on: macos-latest
71+
needs: test
72+
steps:
73+
- name: Checkout code
74+
uses: actions/checkout@v3
75+
with:
76+
fetch-depth: 0
77+
78+
- name: Setup environment
79+
uses: ./.github/actions/setup
80+
81+
- name: Determine build flavor
82+
id: determine_flavor
83+
run: echo "::set-output name=flavor::$(if [[ ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') }} ]]; then echo "prod"; else echo "beta"; fi)"
84+
85+
- name: Build iOS app
86+
shell: bash
87+
run: |
88+
cd app
89+
flutter build ios --no-codesign --flavor=${{ steps.determine_flavor.outputs.flavor }}
90+
91+
- name: Store iOS app artifacts
92+
uses: actions/upload-artifact@v4
93+
with:
94+
name: ios-app
95+
path: app/build/ios/iphoneos/Runner.app
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
name: Deploy Dartdoc with GitHub Pages dependencies preinstalled
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- develop
8+
9+
10+
workflow_dispatch:
11+
12+
permissions:
13+
contents: write
14+
pages: write
15+
id-token: write
16+
17+
concurrency:
18+
group: "pages"
19+
cancel-in-progress: false
20+
21+
jobs:
22+
build:
23+
runs-on: ubuntu-latest
24+
steps:
25+
- name: Checkout
26+
uses: actions/checkout@v3
27+
with:
28+
submodules: recursive
29+
- name: Setup Dart
30+
uses: dart-lang/setup-dart@v1
31+
with:
32+
sdk: stable
33+
- name: Setup environment
34+
uses: ./.github/actions/setup
35+
- name: Setup Pages
36+
uses: actions/configure-pages@v3
37+
- name: Setup Ruby
38+
uses: ruby/setup-ruby@v1
39+
with:
40+
ruby-version: 3.3.5
41+
- name: Build with Dartdoc
42+
run: |
43+
cd library
44+
dart pub get
45+
dart doc .
46+
- name: Move DartDoc output
47+
run: |
48+
mkdir -p ./docs
49+
mv library/doc/api/* ./docs
50+
- name: Upload artifact
51+
uses: actions/upload-pages-artifact@v3
52+
with:
53+
path: ./docs
54+
55+
deploy:
56+
runs-on: ubuntu-latest
57+
needs: build
58+
steps:
59+
- name: Checkout repository
60+
uses: actions/checkout@v2
61+
62+
- name: Download artifact
63+
uses: actions/download-artifact@v4
64+
with:
65+
name: github-pages
66+
67+
- name: List files in current directory (to verify artifact)
68+
run: |
69+
ls -la
70+
71+
- name: Create docs directory if not exists
72+
run: |
73+
mkdir -p ./docs
74+
75+
- name: Extract artifact into docs directory
76+
run: |
77+
tar -xvf artifact.tar -C ./docs
78+
ls -la ./docs
79+
80+
- name: Commit changes and push to gh-pages
81+
run: |
82+
git config --global user.name "GitHub Actions"
83+
git config --global user.email "actions@github.com"
84+
git checkout gh-pages || git checkout -b gh-pages
85+
git rm -rf .
86+
echo "flutter.unified-design-system.orange.com" > docs/CNAME
87+
git add ./docs/*
88+
commit_message="doc: deploy site to GitHub Pages - Version $(date +%Y%m%d)"
89+
git commit -m "$commit_message" || echo "No changes to commit"
90+
git push origin gh-pages --force
91+
env:
92+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
93+

app/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88

99
### Added
1010

11+
- [DemoApp] Distribute demo app for validation ([#5](https://github.com/Orange-OpenSource/ouds-flutter/issues/13))
1112
- [DemoApp] Create the basic architecture of the demo application ([#5](https://github.com/Orange-OpenSource/ouds-flutter/issues/5))
1213

1314
### Changed

app/android/app/build.gradle

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,27 @@ plugins {
33
id "kotlin-android"
44
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
55
id "dev.flutter.flutter-gradle-plugin"
6+
// Firebase
7+
id "com.google.gms.google-services"
68
}
79

810
android {
9-
namespace = "com.orange.ouds.ouds_flutter"
11+
namespace = "com.orange.ouds.flutterapp"
1012
compileSdk = flutter.compileSdkVersion
1113
ndkVersion = flutter.ndkVersion
1214

1315
compileOptions {
14-
sourceCompatibility = JavaVersion.VERSION_11
15-
targetCompatibility = JavaVersion.VERSION_11
16+
sourceCompatibility = JavaVersion.VERSION_17
17+
targetCompatibility = JavaVersion.VERSION_17
1618
}
1719

1820
kotlinOptions {
19-
jvmTarget = JavaVersion.VERSION_11
21+
jvmTarget = JavaVersion.VERSION_17
2022
}
2123

2224
defaultConfig {
2325
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
24-
applicationId = "com.orange.ouds.ouds_flutter"
26+
applicationId = "com.orange.ouds.flutterapp"
2527
// You can update the following values to match your application needs.
2628
// For more information, see: https://flutter.dev/to/review-gradle-config.
2729
minSdk = flutter.minSdkVersion
@@ -37,6 +39,25 @@ android {
3739
signingConfig = signingConfigs.debug
3840
}
3941
}
42+
43+
flavorDimensions "version"
44+
productFlavors {
45+
alpha {
46+
dimension "version"
47+
applicationId "com.orange.ouds.alpha.flutterapp"
48+
resValue "string", "app_name", "DesignToolbox"
49+
}
50+
beta {
51+
dimension "version"
52+
applicationId "com.orange.ouds.beta.flutterapp"
53+
resValue "string", "app_name", "DesignToolbox"
54+
}
55+
prod {
56+
dimension "version"
57+
applicationId "com.orange.ouds.flutterapp"
58+
resValue "string", "app_name", "DesignToolbox"
59+
}
60+
}
4061
}
4162

4263
flutter {

0 commit comments

Comments
 (0)