Files
claude-statusline/.gitea/workflows/release.yml
Axel Meyer 47165ce02c
All checks were successful
Release / build (push) Successful in 1m45s
Remove standalone fetcher, add setup tool with install/uninstall workflow
Drop claude-fetcher binary and cron job — the widget's built-in
BackgroundFetcher is the sole fetcher now. Add cmd/setup with cross-platform
install and uninstall (--uninstall): kills widget, removes binaries + autostart,
cleans Claude Code statusline setting, optionally removes config dir.

Also includes: browser-based login (chromedp), ICO wrapper for Windows tray
icon, and reduced icon size (64px).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 19:11:08 +01:00

84 lines
3.7 KiB
YAML

name: Release
on:
push:
tags:
- 'v*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Extract version
run: echo "VERSION=${GITHUB_REF_NAME#v}" >> $GITHUB_ENV
- name: Install Go
run: |
curl -sSL https://go.dev/dl/go1.23.6.linux-amd64.tar.gz -o /tmp/go.tar.gz
tar -C /usr/local -xzf /tmp/go.tar.gz
echo "/usr/local/go/bin" >> $GITHUB_PATH
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
- name: Install nfpm
run: go install github.com/goreleaser/nfpm/v2/cmd/nfpm@latest
- name: Build Linux binaries
run: |
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -trimpath -ldflags="-s -w" -o claude-statusline ./cmd/statusline
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -trimpath -ldflags="-s -w" -o claude-widget ./cmd/widget
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -trimpath -ldflags="-s -w" -o setup ./cmd/setup
- name: Build Windows binaries
run: |
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -trimpath -ldflags="-s -w" -o claude-statusline.exe ./cmd/statusline
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -trimpath -ldflags="-s -w -H=windowsgui" -o claude-widget.exe ./cmd/widget
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -trimpath -ldflags="-s -w" -o setup.exe ./cmd/setup
- name: Build .deb package
run: |
export PATH=$PATH:$(go env GOPATH)/bin
VERSION=${{ env.VERSION }} nfpm package --config packaging/nfpm.yaml --packager deb --target claude-statusline_${{ env.VERSION }}_amd64.deb
- name: Create Linux tarball
run: |
mkdir -p dist/claude-statusline-${{ env.VERSION }}
cp claude-statusline claude-widget setup dist/claude-statusline-${{ env.VERSION }}/
cp README.md CHANGELOG.md dist/claude-statusline-${{ env.VERSION }}/
cp packaging/linux/claude-widget.desktop dist/claude-statusline-${{ env.VERSION }}/
tar -czf claude-statusline_${{ env.VERSION }}_linux_amd64.tar.gz -C dist claude-statusline-${{ env.VERSION }}
- name: Create Windows zip
run: |
apt-get update -qq && apt-get install -y -qq zip >/dev/null 2>&1
mkdir -p dist-win/claude-statusline-${{ env.VERSION }}
cp claude-statusline.exe claude-widget.exe setup.exe dist-win/claude-statusline-${{ env.VERSION }}/
cp README.md CHANGELOG.md dist-win/claude-statusline-${{ env.VERSION }}/
cd dist-win && zip -r ../claude-statusline_${{ env.VERSION }}_windows_amd64.zip claude-statusline-${{ env.VERSION }}
- name: Create Gitea release
env:
TOKEN: ${{ secrets.RELEASE_TOKEN }}
run: |
API="${GITHUB_SERVER_URL}/api/v1/repos/${GITHUB_REPOSITORY}"
TAG="${GITHUB_REF_NAME}"
# Create release
RELEASE_ID=$(curl -s -X POST "${API}/releases" \
-H "Authorization: token ${TOKEN}" \
-H "Content-Type: application/json" \
-d "{\"tag_name\":\"${TAG}\",\"name\":\"${TAG}\",\"body\":\"See CHANGELOG.md for details.\",\"draft\":false,\"prerelease\":false}" \
| grep -o '"id":[0-9]*' | grep -m1 -o '[0-9]*')
# Upload assets
for FILE in \
claude-statusline_${{ env.VERSION }}_amd64.deb \
claude-statusline_${{ env.VERSION }}_linux_amd64.tar.gz \
claude-statusline_${{ env.VERSION }}_windows_amd64.zip; do
curl -s -X POST "${API}/releases/${RELEASE_ID}/assets?name=${FILE}" \
-H "Authorization: token ${TOKEN}" \
-F "attachment=@${FILE}"
done