Skip to content

Commit 34052fd

Browse files
Update release.yaml
1 parent c37a030 commit 34052fd

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
lines changed

.github/workflows/release.yaml

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
11
name: Release
22

33
on:
4-
release:
5-
types: [published]
6-
7-
# Use "trusted publishing", see https://docs.pypi.org/trusted-publishers/
8-
jobs:
9-
release:
10-
name: Upload release to PyPI
4+
deploy:
5+
# this will run when you have tagged a commit, starting with "v*"
6+
# and requires that you have put your twine API key in your
7+
# github secrets (see readme for details)
8+
needs: [test]
119
runs-on: ubuntu-latest
12-
environment:
13-
name: pypi
14-
url: https://pypi.org/p/{{ cookiecutter.package_name }}
15-
permissions:
16-
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
10+
if: contains(github.ref, 'tags')
1711
steps:
18-
- uses: actions/checkout@v4
19-
with:
20-
filter: blob:none
21-
fetch-depth: 0
22-
- uses: actions/setup-python@v4
12+
- name: Checkout code
13+
uses: actions/checkout@v3
14+
15+
- name: Set up Python 3.10
16+
uses: actions/setup-python@v4
2317
with:
24-
python-version: "3.x"
25-
cache: "pip"
26-
- run: pip install build
27-
- run: python -m build
28-
- name: Publish package distributions to PyPI
18+
python-version: "3.10"
19+
20+
- name: Install hatch
21+
run: pip install hatch
22+
23+
- name: Build project for distribution
24+
run: hatch build
25+
26+
- name: Publish a Python distribution to PyPI
2927
uses: pypa/gh-action-pypi-publish@release/v1
28+
with:
29+
password: ${{ secrets.PYPI_API_TOKEN }}

0 commit comments

Comments
 (0)