release: v0.2.0 — self-rollback, delete node, publish Claude Code image #3
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release | |
| # Fires when a tag like v0.1.0 / v1.2.3 is pushed. Cross-compiles linux/amd64 | |
| # + linux/arm64 via goreleaser, attaches them to a DRAFT GitHub release | |
| # (because `.goreleaser.yaml` sets `release.draft: true`) — review and | |
| # Publish in the GitHub UI when ready. Also builds + pushes multi-arch | |
| # container images to ghcr.io/css521/agentenv:<tag> + :latest. | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| permissions: | |
| contents: write # goreleaser creates the GitHub release + uploads artifacts | |
| packages: write # docker push → ghcr.io under this org | |
| jobs: | |
| goreleaser: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # goreleaser needs the full history for changelog | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.26' | |
| # QEMU lets the runner build linux/arm64 images from a linux/amd64 host. | |
| - uses: docker/setup-qemu-action@v3 | |
| - uses: docker/setup-buildx-action@v3 | |
| # GITHUB_TOKEN is automatically scoped for ghcr.io publishes when the | |
| # workflow has packages:write; no separate PAT needed. | |
| - uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - uses: goreleaser/goreleaser-action@v6 | |
| with: | |
| version: latest | |
| args: release --clean | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| # The ready-to-use Claude Code environment image (examples/claude-code). | |
| # Heavier than the bare binary image (Node + Claude Code + a build-time seeded | |
| # rootfs), so it's its own job. Built multi-arch and pushed to | |
| # ghcr.io/css521/rewindable-claude:<tag> + :latest. | |
| claude-image: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: docker/setup-qemu-action@v3 | |
| - uses: docker/setup-buildx-action@v3 | |
| - uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: tag without leading v | |
| id: ver | |
| run: echo "v=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT" | |
| - name: build + push rewindable-claude | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| file: examples/claude-code/Dockerfile | |
| platforms: linux/amd64,linux/arm64 | |
| push: true | |
| tags: | | |
| ghcr.io/css521/rewindable-claude:${{ steps.ver.outputs.v }} | |
| ghcr.io/css521/rewindable-claude:latest |