From 68c7f1b3fced83e46be6e6ba2e3de037e0a0a521 Mon Sep 17 00:00:00 2001 From: siujamo Date: Fri, 4 Sep 2026 10:16:41 +0800 Subject: [PATCH] ci: migrate release build to GitHub Actions - add .github/workflows/build.yml: native per-OS runners (ubuntu/macos/windows) build and attach archives to the GitHub Release via gh CLI with GITHUB_TOKEN - add workflow_dispatch to smoke-test builds without publishing a release - remove .gitea/workflows/build.yml (cargo-zigbuild + Gitea API upload no longer used) - docs: point clone and release URLs at github.com and update the Building section --- .gitea/workflows/build.yml | 76 ------------------------------------- .github/workflows/build.yml | 64 +++++++++++++++++++++++++++++++ README.md | 6 +-- 3 files changed, 67 insertions(+), 79 deletions(-) delete mode 100644 .gitea/workflows/build.yml create mode 100644 .github/workflows/build.yml diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml deleted file mode 100644 index 27de6b5..0000000 --- a/.gitea/workflows/build.yml +++ /dev/null @@ -1,76 +0,0 @@ -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: Set version - run: | - VERSION="${{ github.event.release.tag_name }}" - VERSION="${VERSION#v}" - echo "CCSM_VERSION=$VERSION" >> "$GITHUB_ENV" - - - 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 to release - run: | - curl --fail -X POST \ - -H "Authorization: Bearer ${{ secrets.GITEA_TOKEN }}" \ - -H "Content-Type: application/octet-stream" \ - --data-binary @"target/${{ matrix.target }}/release/${{ matrix.archive }}" \ - "${{ github.server_url }}/api/v1/repos/${{ github.repository }}/releases/${{ github.event.release.id }}/assets?name=${{ matrix.archive }}" diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..a7496c3 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,64 @@ +name: Build + +on: + release: + types: [published] + workflow_dispatch: # manual: build + package only (no version override, no upload) + +permissions: + contents: write # so GITHUB_TOKEN can upload assets to the release + +jobs: + build: + name: ${{ matrix.archive }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + include: + - os: ubuntu-latest + target: x86_64-unknown-linux-gnu + binary: ccsm + archive: ccsm-linux-amd64.tar.gz + - os: macos-latest + target: x86_64-apple-darwin + binary: ccsm + archive: ccsm-darwin-amd64.tar.gz + - os: windows-latest + target: x86_64-pc-windows-msvc + binary: ccsm.exe + archive: ccsm-windows-amd64.zip + + steps: + - name: Checkout + uses: actions/checkout@v7 + + - name: Set version from release tag + if: github.event_name == 'release' + run: | + VERSION="${GITHUB_REF_NAME#v}" + echo "CCSM_VERSION=$VERSION" >> "$GITHUB_ENV" + + - name: Install Rust toolchain (+ target) + uses: dtolnay/rust-toolchain@stable + with: + targets: ${{ matrix.target }} + + - name: Build release binary + run: cargo build --release --target ${{ matrix.target }} + + - name: Package archive + shell: bash + run: | + cd "target/${{ matrix.target }}/release" + if [[ "${{ runner.os }}" == 'Windows' ]]; then + powershell -NoProfile -Command "Compress-Archive -Path '${{ matrix.binary }}' -DestinationPath '${{ matrix.archive }}' -Force" + else + tar czf "${{ matrix.archive }}" "${{ matrix.binary }}" + fi + + - name: Upload to GitHub release + if: github.event_name == 'release' + env: + GH_TOKEN: ${{ github.token }} + run: gh release upload "${{ github.event.release.tag_name }}" "target/${{ matrix.target }}/release/${{ matrix.archive }}" --clobber diff --git a/README.md b/README.md index e3438a0..43ce090 100644 --- a/README.md +++ b/README.md @@ -7,14 +7,14 @@ A CLI tool for discovering, installing, and managing [Claude Code](https://claud ### From source ```bash -git clone https://onixbyte.dev/onixbyte/claude-code-skill-manager.git +git clone https://github.com/onixbyte/claude-code-skill-manager.git cd claude-code-skill-manager cargo install --path . ``` ### Pre-built binaries -Download the latest binary for your platform from the [Releases](https://onixbyte.dev/onixbyte/claude-code-skill-manager/releases) page. +Download the latest binary for your platform from the [Releases](https://github.com/onixbyte/claude-code-skill-manager/releases) page. ## Quick start @@ -166,7 +166,7 @@ CCSM fetches `skills.json` from the raw `main` or `master` branch automatically, cargo build --release ``` -Cross-compilation targets: Linux (amd64), macOS (amd64), and Windows (amd64) via `cargo-zigbuild`. +Release binaries for Linux, macOS, and Windows (amd64) are built natively per platform by GitHub Actions and attached to each GitHub Release. ## Contributing