1- name : CI
1+ name : CI/CD
22
33on :
44 push :
@@ -130,7 +130,7 @@ jobs:
130130 # TAG NEW VERSION
131131 # ###########################################################################
132132
133- tag-new-version :
133+ tag-and-release :
134134 # only run on main/master/default
135135 if : format('refs/heads/{0}', github.event.repository.default_branch) == github.ref
136136 needs : [
@@ -146,9 +146,12 @@ jobs:
146146 - uses : actions/checkout@v4
147147 with :
148148 fetch-depth : 0 # required to see tags and commits
149- token : ${{ secrets.PERSONAL_ACCESS_TOKEN }} # so a 'git push' can trigger workflows
150149 ref : ${{ github.sha }} # lock to triggered commit ('github.ref' is dynamic)
151150
151+ - uses : actions/setup-python@v5 # needed for building project
152+ with :
153+ python-version : " ${{ fromJSON(needs.py-versions.outputs.matrix)[0] }}"
154+
152155 -
uses :
WIPACrepo/[email protected] 153156 id : next-version
154157 with :
@@ -159,10 +162,27 @@ jobs:
159162 dependencies-logs/**
160163 resources/foo/**
161164
162- - name : Tag New Version
163- if : steps.next-version.outputs.version != ''
165+ - if : steps.next-version.outputs.version != ''
166+ name : Tag New Version
164167 run : |
165168 set -euo pipefail
166169 echo "now: $(date -u +"%Y-%m-%dT%H:%M:%S.%3N")"
167170 git tag v${{ steps.next-version.outputs.version }} # note: prepend 'v'
168171 git push origin --tags
172+
173+ - if : steps.next-version.outputs.version != ''
174+ uses :
WIPACrepo/[email protected] # creates dist/ 175+
176+ - if : steps.next-version.outputs.version != ''
177+ uses : softprops/action-gh-release@v2
178+ with :
179+ files : dist/*
180+ generate_release_notes : true
181+ env :
182+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
183+
184+ - if : steps.next-version.outputs.version != ''
185+ uses : pypa/gh-action-pypi-publish@release/v1
186+ with :
187+ user : __token__
188+ password : ${{ secrets.PYPI_TOKEN }}
0 commit comments