Skip to content

Commit be95b9c

Browse files
committed
Only publish on release
1 parent 0239c6a commit be95b9c

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

.github/workflows/release.yml

+1
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ jobs:
4545
4646
- name: Publish a Python distribution to PyPI
4747
uses: pypa/gh-action-pypi-publish@release/v1
48+
if: startsWith(github.ref, 'refs/tags/')
4849
with:
4950
password: ${{ secrets.PYPI_API_TOKEN }}
5051

update_version.sh

+9
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
#!/bin/bash
22
number="${1:-"minor"}"
33
echo Updating $number
4+
5+
git fetch
6+
git merge-base --is-ancestor origin/HEAD HEAD
7+
if [ $? -ne 0 ]; then
8+
echo "local branch is not up to date with origin";
9+
exit 1
10+
fi
11+
412
if [ -n "$(git status --porcelain)" ]; then
513
echo "there are changes not committed";
614
exit 1
@@ -10,3 +18,4 @@ python -m hatch version $number
1018
v=$(python -m hatch version)
1119
git commit llama_api_server/__about__.py -m "Bump version to $v"
1220
git tag v$v
21+
git push origin HEAD --tags

0 commit comments

Comments
 (0)