File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11name : Publish
22
33on :
4- release :
5- types : [published]
4+ workflow_run :
5+ workflows : ["Release Please"]
6+ types : [completed]
7+ workflow_dispatch :
8+ inputs :
9+ tag :
10+ description : " Release tag to publish (e.g. pg-partsmith-v0.1.0)"
11+ required : true
612
713permissions :
14+ contents : read
815 id-token : write # Trusted Publisher (PyPI OIDC)
916
1017jobs :
18+ check :
19+ name : Check release tag
20+ if : >
21+ github.event_name == 'workflow_dispatch' ||
22+ (github.event.workflow_run.conclusion == 'success' &&
23+ github.event.workflow_run.head_branch == 'master')
24+ runs-on : ubuntu-latest
25+ outputs :
26+ tag : ${{ steps.tag.outputs.tag }}
27+ steps :
28+ - uses : actions/checkout@v6
29+ with :
30+ ref : ${{ github.event_name == 'workflow_dispatch' && inputs.tag || github.event.workflow_run.head_sha }}
31+ fetch-tags : true
32+
33+ - name : Resolve tag
34+ id : tag
35+ run : |
36+ if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
37+ echo "tag=${{ inputs.tag }}" >> "$GITHUB_OUTPUT"
38+ else
39+ TAG=$(git tag --points-at HEAD | grep -E '^pg-partsmith-v' | head -1)
40+ echo "tag=$TAG" >> "$GITHUB_OUTPUT"
41+ if [ -z "$TAG" ]; then
42+ echo "No release tag on this commit — skipping publish."
43+ else
44+ echo "Will publish $TAG"
45+ fi
46+ fi
47+
1148 publish :
1249 name : Build and publish to PyPI
50+ needs : check
51+ if : needs.check.outputs.tag != ''
1352 runs-on : ubuntu-latest
1453 environment : pypi
1554 steps :
1655 - uses : actions/checkout@v6
56+ with :
57+ ref : ${{ needs.check.outputs.tag }}
58+
1759 - uses : astral-sh/setup-uv@v7
1860 - run : uv build
1961 - run : uv publish
Original file line number Diff line number Diff line change @@ -128,3 +128,6 @@ dmypy.json
128128
129129# Pyre type checker
130130.pyre /
131+
132+ # Claude Code worktrees
133+ .claude /worktrees /
Original file line number Diff line number Diff line change 88 "extra-files" : [
99 {
1010 "type" : " generic" ,
11- "path" : " pg_partsmith/__version__.py"
11+ "path" : " pg_partsmith/__version__.py" ,
12+ "search" : " __version__ = \" $1\" "
1213 }
1314 ]
1415 }
You can’t perform that action at this time.
0 commit comments