Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(build): build runner ships a zip package instead of a tar.gz #39

Merged
merged 2 commits into from
Sep 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions .github/workflows/building.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
- name: Detect build version
run: echo "PKG_VERSION=$(hatch version)" >> "$GITHUB_ENV"

- name: Build the package
- name: Build test package
run: hatch -v build -t sdist

- name: Log package content
Expand All @@ -46,9 +46,12 @@ jobs:
- name: Test if the package is built correctly
run: python -c "import custom_components.econnect_alarm"

- name: Build the release package
run: hatch -v build -t zipped-directory

- name: Upload release archive
uses: actions/upload-artifact@v3
with:
name: econnect-alarm-${{ env.PKG_VERSION }}.tar.gz
path: dist/econnect_alarm-${{ env.PKG_VERSION }}.tar.gz
name: econnect-alarm-${{ env.PKG_VERSION }}.zip
path: dist/econnect_alarm-${{ env.PKG_VERSION }}.zip
if-no-files-found: error
8 changes: 7 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
[build-system]
requires = ["hatchling"]
requires = [
"hatchling",
"hatch-zipped-directory",
]
build-backend = "hatchling.build"

[project]
Expand Down Expand Up @@ -76,3 +79,6 @@ asyncio_mode = "auto"

[tool.hatch.build.targets.sdist]
only-include = ["custom_components/econnect_alarm"]

[tool.hatch.build.targets.zipped-directory]
only-include = ["custom_components/econnect_alarm"]
Loading