Skip to content

Commit

Permalink
More workflows, docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Ramunas-OAG committed Jul 24, 2024
1 parent d423462 commit 51bf021
Show file tree
Hide file tree
Showing 9 changed files with 189 additions and 11 deletions.
3 changes: 2 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
"kevinrose.vsc-python-indent",
"keesschollaart.vscode-home-assistant",
"donjayamanne.githistory",
"mhutchie.git-graph"
"mhutchie.git-graph",
"mikoz.black-py"
]
}
},
Expand Down
18 changes: 18 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
# Maintain dependencies for GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"

# Maintain dependencies for pip
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "weekly"
34 changes: 34 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: "Lint"

on:
push:
paths-ignore:
- "**/README.md"
- "**/CHANGELOG.md"
- "**/CONTRIBUTING.md"
- "**/requirements.txt"
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.12"
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/meteo_lt/manifest.json"
- name: "ZIP the integration directory"
shell: "bash"
run: |
cd "${{ github.workspace }}/custom_components/meteo_lt"
zip meteo_lt.zip -r ./
- name: "Upload the ZIP file to the release"
uses: softprops/[email protected]
with:
files: ${{ github.workspace }}/custom_components/meteo_lt/meteo_lt.zip
38 changes: 29 additions & 9 deletions .github/workflows/validate.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,40 @@
name: HACS validation
name: "Validate"

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

jobs:
validate:
hassfest: # https://developers.home-assistant.io/blog/2020/04/16/hassfest
name: "Hassfest Validation"
runs-on: "ubuntu-latest"
steps:
- name: Checkout
uses: "actions/checkout@v4"
- name: Hassfest
- name: "Checkout the repository"
uses: "actions/[email protected]"

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

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
category: "integration"
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
## Not a Release 0.1.x

Date: `2024-07-24`

### Changes

- Initial version moved from local HASS
61 changes: 61 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Contribution guidelines

Contributing to this project should be as easy and transparent as possible, whether it's:

- Reporting a bug
- Discussing the current state of the code
- Submitting a fix
- Proposing new features

## Github is used for everything

Github is used to host code, to track issues and feature requests, as well as accept pull requests.

Pull requests are the best way to propose changes to the codebase.

1. Fork the repo and create your branch from `main`.
2. If you've changed something, update the documentation.
3. Make sure your code lints (using `scripts/lint`).
4. Test you contribution.
5. Issue that pull request!

## Any contributions you make will be under the MIT Software License

In short, when you submit code changes, your submissions are understood to be under the same [MIT License](http://choosealicense.com/licenses/mit/) that covers the project. Feel free to contact the maintainers if that's a concern.

## Report bugs using Github's [issues](../../issues)

GitHub issues are used to track public bugs.
Report a bug by [opening a new issue](../../issues/new/choose); it's that easy!

## Write bug reports with detail, background, and sample code

**Great Bug Reports** tend to have:

- A quick summary and/or background
- Steps to reproduce
- Be specific!
- Give sample code if you can.
- What you expected would happen
- What actually happens
- Notes (possibly including why you think this might be happening, or stuff you tried that didn't work)

People *love* thorough bug reports. I'm not even kidding.

## Use a Consistent Coding Style

Use [black](https://github.com/ambv/black) to make sure the code follows the style.

## Test your code modification

This custom component is based on [integration_blueprint template](https://github.com/ludeeus/integration_blueprint).

It comes with development environment in a container, easy to launch
if you use Visual Studio Code. With this container you will have a stand alone
Home Assistant instance running and already configured with the included
[`configuration.yaml`](./config/configuration.yaml)
file.

## License

By contributing, you agree that your contributions will be licensed under its MIT License.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Home Assistant integration for Meteo.Lt REST API
[![GitHub Activity][commits-shield]][commits]
[![License][license-shield]](LICENSE)
![Project Maintenance][maintenance-shield]
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)

<a href="https://buymeacoffee.com/pdfdc52z8h" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Buy Me A Coffee" style="height: 40px !important;width: 145px !important;" ></a>

Expand Down Expand Up @@ -57,4 +58,4 @@ logger:
[license-shield]: https://img.shields.io/github/license/Brunas/meteo_lt.svg?style=flat-square
[maintenance-shield]: https://img.shields.io/badge/maintainer-Brunas%20%40Brunas-blue.svg?style=flat-square
[releases-shield]: https://img.shields.io/github/release/Brunas/meteo_lt.svg?style=flat-square
[releases]: https://github.com/Brunas/meteo_lt/releases
[releases]: https://github.com/Brunas/meteo_lt/releases
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
colorlog==6.8.2
homeassistant==2024.7.3
pip>=24.1.1,<24.2
black
meteo_lt-pkg

0 comments on commit 51bf021

Please sign in to comment.