Skip to content

Commit 8988bda

Browse files
FBumannclaude
andcommitted
ci: adopt blueprint release pipeline
- release.yaml: release-please on push to main, calls publish on release - publish.yaml: tag push + workflow_call, creates GitHub Release for manual tags - docs.yml: triggers after publish completes - Remove old release.yml and publish.yml Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent a23df5c commit 8988bda

5 files changed

Lines changed: 68 additions & 101 deletions

File tree

.github/workflows/docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
branches: [main]
88
workflow_dispatch: # Manual trigger
99
workflow_run:
10-
workflows: ["Release (Manual)", "Release Please"]
10+
workflows: ["Publish"]
1111
types: [completed]
1212

1313
permissions:

.github/workflows/publish.yaml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Publish
2+
3+
on:
4+
push:
5+
tags: ["v*"]
6+
workflow_call:
7+
inputs:
8+
tag:
9+
required: true
10+
type: string
11+
12+
permissions:
13+
contents: write
14+
id-token: write
15+
attestations: write
16+
17+
jobs:
18+
publish:
19+
name: Build & publish to PyPI
20+
runs-on: ubuntu-24.04
21+
timeout-minutes: 10
22+
environment:
23+
name: pypi
24+
url: https://pypi.org/project/xarray_plotly
25+
steps:
26+
- uses: actions/checkout@v4
27+
with:
28+
ref: ${{ inputs.tag || github.ref_name }}
29+
fetch-depth: 0
30+
31+
- uses: astral-sh/setup-uv@v7
32+
with:
33+
enable-cache: true
34+
35+
- uses: actions/setup-python@v5
36+
with:
37+
python-version: "3.12"
38+
39+
- name: Build
40+
run: uv build
41+
42+
- uses: pypa/gh-action-pypi-publish@release/v1
43+
44+
github-release:
45+
name: Create GitHub Release
46+
if: github.event_name == 'push'
47+
runs-on: ubuntu-24.04
48+
steps:
49+
- uses: actions/checkout@v4
50+
with:
51+
ref: ${{ github.ref_name }}
52+
53+
- name: Create GitHub Release
54+
run: |
55+
if [[ "$TAG" == *-* ]]; then
56+
gh release create "$TAG" --generate-notes --prerelease
57+
else
58+
gh release create "$TAG" --generate-notes
59+
fi
60+
env:
61+
GH_TOKEN: ${{ github.token }}
62+
TAG: ${{ github.ref_name }}

.github/workflows/publish.yml

Lines changed: 0 additions & 43 deletions
This file was deleted.

.github/workflows/release-please.yml

Lines changed: 0 additions & 42 deletions
This file was deleted.
Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,6 @@ name: Release
33
on:
44
push:
55
branches: [main]
6-
workflow_dispatch:
7-
inputs:
8-
branch:
9-
description: Branch to create the release from
10-
required: true
11-
default: main
12-
prerelease:
13-
description: Create a pre-release
14-
type: boolean
15-
default: false
166

177
permissions:
188
contents: write
@@ -35,17 +25,17 @@ jobs:
3525
- uses: googleapis/release-please-action@v4
3626
id: release
3727
with:
28+
token: ${{ steps.app-token.outputs.token }}
3829
config-file: .release-please-config.json
3930
manifest-file: .release-please-manifest.json
40-
token: ${{ steps.app-token.outputs.token }}
41-
target-branch: ${{ inputs.branch || github.ref_name }}
42-
prerelease: ${{ inputs.prerelease }}
4331

4432
publish:
45-
needs: [release-please]
33+
needs: release-please
4634
if: needs.release-please.outputs.release_created
4735
permissions:
4836
id-token: write
49-
uses: ./.github/workflows/publish.yml
37+
contents: write
38+
attestations: write
39+
uses: ./.github/workflows/publish.yaml
5040
with:
5141
tag: ${{ needs.release-please.outputs.tag_name }}

0 commit comments

Comments
 (0)