Skip to content

Commit 92fcdaa

Browse files
FBumannclaude
andauthored
ci: replace manual publish with release-please workflow (#58)
* ci: replace manual publish with release-please workflow Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * ci: rename release.yaml back to release.yml Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent dac0a04 commit 92fcdaa

File tree

1 file changed

+57
-13
lines changed

1 file changed

+57
-13
lines changed

.github/workflows/release.yml

Lines changed: 57 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,72 @@
1-
name: Release (Manual)
1+
name: Release
22

33
on:
4+
push:
5+
branches: [main]
46
workflow_dispatch:
57
inputs:
6-
tag:
7-
description: 'Tag to release (e.g., v0.0.13)'
8+
branch:
9+
description: Branch to create the release from
810
required: true
11+
default: main
12+
prerelease:
13+
description: Create a pre-release
14+
type: boolean
15+
default: false
16+
17+
permissions:
18+
contents: write
19+
pull-requests: write
920

1021
jobs:
11-
release:
12-
runs-on: ubuntu-latest
13-
permissions:
14-
id-token: write # for trusted publishing
22+
release-please:
23+
name: Release Please
24+
runs-on: ubuntu-24.04
25+
outputs:
26+
release_created: ${{ steps.release.outputs.release_created }}
27+
tag_name: ${{ steps.release.outputs.tag_name }}
28+
steps:
29+
- uses: actions/create-github-app-token@v2
30+
id: app-token
31+
with:
32+
app-id: ${{ secrets.APP_ID }}
33+
private-key: ${{ secrets.APP_PRIVATE_KEY }}
34+
35+
- uses: googleapis/release-please-action@v4
36+
id: release
37+
with:
38+
config-file: .release-please-config.json
39+
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 }}
1543

44+
publish:
45+
name: Build & publish to PyPI
46+
needs: [release-please]
47+
if: needs.release-please.outputs.release_created
48+
runs-on: ubuntu-24.04
49+
timeout-minutes: 10
50+
environment:
51+
name: pypi
52+
url: https://pypi.org/project/xarray_plotly
53+
permissions:
54+
id-token: write
1655
steps:
1756
- uses: actions/checkout@v6
1857
with:
19-
ref: ${{ inputs.tag }}
58+
ref: ${{ needs.release-please.outputs.tag_name }}
59+
fetch-depth: 0
2060

21-
- name: Install uv
22-
uses: astral-sh/setup-uv@v7
61+
- uses: astral-sh/setup-uv@v7
62+
with:
63+
enable-cache: true
64+
65+
- uses: actions/setup-python@v6
66+
with:
67+
python-version: "3.12"
2368

24-
- name: Build package
69+
- name: Build
2570
run: uv build
2671

27-
- name: Publish to PyPI
28-
uses: pypa/gh-action-pypi-publish@release/v1
72+
- uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)