From 2773a02357398b27118d9a9648e4eb6892804d9a Mon Sep 17 00:00:00 2001 From: Donavan Becker Date: Thu, 2 May 2024 07:40:24 -0500 Subject: [PATCH] Update Discord Webhooks to trigger only after published to npm --- .github/workflows/alpha-release.yml | 12 ++++++++ .github/workflows/beta-release.yml | 12 ++++++++ .github/workflows/discord-webhooks.yml | 39 -------------------------- .github/workflows/release.yml | 12 ++++++++ CHANGELOG.md | 4 +++ 5 files changed, 40 insertions(+), 39 deletions(-) delete mode 100644 .github/workflows/discord-webhooks.yml diff --git a/.github/workflows/alpha-release.yml b/.github/workflows/alpha-release.yml index f474fb3a6..9c7b9a31e 100644 --- a/.github/workflows/alpha-release.yml +++ b/.github/workflows/alpha-release.yml @@ -16,3 +16,15 @@ jobs: pre_id: 'alpha' secrets: npm_auth_token: ${{ secrets.npm_token }} + + github-releases-to-discord: + name: Discord Webhooks + needs: [publish] + uses: homebridge/.github/.github/workflows/discord-webhooks.yml@latest + with: + title: "HAP-NodeJS Alpha Release" + description: | + Version `v${{ needs.publish.outputs.NPM_VERSION }}` + url: "https://github.com/homebridge/homebridge/releases/tag/v${{ needs.publish.outputs.NPM_VERSION }}" + secrets: + DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK_URL_BETA }} diff --git a/.github/workflows/beta-release.yml b/.github/workflows/beta-release.yml index dcc97200a..f72f4aed8 100644 --- a/.github/workflows/beta-release.yml +++ b/.github/workflows/beta-release.yml @@ -29,3 +29,15 @@ jobs: pre_id: 'beta' secrets: npm_auth_token: ${{ secrets.npm_token }} + + github-releases-to-discord: + name: Discord Webhooks + needs: [build_and_test,publish] + uses: homebridge/.github/.github/workflows/discord-webhooks.yml@latest + with: + title: "HAP-NodeJS Beta Release" + description: | + Version `v${{ needs.publish.outputs.NPM_VERSION }}` + url: "https://github.com/homebridge/homebridge/releases/tag/v${{ needs.publish.outputs.NPM_VERSION }}" + secrets: + DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK_URL_BETA }} diff --git a/.github/workflows/discord-webhooks.yml b/.github/workflows/discord-webhooks.yml deleted file mode 100644 index be644ba14..000000000 --- a/.github/workflows/discord-webhooks.yml +++ /dev/null @@ -1,39 +0,0 @@ -# This is a basic workflow to help you get started with Actions - -name: Discord Webhooks - -# Controls when the workflow will run -on: - release: - types: [released, prereleased] - -jobs: - github-releases-to-discord: - runs-on: ubuntu-latest - name: GitHub Releases to Discord - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Latest Release - if: ${{ github.event.release.prerelease == false }} - uses: SethCohen/github-releases-to-discord@v1.13.1 - with: - webhook_url: ${{ secrets.DISCORD_WEBHOOK_URL_LATEST }} - color: "4726621" - username: "Homebridge" - avatar_url: "https://raw.githubusercontent.com/homebridge/branding/latest/logos/homebridge-color-round-stylized.png" - footer_title: "HAP-NodeJS" - footer_icon_url: "https://raw.githubusercontent.com/homebridge/branding/latest/logos/homebridge-color-round-stylized.png" - footer_timestamp: true - - - name: Pre-Release - if: ${{ github.event.release.prerelease == true }} - uses: SethCohen/github-releases-to-discord@v1.13.1 - with: - webhook_url: ${{ secrets.DISCORD_WEBHOOK_URL_BETA }} - color: "4726621" - username: "Homebridge" - avatar_url: "https://raw.githubusercontent.com/homebridge/branding/latest/logos/homebridge-color-round-stylized.png" - footer_title: "Pre-Release: HAP-NodeJS" - footer_icon_url: "https://raw.githubusercontent.com/homebridge/branding/latest/logos/homebridge-color-round-stylized.png" - footer_timestamp: true \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c69c57d71..0ef9aac9b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -22,3 +22,15 @@ jobs: uses: homebridge/.github/.github/workflows/npm-publish.yml@latest secrets: npm_auth_token: ${{ secrets.npm_token }} + + github-releases-to-discord: + name: Discord Webhooks + needs: [build_and_test,publish] + uses: homebridge/.github/.github/workflows/discord-webhooks.yml@latest + with: + title: "HAP-NodeJS Release" + description: | + Version `v${{ needs.publish.outputs.NPM_VERSION }}` + url: "https://github.com/homebridge/homebridge-config-ui-x/releases/tag/v${{ needs.publish.outputs.NPM_VERSION }}" + secrets: + DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK_URL_LATEST }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 9cc33fd75..eefe45d6d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,10 @@ All notable changes to `hap-nodejs` will be documented in this file. This projec - Mitigate event emitter "memory leak" warnings when a significant number of HSV events occur simultaneously (#1029) (@hjdhjd) +### Other Changes + +- Update Discord Webhooks to trigger only after published to npm + ## v0.12.0 (2024-04-19) ### Changed