Skip to content

Commit 3e5980b

Browse files
committed
Configure trusted publishing pipeline
1 parent 57f1d64 commit 3e5980b

2 files changed

Lines changed: 50 additions & 32 deletions

File tree

.github/workflows/python-publish.yml

Lines changed: 0 additions & 32 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# This workflow will publish a python package on pypi, when a release is created
2+
3+
name: release
4+
5+
on:
6+
release:
7+
types: [published]
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
publish:
14+
runs-on: ubuntu-latest
15+
16+
permissions:
17+
# This permission is required for trusted publishing.
18+
id-token: write
19+
contents: read
20+
21+
steps:
22+
- uses: actions/checkout@v3
23+
- name: Set up Python 3.12
24+
uses: actions/setup-python@v4
25+
with:
26+
python-version: "3.12"
27+
- name: Install dependencies
28+
run: |
29+
python -m pip install --upgrade pip
30+
python -m pip install poetry poetry-dynamic-versioning
31+
32+
- name: Setup TESTPYPI repo
33+
run: |
34+
poetry config repositories.testpypi https://test.pypi.org/legacy/
35+
36+
- name: Build package
37+
run: |
38+
poetry build
39+
40+
- name: Mint token
41+
id: mint
42+
uses: tschm/token-mint-action@v1.0.2
43+
44+
- name: Publish the package to Testpypi
45+
run: |
46+
poetry publish -r testpypi -u __token__ -p '${{ steps.mint.outputs.api-token }}'
47+
48+
# - name: Publish the package
49+
# run: |
50+
# poetry publish -u __token__ -p '${{ steps.mint.outputs.api-token }}'

0 commit comments

Comments
 (0)