11name : Build
22
33on :
4+ workflow_dispatch :
5+ inputs :
6+ publish_artifacts :
7+ description : ' Publish artifacts (Y|N)'
8+ required : true
9+ default : ' N'
410 release :
511 types : [published]
612 push :
4046 if : matrix.python-version == '3.10'
4147
4248 - name : Publish CSS files
43- uses : actions/upload-artifact@master
49+ uses : actions/upload-artifact@v4
4450 with :
45- name : dist -package-css
51+ name : arts -package-css
4652 path : styles/dist
4753 if : matrix.python-version == '3.10'
4854
@@ -104,21 +110,22 @@ jobs:
104110 if : matrix.python-version == '3.11'
105111
106112 - name : Upload distribution package
107- uses : actions/upload-artifact@master
113+ uses : actions/upload-artifact@v4
108114 with :
109- name : dist
115+ name : dist-${{ matrix.os }}-${{ matrix.python-version }}
110116 path : dist
111117 if : matrix.python-version == '3.11'
112118
113119 publish :
114120 runs-on : ubuntu-latest
115121 needs : build
116- if : github.event_name == 'release'
122+ if : github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && github.event.inputs.publish_artifacts == 'Y')
117123 steps :
118124 - name : Download the distribution package
119- uses : actions/download-artifact@v2
125+ uses : actions/download-artifact@v4
120126 with :
121- name : dist
127+ pattern : dist-*
128+ merge-multiple : true
122129 path : dist
123130
124131 - name : Use Python 3.11
@@ -145,18 +152,20 @@ jobs:
145152 TWINE_PASSWORD : ${{ secrets.pypi_password }}
146153
147154 - name : Download CSS pack
148- uses : actions/download-artifact@v2
155+ uses : actions/download-artifact@v4
156+ if : github.event_name == 'release'
149157 with :
150- name : dist -package-css
151- path : dist -css
158+ name : arts -package-css
159+ path : arts -css
152160
153161 - name : Add CSS package to the release
154162163+ if : github.event_name == 'release'
155164 env :
156165 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
157166 with :
158167 upload_url : ${{ github.event.release.upload_url }}
159- asset_path : ./dist -css/neoteroi-mkdocs.css
168+ asset_path : ./arts -css/neoteroi-mkdocs.css
160169 asset_name : css-${{ github.event.release.tag_name }}.css
161170 asset_content_type : text/css
162171 continue-on-error : true
0 commit comments