Skip to content
Open
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
32 changes: 32 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: ci

on:
pull_request:
push:
branches:
- main

permissions:
contents: read

jobs:
test:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: stable

- name: Validate skill
run: ./scripts/validate-skill.sh --quick --score-only

- name: Test
run: go test ./...

- name: Smoke test
run: ./scripts/smoke-test.sh
110 changes: 32 additions & 78 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,98 +1,52 @@
name: Release
name: release

on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
workflow_dispatch:
inputs:
version_bump:
description: 'Version bump type'
required: true
default: 'patch'
type: choice
options:
- patch
- minor
- major
- "v*"

permissions:
contents: write

jobs:
validate:
uses: ./.github/workflows/validate.yml

release:
needs: validate
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v5
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Determine version
id: version
run: |
if [[ "${{ github.event_name }}" == "push" ]]; then
TAG="${GITHUB_REF#refs/tags/}"
echo "new_tag=$TAG" >> "$GITHUB_OUTPUT"
echo "Using pushed tag: $TAG"
else
LATEST=$(git tag --sort=-v:refname | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' | head -n 1)
if [ -z "$LATEST" ]; then
MAJOR=1; MINOR=0; PATCH=0
else
VERSION="${LATEST#v}"
MAJOR=$(echo "$VERSION" | cut -d. -f1)
MINOR=$(echo "$VERSION" | cut -d. -f2)
PATCH=$(echo "$VERSION" | cut -d. -f3)

case "${{ inputs.version_bump }}" in
major) MAJOR=$((MAJOR + 1)); MINOR=0; PATCH=0 ;;
minor) MINOR=$((MINOR + 1)); PATCH=0 ;;
patch) PATCH=$((PATCH + 1)) ;;
esac
fi
NEW_TAG="v${MAJOR}.${MINOR}.${PATCH}"
echo "new_tag=$NEW_TAG" >> "$GITHUB_OUTPUT"
echo "Computed next version: $NEW_TAG (bump: ${{ inputs.version_bump }})"
fi
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: stable

- name: Get release info
id: release_info
run: |
MSG=$(git log -1 --pretty=format:'%s')
echo "msg=$MSG" >> "$GITHUB_OUTPUT"
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v7
with:
distribution: goreleaser
version: "~> v2"
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

DELIMITER="EOF_$(openssl rand -hex 8)"
BODY=$(git log -1 --pretty=format:'%b')
{
echo "body<<$DELIMITER"
printf '%s' "$BODY"
echo ""
echo "$DELIMITER"
} >> "$GITHUB_OUTPUT"
- name: Package skills bundle
run: ./scripts/package-skills.sh "${GITHUB_REF_NAME}"

- name: Create tag (manual dispatch only)
if: github.event_name == 'workflow_dispatch'
- name: Generate skills bundle checksum
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git tag "${{ steps.version.outputs.new_tag }}"
git push origin "${{ steps.version.outputs.new_tag }}"

- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.version.outputs.new_tag }}
name: ${{ steps.version.outputs.new_tag }}
body: |
**Commit:** `${{ github.sha }}`
**Branch:** `${{ github.ref_name }}`
**Author:** ${{ github.actor }}

${{ steps.release_info.outputs.body }}
draft: false
prerelease: false
cd dist
sha256sum "composekit-skills_${GITHUB_REF_NAME}.tar.gz" >> checksums.txt
cat checksums.txt

- name: Upload checksums (updated)
run: gh release upload "${GITHUB_REF_NAME}" "dist/checksums.txt" --clobber
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Upload skills bundle
run: gh release upload "${GITHUB_REF_NAME}" "dist/composekit-skills_${GITHUB_REF_NAME}.tar.gz" --clobber
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
17 changes: 0 additions & 17 deletions .github/workflows/validate.yml

This file was deleted.

23 changes: 23 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,24 @@
.DS_Store
__MACOSX/

# Go build output
bin/
dist/
tmp/
tmp-*/
*.test
*.out

# Local smoke-test output
tmp-smoke/
tmp-skills/
tmp-home/

# Editor/local
.idea/
.vscode/
.env
.env.*

# OS
Thumbs.db
51 changes: 51 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
version: 2

project_name: composekit

before:
hooks:
- go mod tidy
- go test ./...
- ./scripts/validate-skill.sh --quick --score-only

builds:
- id: composekit
main: .
binary: composekit
env:
- CGO_ENABLED=0
ldflags:
- -s -w
- -X main.version={{.Version}}
- -X main.commit={{.Commit}}
- -X main.date={{.Date}}
goos:
- darwin
- linux
- windows
goarch:
- amd64
- arm64

archives:
- id: binaries
builds:
- composekit
name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
format_overrides:
- goos: windows
formats:
- zip
files:
- README.md
- LICENSE

checksum:
name_template: "checksums.txt"

changelog:
sort: asc

release:
draft: false
prerelease: auto
21 changes: 21 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
APP := composekit

.PHONY: build test smoke validate-skill clean snapshot

build:
go build -o bin/$(APP) .

test:
go test ./...

smoke:
./scripts/smoke-test.sh

validate-skill:
./scripts/validate-skill.sh

clean:
rm -rf bin dist tmp-smoke tmp-skills

snapshot:
goreleaser release --snapshot --clean
Loading
Loading