Skip to content

chore: release v0.13.1 #46

chore: release v0.13.1

chore: release v0.13.1 #46

Workflow file for this run

name: Release
on:
push:
tags:
- "v*"
permissions:
contents: write
jobs:
release:
name: Build & Publish
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: "20"
cache: npm
cache-dependency-path: web/package-lock.json
- name: Install web deps
run: cd web && npm ci
- name: Extract version
id: ver
run: |
TAG="${GITHUB_REF_NAME}"
VERSION="${TAG#v}"
echo "tag=${TAG}" >> "$GITHUB_OUTPUT"
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
- name: Lint & test
run: |
make ui-react
make lint
make test
- name: Build release binaries
env:
VERSION: ${{ steps.ver.outputs.version }}
run: |
set -euo pipefail
mkdir -p dist
commit="$(git rev-parse --short HEAD)"
built="$(date -u +%Y-%m-%dT%H:%M:%SZ)"
ldflags="-s -w -X main.Version=${VERSION} -X main.GitCommit=${commit} -X main.BuildTime=${built}"
build() {
local goos="$1" goarch="$2" ext="$3"
local out="dist/slmcode_${VERSION}_${goos}_${goarch}${ext}"
echo "Building ${out}"
GOOS="$goos" GOARCH="$goarch" CGO_ENABLED=0 \
go build -trimpath -ldflags "$ldflags" -o "$out" ./cmd/slmcode
chmod +x "$out" || true
}
build darwin amd64 ""
build darwin arm64 ""
build linux amd64 ""
build linux arm64 ""
build windows amd64 ".exe"
build windows arm64 ".exe"
cp scripts/install-remote.sh dist/install.sh
cp scripts/install.ps1 dist/install.ps1
cp scripts/install.cmd dist/install.cmd
(
cd dist
shasum -a 256 slmcode_* install.sh install.ps1 install.cmd > SHA256SUMS
)
ls -lah dist
- name: Sync Homebrew formula checksums
env:
VERSION: ${{ steps.ver.outputs.version }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -euo pipefail
# Apply the formula update on top of the latest main (not the tag
# checkout) so the repo stays linear.
cp scripts/update-formula.sh /tmp/update-formula.sh
git fetch origin main
git checkout -B main origin/main
bash /tmp/update-formula.sh "$VERSION" "$PWD/dist"
if git diff --quiet -- Formula/slmcode.rb; then
echo "Formula unchanged — nothing to commit"
else
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add Formula/slmcode.rb
git commit -m "chore: sync Homebrew formula checksums for v${VERSION} [skip ci]"
git remote set-url origin "https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
git push origin main
fi
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.ver.outputs.tag }}
name: SLMCode ${{ steps.ver.outputs.tag }}
generate_release_notes: true
body: |
## Install
**macOS / Linux / WSL**
```bash
curl -fsSL https://raw.githubusercontent.com/UnicoLab/slmcode/main/scripts/install-remote.sh | bash
```
**Windows (PowerShell)**
```powershell
irm https://raw.githubusercontent.com/UnicoLab/smlcode/main/scripts/install.ps1 | iex
```
**Homebrew**
```bash
brew install --formula https://raw.githubusercontent.com/UnicoLab/slmcode/main/Formula/slmcode.rb
```
Made with ♥ by [UnicoLab](https://unicolab.ai)
files: |
dist/slmcode_*
dist/install.sh
dist/install.ps1
dist/install.cmd
dist/SHA256SUMS
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}