Skip to content

Commit 44f547c

Browse files
committed
Update release publishing workflow
1 parent b15ae52 commit 44f547c

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

.github/workflows/publish_release.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,25 +45,25 @@ jobs:
4545
VERSION=${BRANCH_NAME#hotfix/}
4646
echo "RELEASE_VERSION=$VERSION" >> $GITHUB_ENV
4747
48-
- name: Set tag for setuptools-scm
49-
if: github.event_name == 'push' && !startsWith(github.ref, 'refs/tags/')
50-
run: git tag v${RELEASE_VERSION} main
51-
5248
- name: Build wheel
5349
run: |
50+
if ! git rev-parse v${RELEASE_VERSION} > /dev/null 2>&1; then
51+
_added_tag=1
52+
git tag v${RELEASE_VERSION} main
53+
fi
54+
5455
python -m pip install build wheel
5556
python -m build --wheel --sdist
5657
58+
if [ ${_added_tag:-0} -eq 1 ]; then
59+
git tag -d v${RELEASE_VERSION}
60+
fi
61+
5762
- name: Check metadata
5863
run: |
5964
python3 -m pip install twine --prefer-binary
6065
python3 -m twine check dist/*
6166
62-
- name: Delete local tag used by setuptools-scm
63-
if: github.event_name == 'push' && !startsWith(github.ref, 'refs/tags/')
64-
run: git -d tag v${RELEASE_VERSION}
65-
66-
6767
# Code below inspired from this action:
6868
# - uses: taiki-e/create-gh-release-action@v1
6969
# with:

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### Updated
11+
12+
- Update GitHub release publishing workflow
13+
1014
## [1.4.1] - 2022-05-04
1115

1216
### Fixed

0 commit comments

Comments
 (0)