Skip to content

Commit

Permalink
fix(ci): simplify triggers and build files
Browse files Browse the repository at this point in the history
  • Loading branch information
kolaente committed Jun 6, 2024
1 parent 48f4c06 commit 35a4dc6
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 161 deletions.
41 changes: 0 additions & 41 deletions .github/workflows/build-unsigned-debug.yml

This file was deleted.

53 changes: 0 additions & 53 deletions .github/workflows/build.yml

This file was deleted.

20 changes: 0 additions & 20 deletions .github/workflows/flutter-format.yml

This file was deleted.

61 changes: 15 additions & 46 deletions .github/workflows/flutter-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,60 +11,29 @@ on:

jobs:
release:
name: Build
name: Build and Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1

- name: Setup Java
uses: actions/setup-java@v1
with:
java-version: '12.x'

- name: Setup Flutter
uses: subosito/flutter-action@v1
- name: Clone repository
uses: actions/checkout@v4
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: stable

- name: Flutter version
run: flutter --version

- name: Cache pub dependencies
uses: actions/cache@v2
with:
path: ${{ env.FLUTTER_HOME }}/.pub-cache
key: ${{ runner.os }}-pub-${{ hashFiles('**/pubspec.lock') }}
restore-keys: ${{ runner.os }}-pub-

- name: Download pub dependencies
run: flutter pub get

- name: Download Android keystore
id: android_keystore
uses: timheuer/base64-to-file@v1.0.3
with:
fileName: key.jks
encodedString: ${{ secrets.ANDROID_KEYSTORE_BASE64 }}

- name: Create key.properties
run: |
echo "storeFile=${{ steps.android_keystore.outputs.filePath }}" > android/key.properties
echo "storePassword=${{ secrets.ANDROID_KEYSTORE_PASSWORD }}" >> android/key.properties
echo "keyPassword=${{ secrets.ANDROID_KEY_PASSWORD }}" >> android/key.properties
echo "keyAlias=${{ secrets.ANDROID_KEY_ALIAS }}" >> android/key.properties
- name: Build Android App Bundle
run: flutter build appbundle --flavor core

- name: Build Android APK
run: flutter build apk --flavor core

cache: true
# optional parameters follow
cache-key: "flutter-:os:-:channel:-:version:-:arch:-:hash:" # optional, change this to force refresh cache
cache-path: "${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:" # optional, change this to specify the cache path
pub-cache-key: "flutter-pub:os:-:channel:-:version:-:arch:-:hash:" # optional, change this to force refresh cache of dart pub get dependencies
pub-cache-path: "${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:" # optional, change this to specify the cache path
- run: flutter --version
- run: flutter pub get
- run: flutter build apk --debug --flavor core
- run: flutter build appbundle --flavor core
- name: Upload build artifacts
uses: actions/upload-artifact@v2
with:
name: app-release-bundle
path: |
build/app/outputs/bundle/coreRelease/app-core-release.aab
build/app/outputs/flutter-apk/app-core-release.apk
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: 'Flutter Build'

on: [push, pull_request]
on:
pull_request: {}
push:
branches:
- main

jobs:
build-app:
Expand All @@ -22,3 +26,15 @@ jobs:
- run: flutter --version
- run: flutter pub get
- run: flutter build apk --debug --flavor core
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@v4
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
- name: Check Dart Format
run: dart format --set-exit-if-changed .

0 comments on commit 35a4dc6

Please sign in to comment.