@@ -11,25 +11,48 @@ jobs:
1111 call-test-workflow :
1212 uses : BlueBrain/BluePyOpt/.github/workflows/test.yml@master
1313
14- build-n-publish :
15- name : Build and publish on PyPI
14+ build-tag- n-publish :
15+ name : Build, tag and publish on PyPI
1616 runs-on : ubuntu-latest
1717 needs : call-test-workflow
18+ permissions :
19+ contents : write
1820 steps :
19- - uses : actions/checkout@v2
20- with :
21- fetch-depth : 0
21+ - uses : actions/checkout@v3
2222
23- - name : Set up Python 3.8
24- uses : actions/setup-python@v2
23+ - name : Set up Python 3.10
24+ uses : actions/setup-python@v4
2525 with :
26- python-version : 3.8
26+ python-version : " 3.10"
27+
28+ - name : Bump version and push tag
29+ uses :
anothrNick/[email protected] 30+ if : ${{ !startsWith(github.ref, 'refs/tags/') }}
31+ id : tag
32+ env :
33+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
34+ WITH_V : false
35+ DEFAULT_BUMP : patch
2736
2837 - name : Build a source tarball and wheel
2938 run : |
3039 pip install wheel
3140 python setup.py sdist bdist_wheel
3241
42+ - name : Get and store tag from 'Bump version and push tag' step
43+ if : ${{ !startsWith(github.ref, 'refs/tags/') }}
44+ run : echo "TAG_NAME=${{ steps.tag.outputs.new_tag }}" >> $GITHUB_ENV
45+ - name : Get and store tag from triggered tag push
46+ if : ${{ startsWith(github.ref, 'refs/tags/') }}
47+ run : echo "TAG_NAME=${{ github.ref_name }}" >> $GITHUB_ENV
48+
49+ - name : Release
50+ uses : softprops/action-gh-release@v1
51+ with :
52+ tag_name : ${{ env.TAG_NAME }}
53+ name : ${{ env.TAG_NAME }}
54+ generate_release_notes : true
55+
3356 - name : Publish package to PyPI
3457 uses : pypa/gh-action-pypi-publish@release/v1
3558 with :
0 commit comments