Build #3
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: Build | |
on: | |
workflow_dispatch: | |
push: | |
tags: | |
- v* | |
jobs: | |
build-windows: | |
permissions: | |
contents: write | |
runs-on: windows-latest | |
env: | |
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" | |
steps: | |
- name: Checkout branch | |
uses: actions/checkout@v4 | |
#- name: Export GitHub Actions cache environment variables | |
# uses: actions/github-script@v7 | |
# with: | |
# script: | | |
# core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); | |
# core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); | |
#- name: Install dependencies | |
# run: | | |
# vcpkg install lmdb gtk3 pkgconf | |
- name: Setup Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
channel: 'stable' | |
- name: Setup Rust toolchain | |
uses: dtolnay/rust-toolchain@stable | |
- uses: Swatinem/rust-cache@v2 | |
- name: Install Protoc | |
uses: arduino/setup-protoc@v3 | |
with: | |
version: "26.x" | |
- name: Install the Rust dependencies | |
run: cargo install 'flutter_rust_bridge_codegen' rinf protoc-gen-prost | |
- name: Activate Protobuf | |
run: flutter pub global activate protoc_plugin | |
- name: Flutter pub get | |
run: flutter pub get | |
- name: Generate message files | |
run: rinf message | |
- name: Build Windows | |
run: flutter build windows --release --verbose | |
- uses: benjlevesque/short-sha@v3.0 | |
id: short-sha | |
with: | |
length: 7 | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
path: build/windows/x64/runner/Release/ | |
name: Rune-${{ github.ref_name }}-${{ steps.short-sha.outputs.sha }}-windows | |
- name: Build Zip for Release | |
if: github.event_name == 'push' | |
uses: thedoctor0/zip-release@master | |
with: | |
type: "zip" | |
filename: Rune-${{ github.ref_name }}-${{ steps.short-sha.outputs.sha }}-windows.zip | |
directory: build/windows/x64/runner/Release | |
- name: Release | |
if: github.event_name == 'push' | |
uses: ncipollo/release-action@v1 | |
with: | |
artifacts: build/windows/x64/runner/Release/Rune-*.zip | |
allowUpdates: true | |
replacesArtifacts: false | |
build-linux: | |
permissions: | |
contents: write | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout branch | |
uses: actions/checkout@v4 | |
- name: Install dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install liblmdb0 jq alsa-base alsa-source librust-alsa-sys-dev libasound2-dev liblmdb-dev clang cmake ninja-build pkg-config libgtk-3-dev dpkg-dev | |
- name: Setup Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
channel: 'stable' | |
- name: Setup Rust toolchain | |
uses: dtolnay/rust-toolchain@stable | |
- uses: Swatinem/rust-cache@v2 | |
- name: Install Protoc | |
uses: arduino/setup-protoc@v3 | |
with: | |
version: "26.x" | |
- name: Install the Rust dependencies | |
run: cargo install 'flutter_rust_bridge_codegen' rinf protoc-gen-prost | |
- name: Activate Protobuf | |
run: flutter pub global activate protoc_plugin | |
- name: Flutter pub get | |
run: flutter pub get | |
- name: Generate message files | |
run: rinf message | |
- name: Build linux | |
run: flutter build linux --release --verbose | |
- uses: benjlevesque/short-sha@v3.0 | |
id: short-sha | |
with: | |
length: 7 | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
path: build/linux/x64/release/bundle/ | |
name: Rune-${{ github.ref_name }}-${{ steps.short-sha.outputs.sha }}-linux | |
- name: Build Zip for Release | |
if: github.event_name == 'push' | |
uses: thedoctor0/zip-release@master | |
with: | |
type: "zip" | |
filename: Rune-${{ github.ref_name }}-${{ steps.short-sha.outputs.sha }}-windows.zip | |
directory: build/linux/x64/release/bundle | |
- name: Release | |
if: github.event_name == 'push' | |
uses: ncipollo/release-action@v1 | |
with: | |
artifacts: build/linux/x64/release/bundle/Rune-*.zip | |
allowUpdates: true | |
replacesArtifacts: false | |