-
-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
82 additions
and
34 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,36 @@ | ||
name: Setup Flutter environment | ||
description: Setup Flutter environment | ||
inputs: | ||
java-version: | ||
description: 'Java Version' | ||
required: true | ||
flutter-channel: | ||
description: 'Flutter Channel' | ||
required: true | ||
runs: | ||
using: 'composite' | ||
steps: | ||
# Setup the Java environment. | ||
- uses: actions/setup-java@v4 | ||
with: | ||
distribution: 'zulu' | ||
java-version: ${{inputs.java-version}} | ||
cache: 'gradle' | ||
|
||
# Setup the Flutter environment. | ||
- uses: subosito/flutter-action@v2 | ||
with: | ||
channel: ${{inputs.flutter-channel}} | ||
cache: true | ||
|
||
# No dart analytics. | ||
- run: dart --disable-analytics | ||
shell: bash | ||
|
||
# No flutter analytics. | ||
- run: flutter config --disable-analytics | ||
shell: bash | ||
|
||
# Get flutter dependencies. | ||
- run: flutter pub get | ||
shell: bash |
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,30 @@ | ||
name: Syntax Check | ||
|
||
on: | ||
push: | ||
# Ignore develop branch, will be triggered by workflow_call in release.yml | ||
branches-ignore: | ||
- develop | ||
workflow_call: | ||
|
||
jobs: | ||
analyze: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
# Call setup_env action to setup workspace | ||
- uses: ./.github/actions/setup_env | ||
with: | ||
java-version: ${{ vars.JAVA_VERSION }} | ||
flutter-channel: ${{ vars.FLUTTER_CHANNEL }} | ||
|
||
# Check for any formatting issues in the code. | ||
- run: dart format --set-exit-if-changed . | ||
|
||
# Statically analyze the Dart code for any errors. | ||
- run: dart analyze . | ||
|
||
# Run widget tests for our flutter project. | ||
# - run: flutter test |
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,34 +2,31 @@ name: Build | |
|
||
on: | ||
release: | ||
types: [created] | ||
types: | ||
- created | ||
push: | ||
branches: [master] | ||
branches: | ||
- develop | ||
|
||
env: | ||
JAVA_VERSION: "17.x" | ||
FLUTTER_CHANNEL: "stable" | ||
PROPERTIES_PATH: "./android/key.properties" | ||
|
||
jobs: | ||
check: | ||
uses: ./.github/workflows/commit.yml | ||
|
||
build: | ||
runs-on: ubuntu-latest | ||
needs: [check] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
# Setup Java environment in order to build the Android app. | ||
- uses: actions/setup-java@v4 | ||
with: | ||
distribution: 'zulu' | ||
java-version: ${{env.JAVA_VERSION}} | ||
cache: 'gradle' | ||
|
||
# Setup the flutter environment. | ||
- uses: subosito/flutter-action@v2 | ||
# Call setup_env action to setup workspace | ||
- uses: ./.github/actions/setup_env | ||
with: | ||
channel: ${{env.FLUTTER_CHANNEL}} | ||
cache: true | ||
java-version: ${{ vars.JAVA_VERSION }} | ||
flutter-channel: ${{ vars.FLUTTER_CHANNEL }} | ||
|
||
# Generate keystore | ||
- uses: timheuer/[email protected] | ||
|
@@ -49,24 +46,6 @@ jobs: | |
- run: | | ||
sed -i 's/^\(version: [0-9\.]\{1,\}\(-[a-z]\{1,\}\)\{0,1\}\)$/\1+${{ github.run_number }}/m' pubspec.yaml | ||
# No dart analytics. | ||
- run: dart --disable-analytics | ||
|
||
# No flutter analytics. | ||
- run: flutter config --no-analytics | ||
|
||
# Get flutter dependencies. | ||
- run: flutter pub get | ||
|
||
# Check for any formatting issues in the code. | ||
- run: dart format --set-exit-if-changed . | ||
|
||
# Statically analyze the Dart code for any errors. | ||
- run: dart analyze . | ||
|
||
# Run widget tests for our flutter project. | ||
# - run: flutter test | ||
|
||
# Build apk. | ||
- run: flutter build apk --obfuscate --split-debug-info=build/app/outputs/symbols/apk --release --split-per-abi | ||
|
||
|
@@ -108,6 +87,7 @@ jobs: | |
upload-to-github: | ||
runs-on: ubuntu-latest | ||
needs: [build] | ||
if: startsWith(github.ref, 'refs/tags/') | ||
|
||
steps: | ||
- uses: actions/download-artifact@v4 | ||
|
@@ -124,7 +104,6 @@ jobs: | |
path: ./artifacts | ||
|
||
- uses: softprops/action-gh-release@v1 | ||
if: startsWith(github.ref, 'refs/tags/') | ||
with: | ||
files: | | ||
./artifacts/app-arm64-v8a-release.apk | ||
|
@@ -148,6 +127,7 @@ jobs: | |
with: | ||
name: mapping.txt | ||
path: ./artifacts | ||
# not a release --> push to internal | ||
- uses: r0adkll/upload-google-play@v1 | ||
if: ${{ !startsWith(github.ref, 'refs/tags/') }} | ||
with: | ||
|
@@ -158,6 +138,7 @@ jobs: | |
mappingFile: ./artifacts/mapping.txt | ||
track: internal | ||
status: completed | ||
# prerelease --> push to beta | ||
- uses: r0adkll/upload-google-play@v1 | ||
if: ${{ startsWith(github.ref, 'refs/tags/') && github.event.release.prerelease }} | ||
with: | ||
|
@@ -168,6 +149,7 @@ jobs: | |
mappingFile: ./artifacts/mapping.txt | ||
track: beta | ||
status: completed | ||
# release --> push to production | ||
- uses: r0adkll/upload-google-play@v1 | ||
if: ${{ startsWith(github.ref, 'refs/tags/') && !github.event.release.prerelease }} | ||
with: | ||
|