Skip to content

Commit 861784f

Browse files
committed
Switch to manual workflow run
1 parent 1ebc7e5 commit 861784f

File tree

2 files changed

+26
-4
lines changed

2 files changed

+26
-4
lines changed

.github/workflows/publish.yml

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
name: Publish
22

33
on:
4-
release:
5-
types: [published]
4+
workflow_dispatch:
5+
inputs:
6+
ref:
7+
# require SHA as tags and branches are mutable
8+
description: Git commit SHA (not branch/tag)
9+
required: true
10+
type: string
611

712
env:
813
FORCE_COLOR: 1
@@ -12,8 +17,24 @@ jobs:
1217
runs-on: ubuntu-latest
1318

1419
steps:
20+
- name: Log inputs
21+
run: echo "${{ inputs }}"
22+
1523
- name: Checkout repository
1624
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
25+
with:
26+
ref: ${{ inputs.ref }}
27+
fetch-depth: 2 # shouldn't need much, if any, history
28+
29+
- name: Log Git tag
30+
run: git describe --always --tags
31+
32+
- name: Check ref is the commit SHA
33+
# require SHA as tags and branches are mutable
34+
run: test "${{ inputs.ref }}"
35+
= "$(git git log --max-count=1 --format=format:%h)"
36+
|| test "${{ inputs.ref }}"
37+
= "$(git git log --max-count=1 --format=format:%H)"
1738

1839
# pipx is pre-installed in 'ubuntu' VMs
1940

docs/development/release-process.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@ Release Process
1515

1616
#. Add a `release on GitHub <https://github.com/pypa/packaging/releases>`__.
1717

18-
This schedules a CI workflow which will build and publish the package to
19-
PyPI. Publishing will wait for any `required approvals`_.
18+
#. Run the 'Publish' manual GitHub workflow, specifying the Git tag's commit
19+
SHA. This will build and publish the package to PyPI. Publishing will wait
20+
for any `required approvals`_.
2021

2122
#. Notify the other project owners of the release.
2223

0 commit comments

Comments
 (0)