Skip to content

Commit a866dc0

Browse files
committed
CI: Add workflow dispatch triggers
1 parent 0c635fd commit a866dc0

File tree

2 files changed

+51
-28
lines changed

2 files changed

+51
-28
lines changed

.github/workflows/pypi.yml

+50-28
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,55 @@
11
name: Publish
22

33
on:
4-
release:
5-
types: [published, edited]
4+
release:
5+
types: [published]
6+
workflow_dispatch:
67

78
jobs:
8-
publish:
9-
runs-on: ubuntu-latest
10-
steps:
11-
- uses: actions/checkout@v3
12-
13-
- name: Set up Python
14-
uses: actions/setup-python@v4
15-
with:
16-
python-version: "3.x"
17-
18-
- name: Python info
19-
run: |
20-
which python
21-
python --version
22-
23-
- name: Install dependencies
24-
run: pip build
25-
26-
- name: Build the package
27-
run: python -m build --sdist --wheel
28-
29-
- name: Publish the package
30-
uses: pypa/gh-action-pypi-publish@release/v1
31-
with:
32-
user: __token__
33-
password: ${{ secrets.PYPI_TOKEN }}
9+
publish:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v3
13+
14+
- name: Set up Python
15+
uses: actions/setup-python@v4
16+
with:
17+
python-version: '3.x'
18+
19+
- name: Install dependencies
20+
run: pip install build twine
21+
22+
- name: Python info
23+
run: |
24+
which python
25+
python --version
26+
27+
- name: Installed packages
28+
run: pip list
29+
30+
- name: Build the package
31+
run: python -m build --sdist --wheel
32+
33+
- name: Validate wheels
34+
run: |
35+
tree dist
36+
twine check dist/*
37+
38+
- uses: actions/upload-artifact@v3
39+
with:
40+
name: wheels
41+
path: ./build/*
42+
43+
- name: Publish the package
44+
if: github.event_name == 'release'
45+
uses: pypa/gh-action-pypi-publish@release/v1
46+
with:
47+
user: __token__
48+
password: ${{ secrets.PYPI_TOKEN }}
49+
50+
- name: Attach wheels to GitHub release
51+
if: github.event_name == 'release'
52+
uses: AButler/[email protected]
53+
with:
54+
files: 'dist/*'
55+
repo-token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/pythonpackage.yml

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ on:
88
branches:
99
- master
1010
pull_request:
11+
workflow_dispatch:
1112

1213
concurrency:
1314
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}

0 commit comments

Comments
 (0)