Files
zpan/.github/workflows/release.yml
T
Jasper VanandClaude Opus 4.8 c1542e6a9c refactor(openapi): drop the committed spec artifact; gen Go client from the full doc (#441)
No more docs/openapi/downloader.json and no curated subset. The Go client is
generated straight from the complete, live /api/openapi.json: a single
scripts/openapi-client.ts boots the in-memory app, reads the whole merged
document, and feeds it to oapi-codegen via a throwaway temp file — only the
generated client.gen.go is committed.

- delete docs/openapi/downloader.json, cmd/oapi-codegen.yaml, and the three
  build/generate/check scripts; replace with one scripts/openapi-client.ts
  (`pnpm openapi:client` / `--check`).
- generate from the full document — every endpoint, no allowlist/prune. The
  only transforms are whole-document mechanics for oapi-codegen (3.1→3.0
  nullable, strip security, declare better-auth's missing path params).
- rename the CI step + package scripts openapi:downloader:* → openapi:client*.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-15 23:17:33 -04:00

131 lines
3.7 KiB
YAML

name: Release
on:
push:
tags: ['v*']
jobs:
check:
name: Typecheck & Test
runs-on: ubuntu-latest
if: github.repository == 'saltbo/zpan'
permissions:
contents: read
steps:
- uses: actions/checkout@v6
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v6
with:
node-version: 24
cache: pnpm
- uses: actions/setup-go@v6
with:
go-version-file: cmd/go.mod
cache-dependency-path: cmd/go.sum
- run: pnpm install --frozen-lockfile
- run: pnpm release:check-version
- run: pnpm lint
- run: pnpm typecheck
- run: pnpm openapi:client:check
- run: pnpm test
- run: mkdir -p dist # required by vitest cloudflare config
- run: pnpm test:cf
docker:
name: Docker Image
runs-on: ubuntu-latest
needs: check
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v6
- uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/metadata-action@v5
id: meta
with:
images: ghcr.io/${{ github.repository }}
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=raw,value=latest
- uses: docker/metadata-action@v5
id: cli-meta
with:
images: ghcr.io/${{ github.repository }}
# latest=false: the bare `latest` tag belongs to the server image. The
# metadata-action default (latest=auto) would re-add `latest` here and,
# since this build runs after the server build, overwrite it with the CLI image.
flavor: latest=false
tags: |
type=semver,pattern={{version}}-cli
type=semver,pattern={{major}}.{{minor}}-cli
type=semver,pattern={{major}}-cli
type=raw,value=latest-cli
- uses: docker/setup-buildx-action@v4
- uses: docker/build-push-action@v7
with:
context: .
push: true
platforms: linux/amd64,linux/arm64
build-args: |
APP_VERSION=${{ github.ref_name }}
APP_COMMIT=${{ github.sha }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
- uses: docker/build-push-action@v7
with:
context: .
target: cli
push: true
platforms: linux/amd64,linux/arm64
tags: ${{ steps.cli-meta.outputs.tags }}
labels: ${{ steps.cli-meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
release:
name: GitHub Release
runs-on: ubuntu-latest
needs: [check, docker]
permissions:
contents: write
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Generate changelog
id: changelog
uses: requarks/changelog-action@v1
with:
token: ${{ github.token }}
tag: ${{ github.ref_name }}
excludeTypes: docs,style,test
- name: Create release
uses: softprops/action-gh-release@v2
with:
body: |
${{ steps.changelog.outputs.changes }}
### Docker
```bash
docker pull ghcr.io/${{ github.repository }}:${{ github.ref_name }}
docker pull ghcr.io/${{ github.repository }}:${{ github.ref_name }}-cli
```
generate_release_notes: false