-
Notifications
You must be signed in to change notification settings - Fork 62
56 lines (53 loc) · 1.68 KB
/
publish_on_pypi.yml
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
51
52
53
54
55
56
name: Publish on PyPI
run-name: Publish on PyPI - ${{ github.sha }}
on:
release:
types: [published]
jobs:
publish_on_pypi:
name: Publish on PyPI
if: github.event.release.prerelease == false
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/project/dmri-amico
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
github-token: ${{ secrets.GH_PAT }}
run-id: ${{ secrets.WHEELS_ARTIFACTS_RUN_ID }}
path: dist
merge-multiple: true
- name: Publish on PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
skip-existing: true
verbose: true
print-hash: true
publish_on_pypi_test:
name: Publish on PyPI Test
if: github.event.release.prerelease == true && contains(github.event.release.tag_name, 'rc')
runs-on: ubuntu-latest
environment:
name: testpypi
url: https://test.pypi.org/project/dmri-amico
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
github-token: ${{ secrets.GH_PAT }}
run-id: ${{ secrets.WHEELS_ARTIFACTS_RUN_ID }}
path: dist
merge-multiple: true
- name: Publish on PyPI Test
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
skip-existing: true
verbose: true
print-hash: true