-
Notifications
You must be signed in to change notification settings - Fork 0
127 lines (113 loc) · 3.74 KB
/
release.yml
File metadata and controls
127 lines (113 loc) · 3.74 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
name: "Release"
on:
push:
tags: ["v*"]
concurrency:
group: "release-${{ github.repository }}"
cancel-in-progress: false
permissions: {}
jobs:
validate:
runs-on: ubuntu-latest
timeout-minutes: 15
permissions:
contents: read
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: ShellCheck
uses: ludeeus/action-shellcheck@00cae500b08a931fb5698e11e79bfbd38e612a38 # 2.0.0
with:
severity: warning
- name: Install devcontainer CLI
run: npm install -g @devcontainers/[email protected]
- name: Smoke test (3 representative images)
run: |
for img in \
"mcr.microsoft.com/devcontainers/base:ubuntu" \
"mcr.microsoft.com/devcontainers/base:alpine" \
"mcr.microsoft.com/devcontainers/universal:2"; do
echo "--- Smoke testing: ${img} ---"
devcontainer features test \
--features claude-code \
--skip-scenarios \
--base-image "${img}" \
--project-folder .
done
version-check:
runs-on: ubuntu-latest
timeout-minutes: 5
permissions:
contents: read
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Verify version matches tag
run: |
TAG_VERSION="${GITHUB_REF_NAME#v}"
JSON_VERSION=$(python3 -c "
import json
with open('src/claude-code/devcontainer-feature.json') as f:
print(json.load(f)['version'])
")
if [[ "${TAG_VERSION}" != "${JSON_VERSION}" ]]; then
echo "ERROR: Tag version (${TAG_VERSION}) does not match feature version (${JSON_VERSION})"
exit 1
fi
echo "Version match: ${TAG_VERSION}"
publish:
needs: [validate, version-check]
runs-on: ubuntu-latest
timeout-minutes: 15
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Publish feature
uses: devcontainers/action@1082abd5d2bf3a11abccba70eef98df068277772 # v1.4.3
with:
publish-features: "true"
base-path-to-features: "./src"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
post-publish:
needs: publish
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
packages: read
steps:
- name: Verify published feature
run: |
npm install -g @devcontainers/[email protected]
TAG_VERSION="${GITHUB_REF_NAME#v}"
FEATURE_REF="ghcr.io/${{ github.repository }}/claude-code:${TAG_VERSION}"
echo "Verifying: ${FEATURE_REF}"
devcontainer features info manifest "${FEATURE_REF}" || {
echo "ERROR: Published feature not accessible at ${FEATURE_REF}"
exit 1
}
echo "Published feature verified successfully."
create-release:
needs: post-publish
runs-on: ubuntu-latest
timeout-minutes: 5
permissions:
contents: write
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0 # needed for tag history
- name: Create GitHub Release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAG_NAME: ${{ github.ref_name }}
run: |
PREV_TAG="$(git tag --sort=-v:refname | sed -n '2p')"
GENERATE_ARGS=(--generate-notes)
if [[ -n "${PREV_TAG}" ]]; then
GENERATE_ARGS+=(--notes-start-tag "${PREV_TAG}")
fi
gh release create "${TAG_NAME}" \
--title "${TAG_NAME}" \
"${GENERATE_ARGS[@]}" \
--verify-tag