Skip to content

Commit 37d7687

Browse files
committed
Use trusted publisher
Signed-off-by: Bernát Gábor <[email protected]>
1 parent ded82e7 commit 37d7687

File tree

2 files changed

+28
-23
lines changed

2 files changed

+28
-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 * * *"
@@ -135,26 +136,3 @@ jobs:
135136
run: tox -vv --notest -e ${{ matrix.tox_env }}
136137
- name: Run test suite
137138
run: tox --skip-pkg-install -e ${{ matrix.tox_env }}
138-
139-
publish:
140-
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
141-
needs: [check, coverage]
142-
runs-on: ubuntu-latest
143-
steps:
144-
- name: Setup python to build package
145-
uses: actions/setup-python@v4
146-
with:
147-
python-version: "3.11"
148-
- name: Install build
149-
run: python -m pip install build
150-
- uses: actions/checkout@v3
151-
with:
152-
fetch-depth: 0
153-
- name: Build sdist and wheel
154-
run: python -m build -s -w . -o dist
155-
- name: Publish to PyPi
156-
uses: pypa/[email protected]
157-
with:
158-
skip_existing: true
159-
user: __token__
160-
password: ${{ secrets.pypi_password }}

.github/workflows/release.yml

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

0 commit comments

Comments
 (0)