Skip to content

Commit

Permalink
Updated dev environment
Browse files Browse the repository at this point in the history
  • Loading branch information
briis committed Sep 28, 2023
1 parent 6c472de commit 0652893
Show file tree
Hide file tree
Showing 5 changed files with 96 additions and 31 deletions.
17 changes: 0 additions & 17 deletions .github/workflows/hassfest.yaml

This file was deleted.

29 changes: 29 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: "Lint"

on:
push:
branches:
- "main"
pull_request:
branches:
- "main"

jobs:
ruff:
name: "Ruff"
runs-on: "ubuntu-latest"
steps:
- name: "Checkout the repository"
uses: "actions/[email protected]"

- name: "Set up Python"
uses: actions/[email protected]
with:
python-version: "3.11"
cache: "pip"

- name: "Install requirements"
run: python3 -m pip install -r requirements.txt

- name: "Run"
run: python3 -m ruff check .
35 changes: 35 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: "Release"

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: "Adjust version number"
shell: "bash"
run: |
yq -i -o json '.version="${{ github.event.release.tag_name }}"' \
"${{ github.workspace }}/custom_components/weatherflow_forecast/manifest.json"
- name: "ZIP the integration directory"
shell: "bash"
run: |
cd "${{ github.workspace }}/custom_components/weatherflow_forecast"
zip weatherflow_forecast.zip -r ./
- name: "Upload the ZIP file to the release"
uses: softprops/[email protected]
with:
files: ${{ github.workspace }}/custom_components/weatherflow_forecast/weatherflow_forecast.zip
42 changes: 30 additions & 12 deletions .github/workflows/validate.yaml
Original file line number Diff line number Diff line change
@@ -1,21 +1,39 @@
name: HACS Action
name: "Validate"

on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"
push:
paths-ignore:
- '**/README.md'
- '**/CHANGELOG.md'
- "**/README.md"
- "**/info.md"
- "**/CHANGELOG.md"
branches:
- "main"
pull_request:
schedule:
- cron: "0 0 * * *"
branches:
- "main"

jobs:
hacs:
name: HACS Action
hassfest: # https://developers.home-assistant.io/blog/2020/04/16/hassfest
name: "Hassfest Validation"
runs-on: "ubuntu-latest"
steps:
- uses: "actions/checkout@v3"
- name: HACS Action
uses: "hacs/action@main"
with:
category: "integration"
- name: "Checkout the repository"
uses: "actions/[email protected]"

- name: "Run hassfest validation"
uses: "home-assistant/actions/hassfest@master"

hacs: # https://github.com/hacs/action
name: "HACS Validation"
runs-on: "ubuntu-latest"
steps:
- name: "Checkout the repository"
uses: "actions/[email protected]"

- name: "Run HACS validation"
uses: "hacs/action@main"
with:
category: "integration"
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
colorlog==6.7.0
homeassistant==2023.9.2
homeassistant==2023.9.3
pip>=23.2.1,<23.3
ruff==0.0.267
ruff==0.0.290

0 comments on commit 0652893

Please sign in to comment.