Skip to content

Commit 2b602a5

Browse files
authored
1 parent 9284981 commit 2b602a5

File tree

1 file changed

+58
-5
lines changed

1 file changed

+58
-5
lines changed

.github/workflows/deploy.yaml

Lines changed: 58 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,66 @@ on:
1111
pull_request:
1212

1313
jobs:
14-
deploy:
14+
build:
1515
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout source
18+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
19+
20+
- name: Set up Python
21+
uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5
22+
with:
23+
python-version: "3.13"
24+
cache: pip
25+
cache-dependency-path: pyproject.toml
26+
27+
- name: Install dependencies
28+
shell: bash
29+
run: python -m pip install build
30+
31+
- name: Build distributions
32+
shell: bash
33+
run: python -m build
34+
35+
- name: Upload distribution
36+
# yamllint disable-line rule:line-length
37+
uses: hynek/build-and-inspect-python-package@b5076c307dc91924a82ad150cdd1533b444d3310 # v2
38+
39+
deploy-test-pypi:
40+
if: startsWith(github.ref, 'refs/tags/')
41+
needs: build
1642
permissions:
1743
id-token: write
44+
runs-on: ubuntu-latest
1845
steps:
19-
# yamllint disable-line rule:line-length
20-
- uses: paddyroddy/.github/actions/python/deployment@b9cde8bcbbce838802ecd0aba2c3a7f8b82f519c # v0
46+
- name: Download distributions
47+
# yamllint disable-line rule:line-length
48+
uses: actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e # v4
2149
with:
22-
pyproject-toml: ./pyproject.toml
23-
python-version: "3.13"
50+
name: Packages
51+
path: dist
52+
53+
- name: Publish package to TestPyPI
54+
uses: pypa/gh-action-pypi-publish@release/v1
55+
with:
56+
repository-url: https://test.pypi.org/legacy/
57+
verbose: true
58+
59+
deploy-pypi:
60+
if: startsWith(github.ref, 'refs/tags/')
61+
needs: build
62+
permissions:
63+
id-token: write
64+
runs-on: ubuntu-latest
65+
steps:
66+
- name: Download distributions
67+
# yamllint disable-line rule:line-length
68+
uses: actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e # v4
69+
with:
70+
name: Packages
71+
path: dist
72+
73+
- name: Publish package to PyPI
74+
uses: pypa/gh-action-pypi-publish@release/v1
75+
with:
76+
verbose: true

0 commit comments

Comments
 (0)