From 7f3e6549a4292e3653647741bceca457264bc10a Mon Sep 17 00:00:00 2001 From: ludeeus Date: Fri, 10 Mar 2023 09:36:12 +0000 Subject: [PATCH] Add release action --- .github/workflows/release.yml | 31 +++++++++++++++++++++++++++++++ hacs.json | 5 ++++- 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..adcd383 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,31 @@ +name: "Release" + +on: + release: + types: + - "published" + +jobs: + release: + name: "Release" + runs-on: "ubuntu-latest" + steps: + - name: "Checkout the repository" + uses: "actions/checkout@v3.3.0" + + - name: "Adjust version number" + shell: "bash" + run: | + yq -i -o json '.version="${{ github.event.release.tag_name }}"' \ + "${{ github.workspace }}/custom_components/integration_blueprint/manifest.json" + + - name: "ZIP the integration directory" + shell: "bash" + run: | + cd "${{ github.workspace }}/custom_components/integration_blueprint" + zip integration_blueprint.zip -r ./ + + - name: "Upload the ZIP file to the release" + uses: softprops/action-gh-release@v0.1.15 + with: + files: ${{ github.workspace }}/custom_components/integration_blueprint/integration_blueprint.zip diff --git a/hacs.json b/hacs.json index 2efde37..7524a63 100644 --- a/hacs.json +++ b/hacs.json @@ -1,5 +1,8 @@ { "name": "Integration blueprint", + "filename": "integration_blueprint.zip", + "hide_default_branch": true, + "homeassistant": "2022.2.0", "render_readme": true, - "homeassistant": "2022.2.0" + "zip_release": true } \ No newline at end of file