Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
129 changes: 129 additions & 0 deletions .github/workflows/android-flutter-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
name: Android Flutter Build

on:
workflow_dispatch:

permissions:
contents: read

jobs:
build-android:
runs-on: windows-2025
timeout-minutes: 90
env:
RUSTFLAGS: -Awarnings
RUST_TOOLCHAIN_VERSION: 1.95.0
FVM_VERSION: 4.1.2
TYPESCRIPT_VERSION: 5.9.3
WASM_BINDGEN_VERSION: 0.2.122
WASI_SDK_VERSION: "20.0"
QUICKJS_WASM_SYS_WASI_SDK_MAJOR_VERSION: 20
QUICKJS_WASM_SYS_WASI_SDK_MINOR_VERSION: 0

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install bootstrap Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
cache: true

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 22

- name: Install Java
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: "17"

- name: Install FVM
shell: pwsh
run: |
dart pub global activate fvm $env:FVM_VERSION
"$env:APPDATA\Pub\Cache\bin" | Out-File -FilePath $env:GITHUB_PATH -Append -Encoding utf8

- name: Install project Flutter SDK
working-directory: apps/flutter/app
shell: pwsh
run: fvm install --skip-pub-get

- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.RUST_TOOLCHAIN_VERSION }}
targets: aarch64-linux-android,armv7-linux-androideabi,x86_64-linux-android,wasm32-unknown-unknown

- name: Prepare Android bindgen libclang
shell: pwsh
run: |
$version = "21.1.8"
$packageName = "libclang.runtime.win-x64.$version"
$toolsDir = "target/operit-build-tools"
$packageDir = Join-Path $toolsDir $packageName
$archive = Join-Path $toolsDir "$packageName.nupkg"
New-Item -ItemType Directory -Force -Path $toolsDir | Out-Null
Invoke-WebRequest -Uri "https://www.nuget.org/api/v2/package/libclang.runtime.win-x64/$version" -OutFile $archive
Expand-Archive -Path $archive -DestinationPath $packageDir -Force
$libclang = Join-Path $packageDir "runtimes/win-x64/native/libclang.dll"
if (-not (Test-Path -LiteralPath $libclang)) {
throw "Android bindgen libclang was not prepared at $libclang"
}

- name: Restore Android signing material
shell: pwsh
env:
ANDROID_RELEASE_KEYSTORE_BASE64: ${{ secrets.ANDROID_RELEASE_KEYSTORE_BASE64 }}
ANDROID_RELEASE_STORE_PASSWORD: ${{ secrets.ANDROID_RELEASE_STORE_PASSWORD }}
ANDROID_RELEASE_KEY_ALIAS: ${{ secrets.ANDROID_RELEASE_KEY_ALIAS }}
ANDROID_RELEASE_KEY_PASSWORD: ${{ secrets.ANDROID_RELEASE_KEY_PASSWORD }}
run: |
$required = @(
"ANDROID_RELEASE_KEYSTORE_BASE64",
"ANDROID_RELEASE_STORE_PASSWORD",
"ANDROID_RELEASE_KEY_ALIAS",
"ANDROID_RELEASE_KEY_PASSWORD"
)
$missing = $required | Where-Object { [string]::IsNullOrWhiteSpace([Environment]::GetEnvironmentVariable($_)) }
if ($missing.Count -gt 0) {
throw "Missing required GitHub Actions secrets: $($missing -join ', ')"
}
$secretsDir = "tools/release/secrets"
New-Item -ItemType Directory -Force -Path $secretsDir | Out-Null
$keystore = Join-Path $secretsDir "operit2-release.keystore"
[System.IO.File]::WriteAllBytes($keystore, [System.Convert]::FromBase64String($env:ANDROID_RELEASE_KEYSTORE_BASE64))
@"
RELEASE_STORE_FILE=operit2-release.keystore
RELEASE_STORE_PASSWORD=$env:ANDROID_RELEASE_STORE_PASSWORD
RELEASE_KEY_ALIAS=$env:ANDROID_RELEASE_KEY_ALIAS
RELEASE_KEY_PASSWORD=$env:ANDROID_RELEASE_KEY_PASSWORD
"@ | Set-Content -Path (Join-Path $secretsDir "android-signing.properties") -Encoding utf8

- name: Check build environment
shell: pwsh
run: python tools/build_scripts/check_environment.py --products app --github-runner

- name: Build Web Access assets
shell: pwsh
run: python tools/build_scripts/build_flutter_web_access.py

- name: Build and package Android app
shell: pwsh
run: |
$version = (Select-String -Path apps/flutter/app/pubspec.yaml -Pattern '^version:\s*(\d+\.\d+\.\d+)\+(\d+)\s*$').Matches
if ($version.Count -ne 1) {
throw "apps/flutter/app/pubspec.yaml must contain exactly one release version line"
}
python tools/build_scripts/build_flutter_android.py --build-name $version[0].Groups[1].Value --build-number $version[0].Groups[2].Value --enforce-lockfile

- name: Upload Android artifacts
uses: actions/upload-artifact@v4
with:
name: operit2-android-${{ github.sha }}
path: tools/release/dist/operit2-app-android-*.apk
if-no-files-found: error
retention-days: 14
120 changes: 120 additions & 0 deletions .github/workflows/linux-release-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
name: Linux Release Build

on:
workflow_dispatch:
inputs:
products:
description: "Release products to build"
required: false
default: "all"
type: choice
options:
- "app"
- "cli"
- "all"
cli_arches:
description: "Linux CLI architectures"
required: false
default: "all"
type: choice
options:
- "host"
- "all"
- "x86_64"
- "aarch64"

permissions:
contents: read

jobs:
build-linux:
runs-on: ubuntu-24.04
timeout-minutes: 90
env:
RUSTFLAGS: -Awarnings
RUST_TOOLCHAIN_VERSION: 1.95.0
FVM_VERSION: 4.1.2
TYPESCRIPT_VERSION: 5.9.3
WASM_BINDGEN_VERSION: 0.2.122
WASI_SDK_VERSION: "20.0"
QUICKJS_WASM_SYS_WASI_SDK_MAJOR_VERSION: 20
QUICKJS_WASM_SYS_WASI_SDK_MINOR_VERSION: 0

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install Linux build dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
clang \
cmake \
gcc-aarch64-linux-gnu \
libgstreamer-plugins-base1.0-dev \
libgstreamer1.0-dev \
libgtk-3-dev \
liblzma-dev \
libwebkit2gtk-4.1-dev \
libc6-dev-arm64-cross \
musl-tools \
ninja-build \
pkg-config

- name: Install bootstrap Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
cache: true

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 22

- name: Install FVM
run: |
dart pub global activate fvm "$FVM_VERSION"
echo "$HOME/.pub-cache/bin" >> "$GITHUB_PATH"

- name: Install project Flutter SDK
working-directory: apps/flutter/app
run: fvm install --skip-pub-get

- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.RUST_TOOLCHAIN_VERSION }}
targets: x86_64-unknown-linux-musl,aarch64-unknown-linux-gnu,wasm32-unknown-unknown

- name: Check build environment
run: python3 tools/build_scripts/check_environment.py --products "${{ inputs.products }}" --cli-arches "${{ inputs.cli_arches }}" --github-runner

- name: Build Web Access assets
run: python3 tools/build_scripts/build_flutter_web_access.py

- name: Build and package Linux app
if: inputs.products != 'cli'
run: python3 tools/build_scripts/build_flutter_linux.py --archive-path tools/release/dist/operit2-app-linux-x86_64.tar.gz --enforce-lockfile

- name: Build and package Linux CLI
if: inputs.products != 'app'
run: python3 tools/build_scripts/build_cli_linux.py --arches "${{ inputs.cli_arches }}"

- name: Upload Linux app artifact
if: inputs.products != 'cli'
uses: actions/upload-artifact@v4
with:
name: operit2-linux-app-${{ github.sha }}
path: tools/release/dist/operit2-app-linux-x86_64.tar.gz
if-no-files-found: error
retention-days: 14

- name: Upload Linux CLI artifacts
if: inputs.products != 'app'
uses: actions/upload-artifact@v4
with:
name: operit2-linux-cli-${{ github.sha }}
path: tools/release/dist/operit2-cli-linux-*.tar.gz
if-no-files-found: error
retention-days: 14
113 changes: 113 additions & 0 deletions .github/workflows/windows-release-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
name: Windows Release Build

on:
workflow_dispatch:
inputs:
products:
description: "Release products to build"
required: false
default: "all"
type: choice
options:
- "app"
- "cli"
- "all"
cli_arches:
description: "Windows CLI architectures"
required: false
default: "all"
type: choice
options:
- "host"
- "all"
- "x86_64"
- "aarch64"

permissions:
contents: read

jobs:
build-windows:
runs-on: windows-2025
timeout-minutes: 90
env:
RUSTFLAGS: -Awarnings
RUST_TOOLCHAIN_VERSION: 1.95.0
FVM_VERSION: 4.1.2
TYPESCRIPT_VERSION: 5.9.3
WASM_BINDGEN_VERSION: 0.2.122
WASI_SDK_VERSION: "20.0"
QUICKJS_WASM_SYS_WASI_SDK_MAJOR_VERSION: 20
QUICKJS_WASM_SYS_WASI_SDK_MINOR_VERSION: 0

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install bootstrap Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
cache: true

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 22

- name: Install FVM
shell: pwsh
run: |
dart pub global activate fvm $env:FVM_VERSION
"$env:APPDATA\Pub\Cache\bin" | Out-File -FilePath $env:GITHUB_PATH -Append -Encoding utf8

- name: Install project Flutter SDK
working-directory: apps/flutter/app
shell: pwsh
run: fvm install --skip-pub-get

- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.RUST_TOOLCHAIN_VERSION }}
targets: x86_64-pc-windows-msvc,aarch64-pc-windows-msvc,wasm32-unknown-unknown

- name: Install LLVM
shell: pwsh
run: choco install llvm --no-progress --limit-output --yes

- name: Check build environment
shell: pwsh
run: python tools/build_scripts/check_environment.py --products "${{ inputs.products }}" --cli-arches "${{ inputs.cli_arches }}" --github-runner

- name: Build Web Access assets
shell: pwsh
run: python tools/build_scripts/build_flutter_web_access.py

- name: Build and package Windows app
if: inputs.products != 'cli'
shell: pwsh
run: python tools/build_scripts/build_flutter_windows.py --archive-path tools/release/dist/operit2-app-windows-x86_64.zip --enforce-lockfile

- name: Build and package Windows CLI
if: inputs.products != 'app'
shell: pwsh
run: python tools/build_scripts/build_cli_windows.py --arches "${{ inputs.cli_arches }}"

- name: Upload Windows app artifact
if: inputs.products != 'cli'
uses: actions/upload-artifact@v4
with:
name: operit2-windows-app-${{ github.sha }}
path: tools/release/dist/operit2-app-windows-x86_64.zip
if-no-files-found: error
retention-days: 14

- name: Upload Windows CLI artifacts
if: inputs.products != 'app'
uses: actions/upload-artifact@v4
with:
name: operit2-windows-cli-${{ github.sha }}
path: tools/release/dist/operit2-cli-windows-*.zip
if-no-files-found: error
retention-days: 14
Loading
Loading