Files
claude-code-skill-manager/.gitea/workflows/build.yml
T
siujamo 12aea0fc26
Build / build (ccsm-darwin-amd64.tar.gz, ccsm, x86_64-apple-darwin) (push) Failing after 4m34s
Build / build (ccsm-linux-amd64.tar.gz, ccsm, x86_64-unknown-linux-gnu) (push) Failing after 2m27s
Build / build (ccsm-windows-amd64.zip, ccsm.exe, x86_64-pc-windows-gnu) (push) Has been cancelled
Replace cross-rs with cargo-zigbuild for cross-compilation
cross-rs has no Docker image for macOS targets and the Windows image
has a broken cargo PATH, causing all non-Linux builds to fail.
Zig's toolchain handles Linux→macOS and Linux→Windows cross-compilation
from a single ubuntu runner. Also add --target to the native Linux build
so the output path matches the Package step.
2026-06-22 09:56:30 +08:00

72 lines
2.1 KiB
YAML

name: Build
on:
push:
branches: [main]
tags: ["*"]
pull_request:
branches: [main]
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@v4
with:
name: ${{ matrix.archive }}
path: target/${{ matrix.target }}/release/${{ matrix.archive }}