Skip to content

Commit

Permalink
Split main action runner script and optimized android runner
Browse files Browse the repository at this point in the history
  • Loading branch information
hmziqrs committed Nov 18, 2024
1 parent db22910 commit 4d37523
Show file tree
Hide file tree
Showing 8 changed files with 212 additions and 543 deletions.
25 changes: 19 additions & 6 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,22 @@ jobs:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
key: ${{ runner.os }}-gradle-${{ hashFiles('app/**/*.gradle*', 'app/**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Cache Android SDK
uses: actions/cache@v3
with:
path: |
/usr/local/lib/android/sdk/platform-tools
/usr/local/lib/android/sdk/platforms
/usr/local/lib/android/sdk/build-tools
/usr/local/lib/android/sdk/licenses
key: ${{ runner.os }}-android-sdk-${{ hashFiles('app/android/build.gradle') }}
restore-keys: |
${{ runner.os }}-android-sdk-
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
Expand All @@ -35,8 +47,8 @@ jobs:
with:
path: |
${{ env.PUB_CACHE }}
.dart_tool
key: ${{ runner.os }}-pub-${{ hashFiles('**/pubspec.lock') }}
app/.dart_tool
key: ${{ runner.os }}-pub-${{ hashFiles('app/**/pubspec.lock') }}
restore-keys: |
${{ runner.os }}-pub-
Expand All @@ -59,11 +71,12 @@ jobs:
run: |
cd app
dart ./scripts/keys-n-stuff.dart
- name: Install pub dependencies
run: cd app && flutter pub get
- name: Sync android version
run: cd app && dart scripts/version_sync.dart
- run: |
cd app
flutter pub get
dart scripts/version_sync.dart
flutter build apk -t lib/main.firebase.dart --release
flutter build appbundle -t lib/main.firebase.dart --release
Expand Down
43 changes: 43 additions & 0 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
on:
push:
tags:
- "*"

name: Linux build and release
jobs:
linux:
name: Linux
runs-on: ubuntu-latest
steps:
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
cache: true
flutter-version: "3.24.5"
channel: "stable"

- uses: actions/checkout@v4
with:
path: "app"

- name: Install required build tools for linux
run: |
sudo apt-get update -y
sudo apt-get upgrade -y
sudo apt-get install -y curl git unzip xz-utils zip libglu1-mesa
sudo apt-get install clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev libstdc++-12-dev
- run: |
cd app
flutter config --enable-linux-desktop
flutter pub get
flutter build linux --release
cd build/linux/x64/release
zip -r linux-release.zip bundle
- name: Create linux Release
uses: ncipollo/release-action@v1
with:
artifacts: "app/build/linux/x64/release/linux-release.zip"
token: ${{ secrets.TOKEN }}
allowUpdates: true
47 changes: 47 additions & 0 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
on:
push:
tags:
- "*"

name: MacOS build and release
jobs:
macos:
name: MacOS
runs-on: macos-latest
steps:
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
cache: true
flutter-version: "3.22.2"
channel: "stable"

- uses: actions/checkout@v4
with:
path: "app"

- uses: actions/checkout@v4
with:
repository: "hmziqrs/keys-n-stuff"
path: "app/.keys-n-stuff"
token: ${{ secrets.TOKEN }}

- name: Execute Keys n Stuff
run: |
cd app
dart ./scripts/keys-n-stuff.dart
- run: |
cd app
flutter config --enable-macos-desktop
flutter pub global activate flutterfire_cli
flutter pub get
flutter build macos -t lib/main.firebase.dart --release
cd build/macos/Build/Products/Release
ditto -c -k --sequesterRsrc --keepParent flutter_uis.app macos-release.zip
- uses: ncipollo/release-action@v1
with:
artifacts: "app/build/macOS/Build/Products/Release/macos-release.zip"
token: ${{ secrets.TOKEN }}
allowUpdates: true
Loading

0 comments on commit 4d37523

Please sign in to comment.