Skip to content

Commit e0fd231

Browse files
philippjfrclaude
andauthored
Fold finish release into main release flow (#145)
* Fix npm publish path ambiguity and add one-off release recovery workflow npm parsed the bare "dist/*.tgz" arg as a GitHub shorthand spec instead of a local path, breaking the 1.8.0 npm publish. Prefix with ./ to disambiguate, and add finish-release.yml to retry the npm publish and GitHub release for 1.8.0 by reusing the already-built artifacts, without re-triggering the (already successful) PyPI/conda publishes. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * Replace finish-release.yml with a reuse_run_id dispatch on release.yml npm's trusted publisher for @bokeh/ipywidgets_bokeh is bound to the release.yml workflow filename, so dispatching a separate workflow file got a 404 from npm's OIDC check even though the package exists. Instead, add a workflow_dispatch input on release.yml itself that skips build/PyPI/conda and reuses artifacts from a prior run, so the npm publish (and GitHub release) retry runs under the same trusted workflow. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
1 parent fb7b19b commit e0fd231

1 file changed

Lines changed: 30 additions & 3 deletions

File tree

‎.github/workflows/release.yml‎

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,15 @@ on:
44
push:
55
tags:
66
- "[0-9]+.[0-9]+.[0-9]+*"
7+
workflow_dispatch:
8+
inputs:
9+
reuse_run_id:
10+
description: "Run ID to reuse build artifacts from, skipping build/PyPI/conda (leave empty for a normal release)"
11+
required: false
12+
prerelease:
13+
description: "Mark as a prerelease (only used when reuse_run_id is set)"
14+
type: boolean
15+
default: false
716

817
permissions:
918
contents: read
@@ -15,6 +24,7 @@ concurrency:
1524
jobs:
1625
build:
1726
name: Build and verify release artifacts
27+
if: inputs.reuse_run_id == ''
1828
runs-on: ubuntu-latest
1929
outputs:
2030
prerelease: ${{ steps.version.outputs.prerelease }}
@@ -117,6 +127,7 @@ jobs:
117127
publish-pypi:
118128
name: Publish to PyPI
119129
needs: build
130+
if: inputs.reuse_run_id == '' && always() && !failure() && !cancelled()
120131
runs-on: ubuntu-latest
121132
environment: release
122133
permissions:
@@ -138,11 +149,13 @@ jobs:
138149
publish-npm:
139150
name: Publish to npm
140151
needs: build
152+
if: always() && !failure() && !cancelled()
141153
runs-on: ubuntu-latest
142154
environment: release
143155
permissions:
144156
contents: read
145157
id-token: write
158+
actions: read
146159

147160
steps:
148161
- name: Set up Node.js for trusted publishing
@@ -157,10 +170,12 @@ jobs:
157170
with:
158171
name: npm-package
159172
path: dist
173+
run-id: ${{ inputs.reuse_run_id || github.run_id }}
174+
github-token: ${{ github.token }}
160175

161176
- name: Publish npm package
162177
env:
163-
PRERELEASE: ${{ needs.build.outputs.prerelease }}
178+
PRERELEASE: ${{ needs.build.outputs.prerelease || inputs.prerelease }}
164179
run: |
165180
args=(--access public)
166181
if [[ "$PRERELEASE" == "true" ]]; then
@@ -171,8 +186,10 @@ jobs:
171186
publish-conda:
172187
name: Publish to Anaconda.org
173188
needs: build
189+
if: inputs.reuse_run_id == '' && always() && !failure() && !cancelled()
174190
runs-on: ubuntu-latest
175191
environment: release
192+
176193
permissions:
177194
contents: read
178195

@@ -201,7 +218,7 @@ jobs:
201218
- name: Publish conda package
202219
env:
203220
ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_API_TOKEN }}
204-
PRERELEASE: ${{ needs.build.outputs.prerelease }}
221+
PRERELEASE: ${{ needs.build.outputs.prerelease || inputs.prerelease }}
205222
run: |
206223
if [[ -z "$ANACONDA_API_TOKEN" ]]; then
207224
echo "ANACONDA_API_TOKEN is not configured in the release environment" >&2
@@ -224,40 +241,50 @@ jobs:
224241
github-release:
225242
name: Create GitHub Release
226243
needs: [build, publish-pypi, publish-npm, publish-conda]
244+
if: always() && !failure() && !cancelled()
227245
runs-on: ubuntu-latest
228246
environment: release
229247
permissions:
230248
contents: write
249+
actions: read
231250

232251
steps:
233252
- name: Download Python distributions
234253
uses: actions/download-artifact@v4
235254
with:
236255
name: python-distributions
237256
path: artifacts/python
257+
run-id: ${{ inputs.reuse_run_id || github.run_id }}
258+
github-token: ${{ github.token }}
238259

239260
- name: Download npm package
240261
uses: actions/download-artifact@v4
241262
with:
242263
name: npm-package
243264
path: artifacts/npm
265+
run-id: ${{ inputs.reuse_run_id || github.run_id }}
266+
github-token: ${{ github.token }}
244267

245268
- name: Download conda package
246269
uses: actions/download-artifact@v4
247270
with:
248271
name: conda-package
249272
path: artifacts/conda
273+
run-id: ${{ inputs.reuse_run_id || github.run_id }}
274+
github-token: ${{ github.token }}
250275

251276
- name: Download checksums
252277
uses: actions/download-artifact@v4
253278
with:
254279
name: release-checksums
255280
path: artifacts/checksums
281+
run-id: ${{ inputs.reuse_run_id || github.run_id }}
282+
github-token: ${{ github.token }}
256283

257284
- name: Create GitHub Release
258285
env:
259286
GH_TOKEN: ${{ github.token }}
260-
PRERELEASE: ${{ needs.build.outputs.prerelease }}
287+
PRERELEASE: ${{ needs.build.outputs.prerelease || inputs.prerelease }}
261288
run: |
262289
args=(--verify-tag --generate-notes --title "$GITHUB_REF_NAME")
263290
if [[ "$PRERELEASE" == "true" ]]; then

0 commit comments

Comments
 (0)