Skip to content

Commit

Permalink
Merge pull request #465 from BlueBrain/release
Browse files Browse the repository at this point in the history
tag and release at each push to master
  • Loading branch information
AurelienJaquier authored Jul 11, 2023
2 parents 0f7420b + bf3c6ee commit dfd2029
Showing 1 changed file with 31 additions and 8 deletions.
39 changes: 31 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,48 @@ jobs:
call-test-workflow:
uses: BlueBrain/BluePyOpt/.github/workflows/test.yml@master

build-n-publish:
name: Build and publish on PyPI
build-tag-n-publish:
name: Build, tag and publish on PyPI
runs-on: ubuntu-latest
needs: call-test-workflow
permissions:
contents: write
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/checkout@v3

- name: Set up Python 3.8
uses: actions/setup-python@v2
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: 3.8
python-version: "3.10"

- name: Bump version and push tag
uses: anothrNick/[email protected]
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
id: tag
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
WITH_V: false
DEFAULT_BUMP: patch

- name: Build a source tarball and wheel
run: |
pip install wheel
python setup.py sdist bdist_wheel
- name: Get and store tag from 'Bump version and push tag' step
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
run: echo "TAG_NAME=${{ steps.tag.outputs.new_tag }}" >> $GITHUB_ENV
- name: Get and store tag from triggered tag push
if: ${{ startsWith(github.ref, 'refs/tags/') }}
run: echo "TAG_NAME=${{ github.ref_name }}" >> $GITHUB_ENV

- name: Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ env.TAG_NAME }}
name: ${{ env.TAG_NAME }}
generate_release_notes: true

- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
Expand Down

0 comments on commit dfd2029

Please sign in to comment.