Files

174 lines
4.8 KiB
YAML

on:
pull_request:
push:
workflow_dispatch:
jobs:
build_ubuntu:
runs-on: ubuntu-latest
steps:
- name: gitconfig
run: |
git config --global core.autocrlf input
- name: checkout
uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
targets: x86_64-unknown-linux-gnu
components: rustfmt, clippy
- name: Set up cargo cache
uses: Swatinem/rust-cache@v2
continue-on-error: false
with:
key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}
shared-key: ${{ runner.os }}-cargo-
- name: Install build dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
meson \
ninja-build \
pkg-config \
libgtk-3-dev \
libayatana-appindicator3-dev
- name: make
run: make
- name: 'Tar files' # keeps permissions (execute)
run: tar -cvf zerotier-desktop-ui.tar target/debug/zerotier_desktop_ui
- name: Archive production artifacts
uses: actions/upload-artifact@v4
with:
name: zerotier-desktop-ui-ubuntu-x64
path: zerotier-desktop-ui.tar
retention-days: 7
build_macos:
runs-on: macos-latest
steps:
- name: gitconfig
run: |
git config --global core.autocrlf input
- name: checkout
uses: actions/checkout@v4
- name: Install Rust aarch64
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
target: aarch64-apple-darwin
components: rustfmt, clippy
- name: Install Rust x86_64
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
target: x86_64-apple-darwin
components: rustfmt, clippy
- name: Set up cargo cache
uses: Swatinem/rust-cache@v2
continue-on-error: false
with:
key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}
shared-key: ${{ runner.os }}-cargo-
- name: Install build dependencies
run: |
brew install meson ninja
- name: make
run: make
- name: 'Tar files' # keeps permissions (execute)
run: tar -cvf zerotier-desktop-ui.tar ZeroTier.app
- name: Archive production artifacts
uses: actions/upload-artifact@v4
with:
name: zerotier-desktop-ui-mac
path: zerotier-desktop-ui.tar
retention-days: 7
build_windows:
runs-on: windows-2022
strategy:
fail-fast: false
matrix:
include:
- arch: x64
msvc_arch: amd64
winlibs_arch: x86_64
rust_target: x86_64-pc-windows-msvc
rustflags: '-C target-feature=+crt-static'
tray_make_args: ''
- arch: x86
msvc_arch: x86
winlibs_arch: i686
rust_target: i686-pc-windows-msvc
rustflags: '-C link-args=/SAFESEH:NO -C target-feature=+crt-static'
tray_make_args: 'WIN_32BIT=1'
steps:
- name: gitconfig
run: |
git config --global core.autocrlf true
- name: checkout
uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
targets: ${{ matrix.rust_target }}
components: rustfmt, clippy
- name: Set up cargo cache
uses: Swatinem/rust-cache@v2
continue-on-error: false
with:
key: ${{ runner.os }}-${{ matrix.arch }}-cargo-${{ hashFiles('Cargo.lock') }}
shared-key: ${{ runner.os }}-${{ matrix.arch }}-cargo-
- name: Setup MSVC environment
uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{ matrix.msvc_arch }}
- name: Setup MinGW (for tray)
uses: bwoodsend/setup-winlibs-action@v1
with:
architecture: ${{ matrix.winlibs_arch }}
- name: Install build dependencies
run: |
pip install meson
- name: Build libui-ng
shell: cmd
working-directory: libui-ng
run: |
if exist build rmdir /Q /S build
meson setup build --buildtype=release -Db_vscrt=mt --default-library=static --backend=ninja
ninja -C build
cd build\meson-out
ren libui.a ui.lib
- name: Build tray library
shell: cmd
working-directory: tray
run: |
mingw32-make clean
mingw32-make zt_lib ${{ matrix.tray_make_args }}
- name: Build zerotier_desktop_ui
shell: cmd
env:
RUSTFLAGS: ${{ matrix.rustflags }}
run: |
cargo build --target=${{ matrix.rust_target }}
- name: Archive production artifacts
uses: actions/upload-artifact@v4
with:
name: zerotier-desktop-ui-windows-${{ matrix.arch }}
path: target/${{ matrix.rust_target }}/debug/zerotier_desktop_ui.exe
retention-days: 7