Files
leonwww/.github/workflows/build-gurty.yml
phoenixbackrooms 0b50dd47c1 splitting up builds
2025-09-17 20:23:02 +03:00

73 lines
1.9 KiB
YAML

name: Build Gurty
on:
push:
paths:
- 'protocol/cli/**'
- 'protocol/library/**'
- '.github/workflows/build-gurty.yml'
pull_request:
paths:
- 'protocol/cli/**'
- 'protocol/library/**'
- '.github/workflows/build-gurty.yml'
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
jobs:
build-gurty:
name: Build Gurty
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
platform: linux
ext: ""
- os: windows-latest
target: x86_64-pc-windows-msvc
platform: windows
ext: ".exe"
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Cache cargo dependencies
uses: actions/cache@v4
with:
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
protocol/target/
key: ${{ runner.os }}-gurty-${{ hashFiles('protocol/cli/Cargo.lock', 'protocol/library/Cargo.toml') }}
restore-keys: |
${{ runner.os }}-gurty-
${{ runner.os }}-cargo-
- name: Build Gurty
run: |
cd protocol/cli
cargo build --release --target ${{ matrix.target }}
- name: Prepare artifacts
shell: bash
run: |
mkdir -p artifacts/${{ matrix.platform }}
cp protocol/cli/target/${{ matrix.target }}/release/gurty${{ matrix.ext }} artifacts/${{ matrix.platform }}/
- name: Upload Gurty artifacts
uses: actions/upload-artifact@v4
with:
name: gurty-${{ matrix.platform }}
path: artifacts/${{ matrix.platform }}
retention-days: 30