Skip to content

Commit

Permalink
Expose the versioned package in the release (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
mathieu-mp committed Jul 2, 2023
1 parent 959c9ff commit 40b1e05
Show file tree
Hide file tree
Showing 6 changed files with 73 additions and 32 deletions.
21 changes: 0 additions & 21 deletions .github/workflows/cron.yaml

This file was deleted.

21 changes: 21 additions & 0 deletions .github/workflows/cron.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Cron actions

on:
schedule:
- cron: "0 0 * * *"

jobs:
validate:
runs-on: "ubuntu-latest"
name: Validate
steps:
- uses: "actions/[email protected]"

- name: HACS validation
uses: "hacs/action@main"
with:
category: "integration"
ignore: brands

- name: Hassfest validation
uses: "home-assistant/actions/hassfest@master"
10 changes: 5 additions & 5 deletions .github/workflows/pull.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: "ubuntu-latest"
name: Validate
steps:
- uses: "actions/checkout@v3"
- uses: "actions/checkout@v3.5.2"

- name: HACS validation
uses: "hacs/action@main"
Expand All @@ -25,8 +25,8 @@ jobs:
runs-on: "ubuntu-latest"
name: Check style formatting
steps:
- uses: "actions/checkout@v3"
- uses: "actions/setup-python@v4"
- uses: "actions/checkout@v3.5.2"
- uses: "actions/setup-python@v4.6.1"
with:
python-version: ${{ env.PYTHON_VERSION }}
- run: python3 -m pip install black
Expand All @@ -37,9 +37,9 @@ jobs:
name: Run tests
steps:
- name: Check out code from GitHub
uses: "actions/checkout@v3"
uses: "actions/checkout@v3.5.2"
- name: Setup Python
uses: "actions/setup-python@v4"
uses: "actions/setup-python@v4.6.1"
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install requirements
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: "ubuntu-latest"
name: Validate
steps:
- uses: "actions/checkout@v3"
- uses: "actions/checkout@v3.5.2"

- name: HACS validation
uses: "hacs/action@main"
Expand All @@ -29,8 +29,8 @@ jobs:
runs-on: "ubuntu-latest"
name: Check style formatting
steps:
- uses: "actions/checkout@v3"
- uses: "actions/setup-python@v4"
- uses: "actions/checkout@v3.5.2"
- uses: "actions/setup-python@v4.6.1"
with:
python-version: ${{ env.PYTHON_VERSION }}
- run: python3 -m pip install black
Expand All @@ -41,9 +41,9 @@ jobs:
name: Run tests
steps:
- name: Check out code from GitHub
uses: "actions/checkout@v3"
uses: "actions/checkout@v3.5.2"
- name: Setup Python
uses: "actions/setup-python@v4"
uses: "actions/setup-python@v4.6.1"
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install requirements
Expand Down
41 changes: 41 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Release actions

on:
release:
types:
- "published"

permissions: {}

jobs:
release:
name: "Release"
runs-on: "ubuntu-latest"
permissions:
contents: write
steps:
- name: "Checkout the repository"
uses: "actions/[email protected]"

- name: "Set release version number to manifest.json"
shell: "bash"
run: |
yq -i -o json '.version="${{ github.event.release.tag_name }}"' \
"${{ github.workspace }}/custom_components/intex_spa/manifest.json"
- name: "Set release version number to const.py"
shell: "bash"
run: |
sed -i 's/VERSION = "0.0.0"/VERSION = "${{ github.event.release.tag_name }}"/' \
"${{ github.workspace }}/custom_components/intex_spa/const.py"
- name: "ZIP the integration directory"
shell: "bash"
run: |
cd "${{ github.workspace }}/custom_components/intex_spa"
zip intex_spa.zip -r ./
- name: "Upload the ZIP file to the release"
uses: softprops/[email protected]
with:
files: ${{ github.workspace }}/custom_components/intex_spa/intex_spa.zip
2 changes: 1 addition & 1 deletion custom_components/intex_spa/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# Base component constants
NAME = "Intex Spa"
DOMAIN = "intex_spa"
VERSION = "0.0.1"
VERSION = "0.0.0"
ISSUE_URL = "https://github.com/mathieu-mp/homeassistant-intex-spa/issues"

# Platforms
Expand Down

0 comments on commit 40b1e05

Please sign in to comment.