mirror of
https://github.com/instructkr/claw-code.git
synced 2026-10-18 00:00:11 +08:00
- actions/checkout: v4 → 11d5960a326750d5838078e36cf38b85af677262 - actions/setup-python: v5 → a26af69be951a213d495a4c3e4e4022e16d87065 - actions/upload-artifact: v4 → ea165f8d65b6e75b540449e92b4886f43607fa02 - dtolnay/rust-toolchain: stable → 686976e191b89faba57d3206551f0f330d8cb249 - Swatinem/rust-cache: v2 → 49a0bdc70d2e1b713ca9e2869b211fcce03d3c1c - softprops/action-gh-release: v2 → 3bb12739c298aeb8a4eeaf626c5b8d85266b0e65 Improves supply chain security by pinning Actions to specific commits instead of mutable tag references, preventing unexpected behavior changes if action maintainers update tags. Fixes #3287
78 lines
2.1 KiB
YAML
78 lines
2.1 KiB
YAML
name: Release binaries
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'v*'
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
concurrency:
|
|
group: release-${{ github.ref }}
|
|
cancel-in-progress: false
|
|
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
|
|
jobs:
|
|
build:
|
|
name: build-${{ matrix.name }}
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- name: linux-x64
|
|
os: ubuntu-latest
|
|
bin: claw
|
|
artifact_name: claw-linux-x64
|
|
- name: macos-arm64
|
|
os: macos-14
|
|
bin: claw
|
|
artifact_name: claw-macos-arm64
|
|
- name: windows-x64
|
|
os: windows-latest
|
|
bin: claw.exe
|
|
artifact_name: claw-windows-x64.exe
|
|
defaults:
|
|
run:
|
|
working-directory: rust
|
|
steps:
|
|
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262
|
|
|
|
- uses: dtolnay/rust-toolchain@686976e191b89faba57d3206551f0f330d8cb249
|
|
|
|
- uses: Swatinem/rust-cache@49a0bdc70d2e1b713ca9e2869b211fcce03d3c1c
|
|
with:
|
|
workspaces: rust -> target
|
|
|
|
- name: Build release binary
|
|
run: cargo build --release -p rusty-claude-cli
|
|
|
|
- name: Package artifact and checksum
|
|
shell: bash
|
|
run: |
|
|
mkdir -p dist
|
|
cp "target/release/${{ matrix.bin }}" "dist/${{ matrix.artifact_name }}"
|
|
chmod +x "dist/${{ matrix.artifact_name }}"
|
|
(cd dist && sha256sum "${{ matrix.artifact_name }}" > "${{ matrix.artifact_name }}.sha256")
|
|
|
|
- name: Upload workflow artifact
|
|
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
|
|
with:
|
|
name: ${{ matrix.artifact_name }}
|
|
path: |
|
|
rust/dist/${{ matrix.artifact_name }}
|
|
rust/dist/${{ matrix.artifact_name }}.sha256
|
|
|
|
- name: Upload release asset
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
uses: softprops/action-gh-release@3bb12739c298aeb8a4eeaf626c5b8d85266b0e65
|
|
with:
|
|
files: |
|
|
rust/dist/${{ matrix.artifact_name }}
|
|
rust/dist/${{ matrix.artifact_name }}.sha256
|
|
fail_on_unmatched_files: true
|