Skip to content

Commit

Permalink
Set the package version from the tag name (#799)
Browse files Browse the repository at this point in the history
* Set the package version from the tag name

* Use sed instead
  • Loading branch information
ludeeus authored Feb 6, 2025
1 parent 75ff500 commit bc99f0a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
15 changes: 11 additions & 4 deletions .github/workflows/pythonpublish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,29 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Make sure tag_name is not empty
run: |
if [[ "${{ github.event.release.tag_name }}" == "" ]]; then
exit 1
fi
- uses: actions/checkout@v4.2.2

- name: Set up Python
uses: actions/setup-python@v5.4.0
with:
python-version: "3.x"

- name: Verify version
uses: home-assistant/actions/helpers/verify-version@master

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools build
- name: Build
- name: Set version ${{ github.event.release.tag_name }}
run: |
sed -i "s/^version = \".*\"/version = \"${{ github.event.release.tag_name }}\"/" pyproject.toml
- name: Build ${{ github.event.release.tag_name }}
run: |
python -m build
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ license = {text = "GPL v3"}
name = "hass-nabucasa"
readme = "README.md"
requires-python = ">=3.13"
version = "0.89.0"
version = "0.0.0"

[project.optional-dependencies]
test = [
Expand Down

0 comments on commit bc99f0a

Please sign in to comment.