Update CI #33
Workflow file for this run
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
name: Flutter Build & Release | |
on: | |
push: | |
tags: | |
- 'v*' | |
env: | |
FLUTTER_VERSION: '3.22.2' | |
RUST_VERSION: '1.79.0' | |
jobs: | |
build-and-release: | |
name: Build & Release APK | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
- name: Install Rust | |
uses: actions-rust-lang/setup-rust-toolchain@v1 | |
with: | |
cache: true | |
cache-workspaces: |- | |
./rus | |
- name: Set up Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
channel: stable | |
flutter-version: ${{ env.FLUTTER_VERSION }} | |
cache: true | |
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 | |
- uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' # See 'Supported distributions' for available options | |
java-version: '17' | |
- name: Print outputs | |
shell: bash | |
run: | | |
echo CACHE-PATH=${{ steps.flutter-action.outputs.CACHE-PATH }} | |
echo CACHE-KEY=${{ steps.flutter-action.outputs.CACHE-KEY }} | |
echo CHANNEL=${{ steps.flutter-action.outputs.CHANNEL }} | |
echo VERSION=${{ steps.flutter-action.outputs.VERSION }} | |
echo ARCHITECTURE=${{ steps.flutter-action.outputs.ARCHITECTURE }} | |
echo PUB-CACHE-PATH=${{ steps.flutter-action.outputs.PUB-CACHE-PATH }} | |
echo PUB-CACHE-KEY=${{ steps.flutter-action.outputs.PUB-CACHE-KEY }} | |
- name: Get Flutter Dependencies | |
run: flutter pub get | |
- name: Restore Keystore | |
run: | | |
echo "${{ secrets.KEYSTORE_FILE }}" | base64 -d > android/app/my-release-key.jks | |
- name: Build APK | |
run: | | |
flutter build apk --release \ | |
--android-project-arg=KEYSTORE_FILE=my-release-key.jks \ | |
--android-project-arg=KEYSTORE_PASSWORD=${{ secrets.KEYSTORE_PASSWORD }} \ | |
--android-project-arg=KEY_ALIAS=${{ secrets.KEY_ALIAS }} \ | |
--android-project-arg=KEY_PASSWORD=${{ secrets.KEY_PASSWORD }} | |
- name: Create GitHub Release | |
uses: softprops/action-gh-release@v2 | |
with: | |
files: | | |
build/app/outputs/apk/release/app-arm64-v8a-release.apk | |
build/app/outputs/apk/release/app-armeabi-v7a-release.apk | |
build/app/outputs/apk/release/app-universal-release.apk | |
build/app/outputs/apk/release/app-x86_64-release.apk | |
token: ${{ secrets.PUBLISH_GITHUB_TOKEN }} | |
build-and-release-windows-x64: | |
name: Build & Release Windows x64 | |
runs-on: windows-latest | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
- name: Install Rust | |
uses: actions-rust-lang/setup-rust-toolchain@v1 | |
with: | |
cache: true | |
cache-workspaces: |- | |
./rust | |
- name: Set up Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
channel: stable | |
flutter-version: ${{ env.FLUTTER_VERSION }} | |
cache: true | |
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 | |
- name: Print outputs | |
shell: bash | |
run: | | |
echo CACHE-PATH=${{ steps.flutter-action.outputs.CACHE-PATH }} | |
echo CACHE-KEY=${{ steps.flutter-action.outputs.CACHE-KEY }} | |
echo CHANNEL=${{ steps.flutter-action.outputs.CHANNEL }} | |
echo VERSION=${{ steps.flutter-action.outputs.VERSION }} | |
echo ARCHITECTURE=${{ steps.flutter-action.outputs.ARCHITECTURE }} | |
echo PUB-CACHE-PATH=${{ steps.flutter-action.outputs.PUB-CACHE-PATH }} | |
echo PUB-CACHE-KEY=${{ steps.flutter-action.outputs.PUB-CACHE-KEY }} | |
- name: Get Flutter Dependencies | |
run: flutter pub get | |
- name: Build Windows | |
run: flutter build windows | |
- name: Package Windows Build | |
run: | | |
cd build\windows\x64\runner\Release && 7z a -tzip windows-x64.zip .\* | |
- name: Create GitHub Release | |
uses: softprops/action-gh-release@v2 | |
with: | |
files: | | |
build/windows/x64/runner/Release/windows-x64.zip | |
token: ${{ secrets.PUBLISH_GITHUB_TOKEN }} | |
build-and-release-linux-x64: | |
name: Build & Release Linux x64 | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
- name: Install Linux Dependencies | |
run: | | |
sudo apt-get update -y | |
sudo apt-get install -y ninja-build libgtk-3-dev | |
- name: Install Rust | |
uses: actions-rust-lang/setup-rust-toolchain@v1 | |
with: | |
cache: true | |
cache-workspaces: |- | |
./rust | |
- name: Set up Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
channel: stable | |
flutter-version: ${{ env.FLUTTER_VERSION }} | |
cache: true | |
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 | |
- name: Print outputs | |
shell: bash | |
run: | | |
echo CACHE-PATH=${{ steps.flutter-action.outputs.CACHE-PATH }} | |
echo CACHE-KEY=${{ steps.flutter-action.outputs.CACHE-KEY }} | |
echo CHANNEL=${{ steps.flutter-action.outputs.CHANNEL }} | |
echo VERSION=${{ steps.flutter-action.outputs.VERSION }} | |
echo ARCHITECTURE=${{ steps.flutter-action.outputs.ARCHITECTURE }} | |
echo PUB-CACHE-PATH=${{ steps.flutter-action.outputs.PUB-CACHE-PATH }} | |
echo PUB-CACHE-KEY=${{ steps.flutter-action.outputs.PUB-CACHE-KEY }} | |
- name: Get Flutter Dependencies | |
run: flutter pub get | |
- name: Build Linux | |
run: flutter build linux | |
- name: Package Linux Tarball | |
run: | | |
cd build/linux/x64/release/bundle && tar -czvf linux-x64.tar.gz * | |
- name: Create GitHub Release | |
uses: softprops/action-gh-release@v2 | |
with: | |
files: | | |
build/linux/x64/release/bundle/linux-x64.tar.gz | |
token: ${{ secrets.PUBLISH_GITHUB_TOKEN }} | |
build-and-release-ios: | |
name: Build & Release iOS | |
runs-on: macos-latest | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
- name: Install Rust | |
uses: actions-rust-lang/setup-rust-toolchain@v1 | |
with: | |
cache: true | |
cache-workspaces: |- | |
./rust | |
- name: Set up Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
channel: stable | |
flutter-version: ${{ env.FLUTTER_VERSION }} | |
cache: true | |
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 | |
- name: Print outputs | |
shell: bash | |
run: | | |
echo CACHE-PATH=${{ steps.flutter-action.outputs.CACHE-PATH }} | |
echo CACHE-KEY=${{ steps.flutter-action.outputs.CACHE-KEY }} | |
echo CHANNEL=${{ steps.flutter-action.outputs.CHANNEL }} | |
echo VERSION=${{ steps.flutter-action.outputs.VERSION }} | |
echo ARCHITECTURE=${{ steps.flutter-action.outputs.ARCHITECTURE }} | |
echo PUB-CACHE-PATH=${{ steps.flutter-action.outputs.PUB-CACHE-PATH }} | |
echo PUB-CACHE-KEY=${{ steps.flutter-action.outputs.PUB-CACHE-KEY }} | |
- name: Get Flutter Dependencies | |
run: flutter pub get | |
- name: Build iOS | |
run: | | |
flutter build ios --release --no-codesign | |
cd build/ios/iphoneos | |
mkdir Payload | |
mv ./Runner.app ./Payload | |
zip -r -m ./ios-nosigned.ipa ./Payload | |
- name: Create GitHub Release | |
uses: softprops/action-gh-release@v2 | |
with: | |
files: | | |
build/ios/iphoneos/ios-nosigned.ipa | |
token: ${{ secrets.PUBLISH_GITHUB_TOKEN }} | |
build-and-release-macos-arm64: | |
name: Build & Release macOS arm64 & x86_64 | |
runs-on: macos-latest | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
- name: Install Rust | |
uses: actions-rust-lang/setup-rust-toolchain@v1 | |
with: | |
cache: true | |
cache-workspaces: |- | |
./rust | |
- name: Set up Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
channel: stable | |
flutter-version: ${{ env.FLUTTER_VERSION }} | |
- name: Get Flutter Dependencies | |
run: flutter pub get | |
- name: Build macOS arm64 | |
run: | | |
export FLUTTER_BUILD_ARCH=arm64 | |
flutter build macos | |
ditto -c -k --sequesterRsrc --keepParent build/macos/Build/Products/Release/yande_gui.app macos-arm64-nosigned.zip | |
- name: Build macOS x86_64 | |
run: | | |
export FLUTTER_BUILD_ARCH=x86_64 | |
flutter build macos | |
ditto -c -k --sequesterRsrc --keepParent build/macos/Build/Products/Release/yande_gui.app macos-x86_64-nosigned.zip | |
- name: Create GitHub Release | |
uses: softprops/action-gh-release@v2 | |
with: | |
files: | | |
macos-arm64-nosigned.app | |
macos-x86_64-nosigned.app | |
token: ${{ secrets.PUBLISH_GITHUB_TOKEN }} |