diff --git a/.github/workflows/hacs.yaml b/.github/workflows/hacs.yaml index 2c0c32d..81a98ef 100644 --- a/.github/workflows/hacs.yaml +++ b/.github/workflows/hacs.yaml @@ -1,16 +1,37 @@ -name: HACS Action +name: "Validate" on: - push: - pull_request: + workflow_dispatch: schedule: - - cron: "0 0 * * *" + - cron: "0 0 * * *" + push: + branches: + - "main" + pull_request: + 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: - - name: HACS Action - uses: "hacs/action@main" - with: - category: "integration" \ No newline at end of file + - 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" + with: + category: "integration" + # Remove this 'ignore' key when you have added brand images for your integration to https://github.com/home-assistant/brands + ignore: "brands" \ No newline at end of file diff --git a/.github/workflows/hassfest.yaml b/.github/workflows/hassfest.yaml deleted file mode 100644 index d5c521c..0000000 --- a/.github/workflows/hassfest.yaml +++ /dev/null @@ -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 \ No newline at end of file diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index fb37950..b26e0f2 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -1,27 +1,35 @@ -name: Release +name: "Release" on: release: - types: [published] + types: + - "published" + +permissions: {} jobs: release: - name: Prepare release - runs-on: ubuntu-latest + name: "Release" + runs-on: "ubuntu-latest" + permissions: + contents: write steps: - - name: Download repo - uses: actions/checkout@v3 + - name: "Checkout the repository" + uses: "actions/checkout@v3.5.3" - - name: Zip samsung_soundbar dir + - name: "Adjust version number" + shell: "bash" 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 ./ - - name: Upload zip to release - uses: svenstaro/upload-release-action@v1-release + - name: "Upload the ZIP file to the release" + uses: softprops/action-gh-release@v0.1.15 with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - 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 \ No newline at end of file + files: ${{ github.workspace }}/custom_components/samsung_soundbar/samsung_soundbar.zip \ No newline at end of file