-
Notifications
You must be signed in to change notification settings - Fork 1
80 lines (67 loc) · 2.53 KB
/
Copy pathrelease.yml
File metadata and controls
80 lines (67 loc) · 2.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
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