From 4e8054471c4beb70cdd6d2aacdeb4a773ccb3c34 Mon Sep 17 00:00:00 2001 From: Felix Kaechele Date: Mon, 16 Oct 2023 16:06:26 -0400 Subject: [PATCH] fix: python-semantic-release build process Signed-off-by: Felix Kaechele --- .github/workflows/release.yml | 3 --- pyproject.toml | 14 +++++++++----- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9d1c0cd..418d155 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,9 +16,6 @@ jobs: with: fetch-depth: 0 - - name: Install Hatch - run: pip install hatch - # Run semantic release: # - Update CHANGELOG.md # - Update version in code diff --git a/pyproject.toml b/pyproject.toml index 6e8c8fc..b066e5c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -33,7 +33,6 @@ Source = "https://github.com/kaechele/napoleon-efire" path = "custom_components/napoleon_efire/manifest.json" pattern = '"version": "(?P[^\"]+)"' - [tool.hatch.envs.default] path = ".envs/default" python = "3.11" @@ -195,7 +194,12 @@ max-complexity = 25 [tool.semantic_release] logging_use_named_masks = true -assets = [ - "custom_components/napoleon_efire/manifest.json" -] -build_command = "hatch version $(semantic-release version --print) && pushd custom_components/napoleon_efire/ && mkdir ../../dist && zip ../../dist/napoleon_efire.zip -r ./; popd" +build_command = """ + hatch --version || pip install hatch + hatch version $(semantic-release version --print) + git add custom_components/napoleon_efire/manifest.json + pushd custom_components/napoleon_efire/ + mkdir -p ../../dist + zip ../../dist/napoleon_efire.zip -r ./ + popd +"""