This repository was archived by the owner on Feb 26, 2025. It is now read-only.
Commit 08693d6 1 parent 6475657 commit 08693d6 Copy full SHA for 08693d6
File tree 1 file changed +35
-18
lines changed
1 file changed +35
-18
lines changed Original file line number Diff line number Diff line change 1
1
name : PyPI
2
2
3
3
on :
4
+ workflow_dispatch :
5
+ pull_request :
4
6
push :
5
- tags :
6
- - ' v[0-9]+.[0-9]+.[0-9]+'
7
+ branches :
8
+ - main
9
+ release :
10
+ types :
11
+ - published
7
12
8
13
jobs :
9
- build-n-publish :
10
- name : Build and publish on PyPI
14
+ build :
15
+ name : Build distribution
16
+ runs-on : ubuntu-latest
17
+
18
+ steps :
19
+ - uses : actions/checkout@v4
20
+ - name : Build a binary wheel and a source tarball
21
+ run : pipx run build
22
+ - name : Check metadata
23
+ run : pipx run twine check dist/*
24
+ - name : Store the distribution packages
25
+ uses : actions/upload-artifact@v4
26
+ with :
27
+ name : python-package-distributions
28
+ path : dist/
29
+
30
+ publish-to-pypi :
31
+ name : Publish Python distribution to PyPI
32
+ if : github.event_name == 'release' && github.event.action == 'published'
33
+ needs :
34
+ - build
11
35
runs-on : ubuntu-latest
12
36
environment :
13
37
name : pypi
14
38
url : https://pypi.org/p/obp-accounting-sdk
15
39
permissions :
16
- id-token : write
40
+ id-token : write # IMPORTANT: mandatory for trusted publishing
41
+
17
42
steps :
18
- - name : Checkout code
19
- uses : actions/checkout@v4
20
- - name : Set up Python
21
- uses : actions/setup-python@v5
43
+ - name : Download all the dists
44
+ uses : actions/download-artifact@v4
22
45
with :
23
- python-version : 3.12
24
- - name : Install dependencies
25
- run : |
26
- python -m pip install --upgrade pip setuptools wheel
27
- python -m pip install build
28
- - name : Build distribution packages
29
- run : |
30
- python -m build
31
- - name : Publish distribution packages to PyPI
46
+ name : python-package-distributions
47
+ path : dist/
48
+ - name : Publish distribution to PyPI
32
49
uses : pypa/gh-action-pypi-publish@release/v1
You can’t perform that action at this time.
0 commit comments