mirror of
https://github.com/Lash-L/RoborockCustomMap.git
synced 2026-07-26 16:18:32 +02:00
Add GitHub Actions
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
---
|
||||
name: Validate HACS
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
jobs:
|
||||
hacs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
name: Checkout code
|
||||
|
||||
- name: HACS Action
|
||||
uses: hacs/action@main
|
||||
with:
|
||||
category: integration
|
||||
ignore: brands
|
||||
@@ -0,0 +1,16 @@
|
||||
---
|
||||
name: Validate with hassfest
|
||||
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
hassfest:
|
||||
runs-on: "ubuntu-latest"
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
name: Checkout code
|
||||
|
||||
- uses: home-assistant/actions/hassfest@master
|
||||
name: Run hassfest validation
|
||||
@@ -0,0 +1,37 @@
|
||||
name: Release
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
|
||||
env:
|
||||
COMPONENT_NAME: roborock_custom_map
|
||||
|
||||
jobs:
|
||||
release:
|
||||
name: Prepare release
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
id-token: write
|
||||
steps:
|
||||
- name: Download repo
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Adjust version number
|
||||
shell: bash
|
||||
run: |
|
||||
version="${{ github.event.release.tag_name }}"
|
||||
yq e -P -o=json \
|
||||
-i ".version = \"${version}\"" \
|
||||
"${{ github.workspace }}/custom_components/${{ env.COMPONENT_NAME }}/manifest.json"
|
||||
|
||||
- name: Zip ${{ env.COMPONENT_NAME }} dir
|
||||
run: |
|
||||
cd "${{ github.workspace }}/custom_components/${{ env.COMPONENT_NAME }}"
|
||||
zip ${{ env.COMPONENT_NAME }}.zip -r ./
|
||||
|
||||
- name: Upload zip to release
|
||||
uses: softprops/action-gh-release@v2.1.0
|
||||
with:
|
||||
files: ${{ github.workspace }}/custom_components/${{ env.COMPONENT_NAME }}/${{ env.COMPONENT_NAME }}.zip
|
||||
Reference in New Issue
Block a user