Update Github Actions

This commit is contained in:
samuelspagl 2023-09-06 17:12:15 +02:00
parent c563a3efd7
commit 3010cd3e03
3 changed files with 54 additions and 36 deletions

View File

@ -1,16 +1,37 @@
name: HACS Action name: "Validate"
on: on:
push: workflow_dispatch:
pull_request:
schedule: schedule:
- cron: "0 0 * * *" - cron: "0 0 * * *"
push:
branches:
- "main"
pull_request:
branches:
- "main"
jobs: jobs:
hacs: hassfest: # https://developers.home-assistant.io/blog/2020/04/16/hassfest
name: HACS Action name: "Hassfest Validation"
runs-on: "ubuntu-latest" runs-on: "ubuntu-latest"
steps: steps:
- name: HACS Action - name: "Checkout the repository"
uses: "actions/checkout@v3.5.3"
- 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/checkout@v3.5.3"
- name: "Run HACS validation"
uses: "hacs/action@main" uses: "hacs/action@main"
with: with:
category: "integration" category: "integration"
# Remove this 'ignore' key when you have added brand images for your integration to https://github.com/home-assistant/brands
ignore: "brands"

View File

@ -1,11 +0,0 @@
name: Validate with hassfest
on:
pull_request:
jobs:
validate:
runs-on: "ubuntu-latest"
steps:
- uses: "actions/checkout@v3"
- uses: home-assistant/actions/hassfest@master

View File

@ -1,27 +1,35 @@
name: Release name: "Release"
on: on:
release: release:
types: [published] types:
- "published"
permissions: {}
jobs: jobs:
release: release:
name: Prepare release name: "Release"
runs-on: ubuntu-latest runs-on: "ubuntu-latest"
permissions:
contents: write
steps: steps:
- name: Download repo - name: "Checkout the repository"
uses: actions/checkout@v3 uses: "actions/checkout@v3.5.3"
- name: Zip samsung_soundbar dir - name: "Adjust version number"
shell: "bash"
run: | run: |
cd /home/runner/work/ha_samsung_soundbar/ha_samsung_soundbar/custom_components/samsung_soundbar yq -i -o json '.version="${{ github.event.release.tag_name }}"' \
"${{ github.workspace }}/custom_components/samsung_soundbar/manifest.json"
- name: "ZIP the integration directory"
shell: "bash"
run: |
cd "${{ github.workspace }}/custom_components/samsung_soundbar"
zip samsung_soundbar.zip -r ./ zip samsung_soundbar.zip -r ./
- name: Upload zip to release - name: "Upload the ZIP file to the release"
uses: svenstaro/upload-release-action@v1-release uses: softprops/action-gh-release@v0.1.15
with: with:
repo_token: ${{ secrets.GITHUB_TOKEN }} files: ${{ github.workspace }}/custom_components/samsung_soundbar/samsung_soundbar.zip
file: /home/runner/work/ha_samsung_soundbar/ha_samsung_soundbar/custom_components/samsung_soundbar/samsung_soundbar.zip
asset_name: samsung_soundbar.zip
tag: ${{ github.ref }}
overwrite: true