Skip to content

http4k-release

http4k-release #28

name: Update on http4k release
on:
repository_dispatch:
types:
- http4k-release
workflow_dispatch:
inputs:
version:
description: 'http4k version to generate skills for'
required: true
type: string
jobs:
regenerate-skills:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
- name: Install Claude Code CLI
run: npm install -g @anthropic-ai/claude-code
- name: Clone http4k source
run: |
VERSION="${{ github.event.client_payload.version || github.event.inputs.version }}"
PREV_VERSION=$(grep -o '"version":[[:space:]]*"[^"]*"' plugins/http4k/.claude-plugin/plugin.json | grep -o '[0-9][^"]*')
rm -rf ./tmp/http4k
git clone --depth 1 --branch "$VERSION" https://github.com/http4k/http4k.git ./tmp/http4k
if [ -n "$PREV_VERSION" ] && [ "$PREV_VERSION" != "$VERSION" ]; then
git -C ./tmp/http4k fetch --depth 1 origin tag "$PREV_VERSION"
fi
- name: Generate skill content
env:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
run: |
VERSION="${{ github.event.client_payload.version || github.event.inputs.version }}"
claude -p \
--permission-mode dontAsk \
--model sonnet \
--max-budget-usd 5 \
"Read the file .claude/commands/generate-skill.md for instructions. Follow those instructions exactly, using version ${VERSION} as the version argument. The \$ARGUMENTS placeholder in that file should be replaced with ${VERSION}. The http4k source has already been cloned to ./tmp/http4k with the required tags fetched."
- name: Clean up and verify generation
run: |
VERSION="${{ github.event.client_payload.version || github.event.inputs.version }}"
rm -rf ./tmp/http4k
head -1 plugins/http4k/skills/http4k-development/SKILL.md | grep -q "^---"
grep -q "$VERSION" plugins/http4k/.claude-plugin/plugin.json
grep -q "$VERSION" .claude-plugin/marketplace.json
- name: Commit and tag
run: |
VERSION="${{ github.event.client_payload.version || github.event.inputs.version }}"
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add -A
git commit -m "Upgrade to http4k ${VERSION}"
git tag "${VERSION}"
git pull --rebase origin master
git push origin master --tags
- name: Create GitHub release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
VERSION="${{ github.event.client_payload.version || github.event.inputs.version }}"
gh release create "${VERSION}" \
--title "http4k ${VERSION}" \
--notes "Automated release tracking http4k ${VERSION}" \
--target master