From bc849c117589df5e71e3a3f9a87c003f07d0393a Mon Sep 17 00:00:00 2001 From: Emanuele Palazzetti Date: Fri, 13 Oct 2023 12:19:10 +0000 Subject: [PATCH 1/4] tools!(ci): publish workflow releases only HACS package --- .github/workflows/publish.yaml | 25 ++----------------------- 1 file changed, 2 insertions(+), 23 deletions(-) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 73b948e..e5e2707 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -11,32 +11,13 @@ concurrency: jobs: release_zip_file: - name: Publish integration zip file asset + name: HACS release runs-on: ubuntu-latest permissions: contents: write steps: - name: Checkout the repository - uses: actions/checkout@v3.5.3 - - - 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: | @@ -47,6 +28,4 @@ jobs: uses: softprops/action-gh-release@v0.1.15 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 From 8e0aab730c73dcbde9bab340bb519cabfeacfe66 Mon Sep 17 00:00:00 2001 From: Emanuele Palazzetti Date: Fri, 13 Oct 2023 12:22:20 +0000 Subject: [PATCH 2/4] tools!(ci): building workflow happens on every commit and PR --- .github/workflows/building.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/building.yaml b/.github/workflows/building.yaml index cc99392..442b0a4 100644 --- a/.github/workflows/building.yaml +++ b/.github/workflows/building.yaml @@ -3,8 +3,9 @@ name: 'Building release package' on: workflow_dispatch: push: - tags: - - 'v*' + branches: + - main + pull_request: permissions: contents: read From ba7270a020ebb24d9061a8468de8ed9d5f4de880 Mon Sep 17 00:00:00 2001 From: Emanuele Palazzetti Date: Fri, 13 Oct 2023 12:22:55 +0000 Subject: [PATCH 3/4] tools: update actions/checkout to v4 --- .github/workflows/building.yaml | 4 ++-- .github/workflows/hassfest.yaml | 2 +- .github/workflows/linting.yaml | 2 +- .github/workflows/publish.yaml | 2 +- .github/workflows/testing.yaml | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/building.yaml b/.github/workflows/building.yaml index 442b0a4..8ef68b6 100644 --- a/.github/workflows/building.yaml +++ b/.github/workflows/building.yaml @@ -15,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 diff --git a/.github/workflows/hassfest.yaml b/.github/workflows/hassfest.yaml index 9b20ba8..61871a0 100644 --- a/.github/workflows/hassfest.yaml +++ b/.github/workflows/hassfest.yaml @@ -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 diff --git a/.github/workflows/linting.yaml b/.github/workflows/linting.yaml index 901f2c2..b320837 100644 --- a/.github/workflows/linting.yaml +++ b/.github/workflows/linting.yaml @@ -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 diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index e5e2707..0ce858b 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -10,7 +10,7 @@ concurrency: cancel-in-progress: true jobs: - release_zip_file: + release: name: HACS release runs-on: ubuntu-latest permissions: diff --git a/.github/workflows/testing.yaml b/.github/workflows/testing.yaml index 7d432bb..a223817 100644 --- a/.github/workflows/testing.yaml +++ b/.github/workflows/testing.yaml @@ -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 From df1aa87c03bfdec1e1a6b8c93bebb0e042b846d9 Mon Sep 17 00:00:00 2001 From: Emanuele Palazzetti Date: Fri, 13 Oct 2023 12:23:45 +0000 Subject: [PATCH 4/4] tools!(build): remove Hatch zip dist as it is not used anymore --- .github/workflows/building.yaml | 3 --- pyproject.toml | 4 ---- 2 files changed, 7 deletions(-) diff --git a/.github/workflows/building.yaml b/.github/workflows/building.yaml index 8ef68b6..34e21f7 100644 --- a/.github/workflows/building.yaml +++ b/.github/workflows/building.yaml @@ -38,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 diff --git a/pyproject.toml b/pyproject.toml index 276a9ae..b14e06d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,6 @@ [build-system] requires = [ "hatchling", - "hatch-zipped-directory", ] build-backend = "hatchling.build" @@ -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"]