Skip to content

Commit

Permalink
fix: build system uploads only HACS files to prevent downloading erro…
Browse files Browse the repository at this point in the history
…rs (#78)

#78
  • Loading branch information
palazzem authored Oct 13, 2023
2 parents 83770d5 + df1aa87 commit 1ce878a
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 38 deletions.
12 changes: 5 additions & 7 deletions .github/workflows/building.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ name: 'Building release package'
on:
workflow_dispatch:
push:
tags:
- 'v*'
branches:
- main
pull_request:

permissions:
contents: read
Expand All @@ -14,12 +15,12 @@ concurrency:
cancel-in-progress: true

jobs:
release:
build:
runs-on: ubuntu-latest

steps:
- name: Check out repository code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v4
Expand All @@ -37,9 +38,6 @@ jobs:
- name: Build test package
run: hatch -v build -t sdist

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

- name: Log package content
run: tar -tvf dist/econnect_metronet-$PKG_VERSION.tar.gz

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/hassfest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:

steps:
- name: Check out the repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Test hassfest
uses: home-assistant/actions/hassfest@master
2 changes: 1 addition & 1 deletion .github/workflows/linting.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:

steps:
- name: Check out repository code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v4
Expand Down
27 changes: 3 additions & 24 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,33 +10,14 @@ concurrency:
cancel-in-progress: true

jobs:
release_zip_file:
name: Publish integration zip file asset
release:
name: HACS release
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout the repository
uses: actions/[email protected]

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.11'

- name: Upgrade pip and install required tools
run: |
pip install --upgrade pip
pip install hatch
- name: Detect package version
run: echo "PKG_VERSION=$(hatch version)" >> "$GITHUB_ENV"

- name: Build release package (tar)
run: hatch -v build -t sdist

- name: Build release package (zip)
run: hatch -v build -t zipped-directory
uses: actions/checkout@v4

- name: Build release package (HACS)
run: |
Expand All @@ -47,6 +28,4 @@ jobs:
uses: softprops/[email protected]
with:
files: |
${{ github.workspace }}/dist/econnect_metronet-$PKG_VERSION.tar.gz
${{ github.workspace }}/dist/econnect_metronet-$PKG_VERSION.zip
${{ github.workspace }}/custom_components/econnect_metronet/hacs_econnect_metronet.zip
2 changes: 1 addition & 1 deletion .github/workflows/testing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:

steps:
- name: Check out repository code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v4
Expand Down
4 changes: 0 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
[build-system]
requires = [
"hatchling",
"hatch-zipped-directory",
]
build-backend = "hatchling.build"

Expand Down Expand Up @@ -82,6 +81,3 @@ asyncio_mode = "auto"

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

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

0 comments on commit 1ce878a

Please sign in to comment.