- .github/workflows/release.yml: on tag v* build all 5 targets (macOS
arm64/x86_64, Linux arm64/x86_64 incl. free arm runners, Windows
x86_64) with the release-dist profile, archive kigi-<version>-<triple>
with LICENSE/NOTICE/THIRD-PARTY-NOTICES, generate SHA256SUMS, publish
the release (prerelease for tags containing '-'), with a tag↔workspace
version guard.
- install.sh / install.ps1 (repo root): platform detection, latest or
--version download from GitHub Releases, SHA-256 verification against
SHA256SUMS, install into the kigi home's downloads/ + bin/kigi symlink
(the same layout the self-updater manages), smoke test, PATH guidance.
- kigi-update rewritten onto the GitHub Releases API (documented wire
shape; stable=/latest, alpha=semver-max across the list, pinned=/tags):
SHA-256 gate before any binary swap, tar.gz/zip extraction per
platform, atomic bin/kigi symlink swap, channel/rollback semantics and
the KIGI_AUTO_UPDATE gate preserved verbatim; every x.ai/GCS/npm
endpoint deleted, npm/gh-release installers removed, legacy grok/agent
links retired on install. kigi-env owns the update base URL with a
KIGI_UPDATE_BASE_URL override (this is what the test artifact server
injects).
- .cargo/config.toml: removed the non-portable neoverse-v2 CPU pin on
Linux arm64 (fleet-specific); RELRO/NX hardening link-args now apply
to the gnu targets too, matching the release-dist profile's contract.
- THIRD-PARTY-NOTICES regenerated via cargo-about (about.toml +
template); the M0 hand-built file is dropped and README points at the
generated one. docs/RELEASE.md carries the release checklist.
- Deleted xAI-era leftovers: kigi-tui/scripts/install*.{sh,ps1} (x.ai
CDN) and the @xai-official/grok npm skeleton (PRD F8: no npm).
Gates: fmt clean; workspace check/clippy 0/0 (--locked, -D warnings);
kigi-update 58 lib + 86 integration tests green; deny ok;
release-dist build of kigi-bin succeeds and reports 'kigi 0.1.0'.
135 lines
4.5 KiB
YAML
135 lines
4.5 KiB
YAML
name: Release
|
|
|
|
# PRD F8: on tag push v*, build the single-file kigi binary for the five
|
|
# supported targets, package per-target archives named
|
|
# kigi-<version>-<target-triple>.{tar.gz|zip} (binary + LICENSE + NOTICE +
|
|
# THIRD-PARTY-NOTICES), generate SHA256SUMS, and publish everything as a
|
|
# GitHub Release. install.sh / install.ps1 and the in-app self-updater
|
|
# (kigi-update) both resolve these exact asset names — keep the naming in
|
|
# lockstep with auto_update::release_asset_name().
|
|
|
|
on:
|
|
push:
|
|
tags: ["v*"]
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
|
|
jobs:
|
|
build:
|
|
name: build (${{ matrix.target }})
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- target: aarch64-apple-darwin
|
|
os: macos-14
|
|
# macos-14 runners are arm64; the x86_64 slice is a cross-compile
|
|
# against the same SDK (macos-13 Intel runners are deprecated).
|
|
- target: x86_64-apple-darwin
|
|
os: macos-14
|
|
- target: x86_64-unknown-linux-gnu
|
|
os: ubuntu-24.04
|
|
- target: aarch64-unknown-linux-gnu
|
|
os: ubuntu-24.04-arm
|
|
- target: x86_64-pc-windows-msvc
|
|
os: windows-2022
|
|
runs-on: ${{ matrix.os }}
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Check tag matches workspace version
|
|
shell: bash
|
|
run: |
|
|
tag_version="${GITHUB_REF_NAME#v}"
|
|
cargo_version="$(sed -n 's/^version = "\(.*\)"$/\1/p' Cargo.toml | head -n 1)"
|
|
if [ "$tag_version" != "$cargo_version" ]; then
|
|
echo "Tag $GITHUB_REF_NAME does not match workspace version $cargo_version" >&2
|
|
exit 1
|
|
fi
|
|
|
|
- name: Install toolchain (rust-toolchain.toml)
|
|
run: rustup show
|
|
|
|
- name: Add build target
|
|
run: rustup target add ${{ matrix.target }}
|
|
|
|
- name: Install dotslash (protoc launcher)
|
|
run: cargo install dotslash --locked
|
|
|
|
- uses: Swatinem/rust-cache@v2
|
|
with:
|
|
key: ${{ matrix.target }}
|
|
|
|
- name: Build kigi (release-dist)
|
|
run: cargo build --profile release-dist -p kigi-bin --locked --target ${{ matrix.target }}
|
|
|
|
- name: Package archive (tar.gz)
|
|
if: runner.os != 'Windows'
|
|
shell: bash
|
|
run: |
|
|
version="${GITHUB_REF_NAME#v}"
|
|
archive="kigi-${version}-${{ matrix.target }}.tar.gz"
|
|
staging="$(mktemp -d)"
|
|
cp "target/${{ matrix.target }}/release-dist/kigi" "$staging/kigi"
|
|
cp LICENSE "$staging/"
|
|
[ -f NOTICE ] && cp NOTICE "$staging/"
|
|
for f in THIRD-PARTY-NOTICES THIRD-PARTY-NOTICES.md; do
|
|
[ -f "$f" ] && cp "$f" "$staging/"
|
|
done
|
|
tar -C "$staging" -czf "$archive" .
|
|
shasum -a 256 "$archive" || sha256sum "$archive"
|
|
echo "ARCHIVE=$archive" >> "$GITHUB_ENV"
|
|
|
|
- name: Package archive (zip)
|
|
if: runner.os == 'Windows'
|
|
shell: pwsh
|
|
run: |
|
|
$version = $env:GITHUB_REF_NAME.TrimStart("v")
|
|
$archive = "kigi-$version-${{ matrix.target }}.zip"
|
|
$staging = New-Item -ItemType Directory -Path (Join-Path $env:RUNNER_TEMP "staging")
|
|
Copy-Item "target/${{ matrix.target }}/release-dist/kigi.exe" (Join-Path $staging "kigi.exe")
|
|
Copy-Item LICENSE $staging
|
|
if (Test-Path NOTICE) { Copy-Item NOTICE $staging }
|
|
foreach ($f in @("THIRD-PARTY-NOTICES", "THIRD-PARTY-NOTICES.md")) {
|
|
if (Test-Path $f) { Copy-Item $f $staging }
|
|
}
|
|
Compress-Archive -Path (Join-Path $staging "*") -DestinationPath $archive
|
|
Get-FileHash -Algorithm SHA256 $archive
|
|
Add-Content -Path $env:GITHUB_ENV -Value "ARCHIVE=$archive"
|
|
|
|
- name: Upload artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: ${{ env.ARCHIVE }}
|
|
path: ${{ env.ARCHIVE }}
|
|
if-no-files-found: error
|
|
|
|
release:
|
|
name: publish GitHub Release
|
|
needs: build
|
|
runs-on: ubuntu-24.04
|
|
steps:
|
|
- uses: actions/download-artifact@v4
|
|
with:
|
|
path: dist
|
|
merge-multiple: true
|
|
|
|
- name: Generate SHA256SUMS
|
|
working-directory: dist
|
|
run: |
|
|
ls -l
|
|
sha256sum kigi-* > SHA256SUMS
|
|
cat SHA256SUMS
|
|
|
|
- name: Create GitHub Release
|
|
uses: softprops/action-gh-release@v2
|
|
with:
|
|
files: dist/*
|
|
prerelease: ${{ contains(github.ref_name, '-') }}
|
|
generate_release_notes: true
|
|
fail_on_unmatched_files: true
|