Files
claude-code-skill-manager/.gitea/workflows/build.yml
T
siujamo f6be25415b ci: trigger build on release published
- Replace push, pull_request, and tag triggers with release published event
2026-06-22 10:56:38 +08:00

69 lines
2.0 KiB
YAML

name: Build
on:
release:
types: [published]
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-unknown-linux-gnu
binary: ccsm
archive: ccsm-linux-amd64.tar.gz
- target: x86_64-apple-darwin
binary: ccsm
archive: ccsm-darwin-amd64.tar.gz
- target: x86_64-pc-windows-gnu
binary: ccsm.exe
archive: ccsm-windows-amd64.zip
steps:
- uses: actions/checkout@v4
- name: Install Rust
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable
echo "$HOME/.cargo/bin" >> "$GITHUB_PATH"
- name: Install Rust targets
run: |
rustup target add ${{ matrix.target }}
- name: Build (Linux)
if: matrix.target == 'x86_64-unknown-linux-gnu'
run: cargo build --release --target ${{ matrix.target }}
- name: Install Zig
if: matrix.target != 'x86_64-unknown-linux-gnu'
run: |
curl -L -o zig.tar.xz https://ziglang.org/download/0.13.0/zig-linux-x86_64-0.13.0.tar.xz
tar xf zig.tar.xz
echo "$PWD/zig-linux-x86_64-0.13.0" >> "$GITHUB_PATH"
- name: Install cargo-zigbuild
if: matrix.target != 'x86_64-unknown-linux-gnu'
run: cargo install cargo-zigbuild
- name: Build with zigbuild
if: matrix.target != 'x86_64-unknown-linux-gnu'
run: cargo zigbuild --release --target ${{ matrix.target }}
- name: Package
run: |
cd "target/${{ matrix.target }}/release"
if [[ "${{ matrix.target }}" == *-windows-* ]]; then
zip "${{ matrix.archive }}" "${{ matrix.binary }}"
else
tar czf "${{ matrix.archive }}" "${{ matrix.binary }}"
fi
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.archive }}
path: target/${{ matrix.target }}/release/${{ matrix.archive }}