Skip to content

Commit 05504fe

Browse files
Working through release / publish bugs.
1 parent 97c72b0 commit 05504fe

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

.github/workflows/publish.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ on:
44
release:
55
types:
66
- published
7+
workflow_dispatch:
8+
inputs:
9+
tag:
10+
description: Release tag to publish
11+
required: true
12+
type: string
713

814
permissions:
915
contents: read
@@ -14,8 +20,19 @@ jobs:
1420
runs-on: ubuntu-latest
1521

1622
steps:
23+
- name: Resolve release ref
24+
id: release_ref
25+
run: |
26+
if [ "${{ github.event_name }}" = "release" ]; then
27+
echo "ref=refs/tags/${{ github.event.release.tag_name }}" >> "$GITHUB_OUTPUT"
28+
else
29+
echo "ref=refs/tags/${{ inputs.tag }}" >> "$GITHUB_OUTPUT"
30+
fi
31+
1732
- name: Check out repository
1833
uses: actions/checkout@v4
34+
with:
35+
ref: ${{ steps.release_ref.outputs.ref }}
1936

2037
- name: Set up Python
2138
uses: actions/setup-python@v5

.github/workflows/release.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ on:
55

66
permissions:
77
contents: write
8+
actions: write
89

910
jobs:
1011
release:
@@ -68,3 +69,11 @@ jobs:
6869
--title "$TAG" \
6970
--generate-notes \
7071
--target "${{ github.sha }}"
72+
73+
- name: Dispatch publish workflow
74+
env:
75+
GH_TOKEN: ${{ github.token }}
76+
run: |
77+
gh workflow run "Publish to PyPI" \
78+
--ref main \
79+
-f tag="$TAG"

0 commit comments

Comments
 (0)