Skip to content

Commit 68faad0

Browse files
committed
ci: Rearrange steps in PyPI publish job for clarity
1 parent ed7f3f9 commit 68faad0

File tree

1 file changed

+18
-7
lines changed

1 file changed

+18
-7
lines changed

.github/workflows/publish-and-deploy.yml

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,18 @@ on:
77
types:
88
- closed
99
workflow_dispatch:
10+
inputs:
11+
manual_publish:
12+
description: "Run publish and deploy manually"
13+
type: boolean
14+
default: false
15+
required: true
1016

1117
jobs:
1218
check-pr-title:
13-
if: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.merged == true }}
19+
if: |
20+
github.event_name == 'pull_request_target' &&
21+
github.event.pull_request.merged == true
1422
runs-on: ubuntu-latest
1523
outputs:
1624
is_chore_main_release: ${{ steps.check_title.outputs.is_chore_main_release }}
@@ -26,7 +34,9 @@ jobs:
2634
2735
pypi-publish:
2836
needs: check-pr-title
29-
if: ${{ needs.check-pr-title.outputs.is_chore_main_release == 'true' }}
37+
if: |
38+
(github.event_name == 'pull_request_target' && needs.check-pr-title.outputs.is_chore_main_release == 'true') ||
39+
(github.event_name == 'workflow_dispatch' && github.event.inputs.manual_publish == 'true')
3040
name: Upload release to PyPI
3141
runs-on: ubuntu-latest
3242
permissions:
@@ -41,14 +51,15 @@ jobs:
4151
python-version: "3.12"
4252
cache: true
4353
- name: Publish package distributions to PyPI
44-
id: publish
45-
run: |
46-
pdm publish
47-
echo "published=true" >> $GITHUB_OUTPUT
54+
run: pdm publish
55+
- name: Set output
56+
run: echo "published=true" >> $GITHUB_OUTPUT
4857

4958
deploy-docs:
5059
needs: pypi-publish
51-
if: ${{ needs.pypi-publish.outputs.published == 'true' }}
60+
if: |
61+
(github.event_name == 'pull_request_target' && needs.pypi-publish.outputs.published == 'true') ||
62+
(github.event_name == 'workflow_dispatch' && github.event.inputs.manual_publish == 'true')
5263
name: Deploy MkDocs
5364
runs-on: ubuntu-latest
5465
permissions:

0 commit comments

Comments
 (0)