Skip to content

Commit 2c23bf6

Browse files
authored
Use PyPI Trusted Publishers (#2994)
1 parent af43a28 commit 2c23bf6

File tree

2 files changed

+25
-23
lines changed

2 files changed

+25
-23
lines changed

.github/workflows/check.yml

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
name: check
22
on:
33
push:
4+
tags-ignore: ["**"]
45
pull_request:
56
schedule:
67
- cron: "0 8 * * *"
@@ -79,26 +80,3 @@ jobs:
7980
run: tox r -e ${{ matrix.tox_env }}
8081
env:
8182
UPGRADE_ADVISORY: "yes"
82-
83-
publish:
84-
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
85-
needs: [check, test]
86-
runs-on: ubuntu-22.04
87-
steps:
88-
- name: Setup python to build package
89-
uses: actions/setup-python@v4
90-
with:
91-
python-version: "3.11"
92-
- name: Install build
93-
run: python -m pip install build
94-
- uses: actions/checkout@v3
95-
with:
96-
fetch-depth: 0
97-
- name: Build package
98-
run: pyproject-build -s -w . -o dist
99-
- name: Publish to PyPI
100-
uses: pypa/[email protected]
101-
with:
102-
skip_existing: true
103-
user: __token__
104-
password: ${{ secrets.pypi_password }}

.github/workflows/release.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Release to PyPI
2+
on:
3+
push:
4+
tags: ["*"]
5+
6+
jobs:
7+
release:
8+
runs-on: ubuntu-22.04
9+
permissions:
10+
id-token: write
11+
steps:
12+
- name: Setup python to build package
13+
uses: actions/setup-python@v4
14+
with:
15+
python-version: "3.11"
16+
- name: Install build
17+
run: python -m pip install build
18+
- uses: actions/checkout@v3
19+
with:
20+
fetch-depth: 0
21+
- name: Build package
22+
run: pyproject-build -s -w . -o dist
23+
- name: Publish to PyPI
24+
uses: pypa/[email protected]

0 commit comments

Comments
 (0)