build #84
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: | |
env: | |
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse | |
jobs: | |
build_linux: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- uses: dtolnay/rust-toolchain@stable | |
- name: Install dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install libdbus-1-dev pkg-config libgtk-4-dev libadwaita-1-dev gettext libfuse2 | |
- name: Install cargo-make | |
run: cargo install cargo-make | |
- name: Install appimage-builder | |
run: | | |
curl --location -o appimage-builder https://github.com/AppImageCrafters/appimage-builder/releases/download/v1.1.0/appimage-builder-1.1.0-x86_64.AppImage | |
chmod +x appimage-builder | |
sudo mv appimage-builder /usr/bin/ | |
- name: Build cli | |
run: cargo build --release --package openscq30_cli | |
- name: Build AppImage | |
working-directory: ./packaging/appimage | |
run: appimage-builder --skip-tests | |
- name: Move to artifacts directory | |
run: | | |
mkdir artifacts | |
mv target/release/openscq30_cli artifacts/openscq30_cli-linux-x86_64 | |
mv packaging/appimage/openscq30_gui-*.AppImage* artifacts/ | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: linux | |
path: artifacts/* | |
build_macos: | |
runs-on: macos-12 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- uses: dtolnay/rust-toolchain@stable | |
- run: brew install gtk4 libadwaita | |
- name: Build gui | |
run: cargo build --release --package openscq30_gui | |
- name: Build cli | |
run: cargo build --release --package openscq30_cli | |
- name: Move to artifacts directory | |
run: | | |
mkdir artifacts | |
mv target/release/openscq30_cli artifacts/openscq30_cli-macos-x86_64 | |
mv target/release/openscq30_gui artifacts/openscq30_gui-macos-x86_64 | |
- name: Upload gui | |
uses: actions/upload-artifact@v3 | |
with: | |
name: macos | |
path: artifacts/* | |
build_windows: | |
runs-on: windows-2022 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
# Temporarily move the preinstalled git, it causes errors related to cygwin. | |
- name: Move git binary | |
run: | | |
Move-Item "C:\Program Files\Git\usr\bin" "C:\Program Files\Git\usr\notbin" | |
Move-Item "C:\Program Files\Git\bin" "C:\Program Files\Git\notbin" | |
- name: Build GTK4 | |
run: | | |
python -m pip install --user pipx | |
python -m pipx ensurepath | |
pipx install gvsbuild | |
gvsbuild build --ninja-opts -j2 gtk4 libadwaita | |
- name: Restore git binary | |
run: | | |
Move-Item "C:\Program Files\Git\usr\notbin" "C:\Program Files\Git\usr\bin" | |
Move-Item "C:\Program Files\Git\notbin" "C:\Program Files\Git\bin" | |
- name: Install cargo-make | |
run: cargo install cargo-make | |
- name: Build gui | |
run: | | |
$env:Path = "C:\gtk-build\gtk\x64\release\bin;" + $env:Path | |
$env:LIB = "C:\gtk-build\gtk\x64\release\lib;" + $env:LIB | |
$env:INCLUDE = "C:\gtk-build\gtk\x64\release\include;C:\gtk-build\gtk\x64\release\include\cairo;C:\gtk-build\gtk\x64\release\include\glib-2.0;C:\gtk-build\gtk\x64\release\include\gobject-introspection-1.0;C:\gtk-build\gtk\x64\release\lib\glib-2.0\include;" + $env:INCLUDE | |
.\packaging\windows\build.ps1 | |
- name: Build cli | |
run: cargo build --release --package openscq30_cli | |
- name: Move to artifacts directory | |
run: | | |
New-Item -Type Directory -Path artifacts | |
Move-Item .\target\release\openscq30_cli.exe artifacts\openscq30_cli-windows-x86_64.exe | |
Move-Item .\packaging\windows\Output\OpenSCQ30_Setup.exe artifacts\openscq30_gui_setup-windows-x86_64.exe | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: windows | |
path: artifacts/* | |
build_android: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
targets: armv7-linux-androideabi,aarch64-linux-android,i686-linux-android,x86_64-linux-android | |
- uses: actions/setup-java@v3 | |
with: | |
distribution: temurin # See 'Supported distributions' for available options | |
java-version: 17 | |
- name: Install cargo-ndk | |
run: cargo install cargo-ndk | |
- name: Build | |
run: ./gradlew --no-daemon assembleBluetoothRelease | |
working-directory: android | |
- name: Rename apk | |
run: mv android/app/build/outputs/apk/bluetooth/release/app-bluetooth-release-unsigned.apk openscq30_android.apk | |
- name: Upload apk | |
uses: actions/upload-artifact@v3 | |
with: | |
name: android | |
path: openscq30_android.apk |