Repository navigation
187 lines (155 loc) · 5.57 KB
/
Copy pathrelease.yaml
File metadata and controls
187 lines (155 loc) · 5.57 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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
name: Release
on:
push:
tags:
- "v*"
workflow_dispatch:
inputs:
version:
description: "Version to publish, without leading v"
required: true
ref:
description: "Release tag to publish from, such as v1.24.0"
required: true
concurrency:
group: release-${{ github.ref }}-${{ github.event.inputs.version || '' }}
cancel-in-progress: false
permissions:
contents: write
id-token: write
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
jobs:
windows:
name: Windows packed setup
uses: ./.github/workflows/windows.yml
with:
ref: ${{ github.event.inputs.ref || github.ref }}
version: ${{ github.event.inputs.version || github.ref_name }}
permissions:
contents: read
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
ref: ${{ github.event.inputs.ref || github.ref }}
fetch-depth: 0
- uses: actions/setup-node@v6
with:
node-version: "24"
- uses: oven-sh/setup-bun@v2
with:
bun-version: 1.3.14
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Verify workspace lockfile
run: bun run check:workspace-lock
- name: TypeScript typecheck
run: bun run typecheck
- name: Build
run: bun run build
- name: Pi host-import guard tests
run: bun test scripts/check-pi-dist-imports.test.ts
- name: Windows receipt and runtime packaging tests
run: bun test scripts/windows packages/opencode/scripts/runtime-packaging.test.ts
- name: Pi host-import guard
run: bun run check:pi-dist-imports
- name: Packed TUI smoke test
run: bun run --cwd packages/opencode smoke:tui
env:
TUI_SMOKE_SKIP_BUILD: "1"
- name: Claustrum golden provenance
run: bun run check:claustrum-golden
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Test floor gate tests
run: bun test scripts/check-test-count-floors.test.ts
- name: Test and release floor ratchet
# HEAD^ may already carry a lowered floor from an earlier direct push.
# Require the checked-out tag and compare with the preceding release tag.
env:
CANDIDATE_REF: ${{ github.event.inputs.ref || github.ref_name }}
CANDIDATE_VERSION: ${{ github.event.inputs.version || github.ref_name }}
run: |
VERSION="${CANDIDATE_VERSION#v}"
bun scripts/check-test-count-floors.ts --release-ref "$CANDIDATE_REF" --release-version "$VERSION"
- name: Pi host tool round-trip
run: bun run test:pi-host
- name: Install OpenCode CLI for e2e
run: npm install -g opencode-ai@1.17.13
- name: E2E tests
run: bun run test:e2e
- name: Format check
run: bun run format:check
- name: Lint
run: bun run lint
publish-npm:
name: Publish ${{ matrix.package }} to npm
runs-on: ubuntu-latest
needs: [test, windows]
strategy:
fail-fast: false
matrix:
include:
- package: "@cortexkit/anthropic-auth-core"
- package: "@cortexkit/opencode-anthropic-auth"
- package: "@cortexkit/pi-anthropic-auth"
steps:
- uses: actions/checkout@v7
with:
ref: ${{ github.event.inputs.ref || github.ref }}
- uses: actions/setup-node@v6
with:
node-version: "24"
registry-url: "https://registry.npmjs.org"
- name: Ensure latest npm (for trusted publishing)
run: npm install -g npm@latest
- name: Resolve release version
id: version
env:
REQUESTED_VERSION: ${{ github.event.inputs.version || github.ref_name }}
run: |
VERSION="$REQUESTED_VERSION"
VERSION="${VERSION#v}"
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
- name: Download verified package tarballs
uses: actions/download-artifact@v8
with:
name: anthropic-release-packages
path: ${{ runner.temp }}/anthropic-packed
- name: Check whether package version is already published
id: published
run: |
if npm view "${{ matrix.package }}@${{ steps.version.outputs.version }}" version >/dev/null 2>&1; then
echo "exists=true" >> "$GITHUB_OUTPUT"
echo "${{ matrix.package }}@${{ steps.version.outputs.version }} is already published; skipping."
else
echo "exists=false" >> "$GITHUB_OUTPUT"
fi
# Uses npm Trusted Publishing (OIDC) configured on npmjs.com.
# Each package runs in a separate matrix job so npm obtains a package-scoped
# OIDC publish token for that package instead of reusing the previous one.
- name: Publish package to npm
if: steps.published.outputs.exists != 'true'
env:
PACKAGE_NAME: ${{ matrix.package }}
PACKAGE_VERSION: ${{ steps.version.outputs.version }}
run: |
PACKAGE_FILE="${PACKAGE_NAME#@}"
PACKAGE_FILE="${PACKAGE_FILE//\//-}"
TARBALL="$RUNNER_TEMP/anthropic-packed/${PACKAGE_FILE}-${PACKAGE_VERSION}.tgz"
test -f "$TARBALL"
npm publish "$TARBALL" --ignore-scripts --access public --provenance
github-release:
name: Create GitHub Release
runs-on: ubuntu-latest
needs: [test, windows]
if: github.event_name == 'push'
steps:
- uses: actions/checkout@v7
- name: Create GitHub Release
uses: softprops/action-gh-release@v3
with:
generate_release_notes: true