Skip to content

Commit 66220f5

Browse files
committed
Move release into new workflow
1 parent 0c98662 commit 66220f5

File tree

2 files changed

+39
-31
lines changed

2 files changed

+39
-31
lines changed

.github/workflows/python-package.yml

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -39,34 +39,3 @@ jobs:
3939
- name: Test with pytest
4040
run: |
4141
pytest
42-
43-
44-
# This workflow will upload a Python Package using Twine when a release is created
45-
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries
46-
47-
# This workflow uses actions that are not certified by GitHub.
48-
# They are provided by a third-party and are governed by
49-
# separate terms of service, privacy policy, and support
50-
# documentation.
51-
52-
deploy:
53-
54-
runs-on: ubuntu-latest
55-
56-
steps:
57-
- uses: actions/checkout@v3
58-
- name: Set up Python
59-
uses: actions/setup-python@v3
60-
with:
61-
python-version: '3.x'
62-
- name: Install dependencies
63-
run: |
64-
python -m pip install --upgrade pip
65-
pip install build
66-
- name: Build package
67-
run: python -m build
68-
- name: Publish package
69-
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
70-
with:
71-
user: __token__
72-
password: ${{ secrets.PYPI_API_TOKEN }}

.github/workflows/release.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# This workflow will upload a Python Package using Twine when a release is created
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries
3+
4+
# This workflow uses actions that are not certified by GitHub.
5+
# They are provided by a third-party and are governed by
6+
# separate terms of service, privacy policy, and support
7+
# documentation.
8+
9+
name: Upload Python Package
10+
11+
on:
12+
release:
13+
types: [published]
14+
15+
permissions:
16+
contents: read
17+
18+
jobs:
19+
deploy:
20+
21+
runs-on: ubuntu-latest
22+
23+
steps:
24+
- uses: actions/checkout@v3
25+
- name: Set up Python
26+
uses: actions/setup-python@v3
27+
with:
28+
python-version: '3.x'
29+
- name: Install dependencies
30+
run: |
31+
python -m pip install --upgrade pip
32+
pip install build
33+
- name: Build package
34+
run: python -m build
35+
- name: Publish package
36+
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
37+
with:
38+
user: __token__
39+
password: ${{ secrets.PYPI_API_TOKEN }}

0 commit comments

Comments
 (0)