Skip to content

Commit 78b4b42

Browse files
authored
ci: use trusted publisher deployment (#26)
Moving to trusted pub. Signed-off-by: Henry Schreiner <[email protected]>
1 parent efb36a6 commit 78b4b42

File tree

2 files changed

+38
-24
lines changed

2 files changed

+38
-24
lines changed

.github/workflows/cd.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: CD
2+
3+
on:
4+
workflow_dispatch:
5+
release:
6+
types:
7+
- published
8+
9+
jobs:
10+
dist:
11+
name: Distribution build
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 0
18+
19+
- uses: hynek/build-and-inspect-python-package@v1
20+
21+
publish:
22+
name: Publish
23+
needs: [dist]
24+
environment: pypi
25+
permissions:
26+
id-token: write
27+
runs-on: ubuntu-latest
28+
if: github.event_name == 'release' && github.event.action == 'published'
29+
steps:
30+
- uses: actions/download-artifact@v3
31+
with:
32+
name: Packages
33+
path: dist
34+
35+
- uses: pypa/gh-action-pypi-publish@release/v1

.github/workflows/ci.yml

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,11 @@ concurrency:
1515
cancel-in-progress: true
1616

1717
jobs:
18-
pre-commit:
19-
name: Format
18+
pylint:
19+
name: PyLint
2020
runs-on: ubuntu-latest
2121
steps:
2222
- uses: actions/checkout@v4
23-
- uses: actions/setup-python@v4
24-
with:
25-
python-version: "3.10"
26-
- uses: pre-commit/[email protected]
27-
with:
28-
extra_args: --hook-stage manual --all-files
2923
- name: Run PyLint
3024
run: |
3125
echo "::add-matcher::$GITHUB_WORKSPACE/.github/matchers/pylint.json"
@@ -34,7 +28,6 @@ jobs:
3428
checks:
3529
name: Check Python ${{ matrix.python-version }} on ${{ matrix.runs-on }}
3630
runs-on: ${{ matrix.runs-on }}
37-
needs: [pre-commit]
3831
strategy:
3932
fail-fast: false
4033
matrix:
@@ -61,24 +54,10 @@ jobs:
6154
dist:
6255
name: Distribution build
6356
runs-on: ubuntu-latest
64-
needs: [pre-commit]
6557

6658
steps:
6759
- uses: actions/checkout@v4
6860
with:
6961
fetch-depth: 0
7062

71-
- name: Build sdist and wheel
72-
run: pipx run build
73-
74-
- uses: actions/upload-artifact@v3
75-
with:
76-
path: dist
77-
78-
- name: Check products
79-
run: pipx run twine check dist/*
80-
81-
- uses: pypa/gh-action-pypi-publish@release/v1
82-
if: github.event_name == 'release' && github.event.action == 'published'
83-
with:
84-
password: ${{ secrets.pypi_password }}
63+
- uses: hynek/build-and-inspect-python-package@v1

0 commit comments

Comments
 (0)