Skip to content

Commit

Permalink
Fix release workflow (#2)
Browse files Browse the repository at this point in the history
* potential fix

* quotes
  • Loading branch information
brondum authored Apr 4, 2024
1 parent 5b1d467 commit a736984
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,15 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install build
- name: Set version
- name: install envsubts
run: |
VERSION=${GITHUB_REF#refs/tags/}
sed -i "s/version='0.0.0',/version='$VERSION',/" setup.py
if [ "$(id -u)" = 0 ]; then export SUDO=""; else # Check if we're root
export SUDO="sudo";
fi
command -v gettext >/dev/null 2>&1 || { $SUDO apt -qq update && $SUDO apt -qq install -y gettext; }
- name: substitute env vars
run: |
envsubst < setup.py > setup.py-tmp && mv setup.py-tmp setup.py
- name: Build package
run: python -m build
- name: Publish package
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
setup(
name = 'pytouchline_extended',
packages = ['pytouchline_extended'],
version = '0.0.0',
version = "$GITHUB_REF_NAME",
description = 'A Roth Touchline interface library',
long_description="A simple helper library for controlling a Roth Touchline heat pump controller",
author = 'Peter Brondum',
Expand Down

0 comments on commit a736984

Please sign in to comment.