Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 10 additions & 57 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,64 +22,17 @@ jobs:
with:
go-version-file: 'go.mod'

- name: Build all platforms
run: |
VERSION=${GITHUB_REF_NAME#v}
BUILD_TIME=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
LDFLAGS="-s -w -X main.version=${VERSION} -X main.buildTime=${BUILD_TIME}"

mkdir -p dist

# No CGO - pure Go cross-compilation
CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -ldflags "$LDFLAGS" -o dist/ccx-darwin-arm64 ./cmd/ccx
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -ldflags "$LDFLAGS" -o dist/ccx-darwin-amd64 ./cmd/ccx
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "$LDFLAGS" -o dist/ccx-linux-amd64 ./cmd/ccx
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -ldflags "$LDFLAGS" -o dist/ccx-linux-arm64 ./cmd/ccx
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
version: '~> v2'
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Create archives
- name: Package and upload skill bundle
run: |
mkdir -p release
VERSION=${GITHUB_REF_NAME#v}

for binary in dist/ccx-*; do
name=$(basename "$binary")
parts=(${name//-/ })
os=${parts[1]}
arch=${parts[2]}

if [[ "$os" == "darwin" ]]; then
os_name="macOS"
else
os_name="linux"
fi

if [[ "$arch" == "amd64" ]]; then
arch_name="x86_64"
else
arch_name="arm64"
fi

archive_name="ccx_${VERSION}_${os_name}_${arch_name}"
mkdir -p "release/${archive_name}"
cp "$binary" "release/${archive_name}/ccx"
chmod +x "release/${archive_name}/ccx"
cp LICENSE README.md "release/${archive_name}/"

tar -czvf "release/${archive_name}.tar.gz" -C release "${archive_name}"
done

cd release && sha256sum *.tar.gz > checksums.txt

- name: Package skill bundle
run: zip -r release/ccx.skill skills/ccx/

- name: Create Release
uses: softprops/action-gh-release@v1
with:
files: |
release/*.tar.gz
release/checksums.txt
release/ccx.skill
generate_release_notes: true
zip -r ccx.skill skills/ccx/
gh release upload ${{ github.ref_name }} ccx.skill --clobber
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
59 changes: 59 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
version: 2
project_name: ccx

release:
prerelease: auto
name_template: "v{{.Version}}"
draft: false
mode: "keep-existing"

before:
hooks:
- go mod tidy
- go test ./...

builds:
- <<: &build_defaults
binary: ccx
main: ./cmd/ccx
ldflags:
- -s -w
- -X main.version={{.Version}}
- -X main.buildTime={{.Date}}
env:
- CGO_ENABLED=0
id: macos
goos: [darwin]
goarch: [amd64, arm64]

- <<: *build_defaults
id: linux
goos: [linux]
goarch: [amd64, arm64]

archives:
- id: nix
ids: [macos, linux]
name_template: >-
{{ .ProjectName }}_{{ .Version }}_{{- if eq .Os "darwin" }}macOS{{- else }}{{ .Os }}{{- end }}_{{- if eq .Arch "amd64" }}x86_64{{- else }}{{ .Arch }}{{- end }}
wrap_in_directory: true
formats: [tar.gz]
files:
- LICENSE
- README.md

checksum:
name_template: 'checksums.txt'
algorithm: sha256

changelog:
use: github
sort: asc
filters:
exclude:
- '^docs:'
- '^chore:'
- '^ci:'
- '^test:'
- Merge pull request
- Merge branch
1 change: 1 addition & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@./CLAUDE.md
Loading
Loading