Skip to content
This repository was archived by the owner on Feb 26, 2025. It is now read-only.

Commit dfd2029

Browse files
Merge pull request #465 from BlueBrain/release
tag and release at each push to master
2 parents 0f7420b + bf3c6ee commit dfd2029

File tree

1 file changed

+31
-8
lines changed

1 file changed

+31
-8
lines changed

.github/workflows/build.yml

Lines changed: 31 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)