-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (37 loc) · 1.12 KB
/
test-publish-pypi.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
name: Test publish
on: push
permissions:
contents: read
jobs:
deploy:
runs-on: ubuntu-latest
environment:
name: test-pypi
url: https://test.pypi.org/project/asyncio-multilock
permissions:
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install dependencies
run: |
python -m pip install --upgrade pip toml
pip install build
- name: Add build number to package version
shell: python
run: |
import toml
with open("pyproject.toml", "r") as f:
data = toml.load(f)
data["project"]["version"] = f'{data["project"]["version"]}.dev${{ github.run_id }}'
with open("pyproject.toml", "w") as f:
toml.dump(data, f)
- name: Build package
run: python -m build
- name: Publish package
uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
repository-url: https://test.pypi.org/legacy/
skip-existing: true