Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Sesu8642 committed Sep 30, 2023
2 parents 4e23a77 + 1bc0df5 commit 6b498fc
Show file tree
Hide file tree
Showing 6 changed files with 109 additions and 7 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Build

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

jobs:

build_android:
runs-on: ubuntu-latest
container:
# trying to be close to the f-droid build to detect failures early
image: registry.gitlab.com/fdroid/fdroidserver:buildserver-bullseye
env:
ANDROID_HOME: /opt/android-sdk
steps:

- name: apt update
run: sudo apt update

- name: Install jq
run: sudo apt install jq

- name: Install xz-utils
run: sudo apt install xz-utils

- name: Install Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: '3.10.5'
channel: 'stable'
cache: true
cache-key: 'flutter-:os:-:channel:-:version:-:arch:-:hash'

- run: git config --global --add safe.directory ${{ env.FLUTTER_ROOT }}

- run: flutter config --no-analytics

- run: flutter --version

- name: Check out repository code
uses: actions/checkout@v3

- name: Build Android APK
env:
SIGNING_KEY_PWD: ${{ secrets.SIGNING_KEY_PWD }}
run: flutter build apk --flavor ci

- name: Upload Android apk
uses: actions/upload-artifact@v3
with:
name: Android apk
path: ./build/app/outputs/flutter-apk/app-ci-release.apk
31 changes: 31 additions & 0 deletions .github/workflows/verify_and_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Verify and test

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: subosito/flutter-action@v2
with:
flutter-version: '3.10.5'
channel: 'stable'
- run: flutter --version

- name: Install dependencies
run: flutter pub get

- name: Verify formatting
run: dart format --output=none --set-exit-if-changed .

- name: Analyze project source
run: flutter analyze

- name: Run tests
run: flutter test -v
9 changes: 6 additions & 3 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,22 @@
"name": "infusion_timer (debug mode)",
"request": "launch",
"type": "dart",
"flutterMode": "debug"
"flutterMode": "debug",
"args": ["--flavor", "ci"]
},
{
"name": "infusion_timer (profile mode)",
"request": "launch",
"type": "dart",
"flutterMode": "profile"
"flutterMode": "profile",
"args": ["--flavor", "ci"]
},
{
"name": "infusion_timer (release mode)",
"request": "launch",
"type": "dart",
"flutterMode": "release"
"flutterMode": "release",
"args": ["--flavor", "prod"]
}
]
}
17 changes: 15 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,26 @@ android {
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
storePassword keystoreProperties['storePassword']
}
ci {
keyAlias 'upload'
keyPassword System.getenv("SIGNING_KEY_PWD")
storeFile file('./../../ci_files/keystore-github-ci.jks')
storePassword System.getenv("SIGNING_KEY_PWD")
}
}

buildTypes {
release {
flavorDimensions "Signing"
productFlavors {
prod {
signingConfig signingConfigs.release
}
ci {
signingConfig signingConfigs.ci
applicationIdSuffix ".ci"
versionNameSuffix "-ci"
}
}

}

flutter {
Expand Down
4 changes: 2 additions & 2 deletions build_release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ flutterBin=~/Tools/flutter/bin/flutter

mkdir -p ./release

$flutterBin build appbundle
$flutterBin build apk --split-per-abi
$flutterBin build appbundle --flavor prod
$flutterBin build apk --flavor prod --split-per-abi
Binary file added ci_files/keystore-github-ci.jks
Binary file not shown.

0 comments on commit 6b498fc

Please sign in to comment.