@@ -3,47 +3,93 @@ name: release
33on :
44  release :
55    types : [published] 
6+   workflow_dispatch :
67
78jobs :
8-   pypi :
9-     name :  Publish to PyPI registry 
9+   build :
10+     runs-on :  ubuntu-latest 
1011    environment : release 
11-     runs-on : ubuntu-20.04 
12- 
1312    env :
1413      FORCE_COLOR : 1 
1514      PY_COLORS : 1 
16-       TOXENV : packaging 
17-       TOX_PARALLEL_NO_SPINNER : 1 
15+       TOXENV : pkg 
16+ 
17+     steps :
18+       - name : Switch to using Python 3.10 by default 
19+         uses : actions/setup-python@v5 
20+         with :
21+           python-version : " 3.10" 
22+ 
23+       - name : Install system dependencies 
24+         run : | 
25+             sudo apt remove -y docker-compose 
26+             sudo apt-get update -y 
27+             sudo apt-get --assume-yes --no-install-recommends install -y apt-transport-https curl libkrb5-dev 
28+ 
29+        - name : Install tox 
30+         run : python3 -m pip install --user "tox>=4.0.0" 
31+ 
32+       - name : Check out src from Git 
33+         uses : actions/checkout@v4 
34+         with :
35+           fetch-depth : 0   #  needed by setuptools-scm
36+           submodules : true 
37+ 
38+       - name : Build dists 
39+         run : python3 -m tox 
1840
41+       - name : Upload artifact 
42+         uses : actions/upload-artifact@v4 
43+         with :
44+           name : package 
45+           path : dist/ 
46+           retention-days : 7 
47+           if-no-files-found : error 
48+ 
49+   pypi :
50+     needs : [build] 
51+     runs-on : ubuntu-latest 
52+     permissions :
53+       id-token : write 
54+     environment :
55+       name : pypi-publishing 
56+       url : https://pypi.org/project/jira/ 
57+     steps :
58+       - name : Download artifact 
59+         uses : actions/download-artifact@v4 
60+         with :
61+           name : package 
62+           path : dist 
63+ 
64+       - name : Show tree 
65+         run : tree 
66+ 
67+       - name : Publish to pypi.org 
68+         if : >-  #  "create" workflows run separately from "push" & "pull_request" 
69+           github.event_name == 'release' 
70+          uses : pypa/gh-action-pypi-publish@release/v1 
71+         with :
72+           password : ${{ secrets.PYPI_API_TOKEN }} 
73+ 
74+   asset :
75+     needs : [build] 
76+     runs-on : ubuntu-latest 
77+     permissions :
78+       contents : write 
1979    steps :
20-     - name : Switch to using Python 3.9 by default 
21-       uses : actions/setup-python@v5 
22-       with :
23-         python-version : 3.9 
24- 
25-     - name : Install build dependencies 
26-       run : python3 -m pip install --user tox 
27- 
28-     - name : Check out src from Git 
29-       uses : actions/checkout@v4 
30-       with :
31-         fetch-depth : 0   #  needed by setuptools-scm
32- 
33-     - name : Build dists 
34-       run : python -m tox 
35- 
36-     - name : Publish to test.pypi.org 
37-       if : >-  #  "create" workflows run separately from "push" & "pull_request" 
38-         github.event_name == 'release' 
39-        uses : pypa/gh-action-pypi-publish@v1 
40-       with :
41-         password : ${{ secrets.testpypi_password }} 
42-         repository_url : https://test.pypi.org/legacy/ 
43- 
44-     - name : Publish to pypi.org 
45-       if : >-  #  "create" workflows run separately from "push" & "pull_request" 
46-         github.event_name == 'release' 
47-        uses : pypa/gh-action-pypi-publish@v1 
48-       with :
49-         password : ${{ secrets.pypi_password }} 
80+       - name : Download artifact 
81+         uses : actions/download-artifact@v4 
82+         with :
83+           name : package 
84+           path : dist 
85+ 
86+       - name : Show tree 
87+         run : tree 
88+ 
89+       - name : Add release asset 
90+         uses : softprops/action-gh-release@c95fe1489396fe8a9eb87c0abf8aa5b2ef267fda 
91+         with :
92+           tag_name : ${{ github.event.release.tag_name }} 
93+           fail_on_unmatched_files : true 
94+           files : | 
95+             dist/* 
0 commit comments