diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml index a793d98dc..c6075653b 100644 --- a/.github/release-drafter.yml +++ b/.github/release-drafter.yml @@ -1,5 +1,5 @@ -name-template: '$RESOLVED_VERSION' -tag-template: '$RESOLVED_VERSION' +name-template: 'v$RESOLVED_VERSION' +tag-template: 'v$RESOLVED_VERSION' categories: - title: 'Breaking Changes' diff --git a/.github/workflows/Attach Artifacts.yml b/.github/workflows/attach-artifacts.yml similarity index 81% rename from .github/workflows/Attach Artifacts.yml rename to .github/workflows/attach-artifacts.yml index 27128a861..d9369d42e 100644 --- a/.github/workflows/Attach Artifacts.yml +++ b/.github/workflows/attach-artifacts.yml @@ -21,15 +21,6 @@ jobs: with: node-version: 20.x - # workflow_dispatch - # Sanity check to ensure that release tags don't start with a 'v' version prefix but adhere to the X.Y.Z format - - name: Check for Tag name Format ${{ github.event.inputs.tag }} - # https://github.com/orgs/community/discussions/25017 - if: startsWith(github.event.inputs.tag, 'v') - run: | - echo "Release Tag name must not start with 'v', this was supplied ${{ github.event.inputs.tag }}" - exit 1 - - name: Install package ${{ github.event.inputs.tag }} if: github.event_name == 'workflow_dispatch' run: | @@ -86,24 +77,24 @@ jobs: id: get_version uses: jannemattila/get-version-from-tag@v3 - - name: Install package ${{ steps.get_version.outputs.version }} + - name: Install package v${{ steps.get_version.outputs.version }} if: github.event_name == 'release' run: | export npm_config_prefix=$(pwd)/package npm install -g homebridge-config-ui-x@${{ steps.get_version.outputs.version }} - - name: Remove invalid node-pty node-gyp run ${{ steps.get_version.outputs.version }} + - name: Remove invalid node-pty node-gyp run v${{ steps.get_version.outputs.version }} if: github.event_name == 'release' run: | rm -rf $(pwd)/package/lib/node_modules/homebridge-config-ui-x/node_modules/@homebridge/node-pty-prebuilt-multiarch/build - - name: Create Bundle ${{ steps.get_version.outputs.version }} + - name: Create Bundle v${{ steps.get_version.outputs.version }} if: github.event_name == 'release' run: | tar -C $(pwd)/package --owner=0 --group=0 --format=posix -czvf homebridge-config-ui-x-${{ steps.get_version.outputs.version }}.tar.gz . shasum -a 256 homebridge-config-ui-x-${{ steps.get_version.outputs.version }}.tar.gz > SHASUMS256.txt - - name: Check Bundle ${{ steps.get_version.outputs.version }} + - name: Check Bundle v${{ steps.get_version.outputs.version }} if: github.event_name == 'release' run: | if [ $(stat -c%s "homebridge-config-ui-x-${{ steps.get_version.outputs.version }}.tar.gz") -lt 10000000 ]; then @@ -111,7 +102,7 @@ jobs: exit 1 fi - - name: Upload tar.gz Bundle to GitHub Artifacts ${{ steps.get_version.outputs.version }} + - name: Upload tar.gz Bundle to GitHub Artifacts v${{ steps.get_version.outputs.version }} if: github.event_name == 'release' uses: actions/upload-artifact@v4 with: @@ -120,7 +111,7 @@ jobs: ./homebridge-config-ui-x-${{ steps.get_version.outputs.version }}.tar.gz - - name: Upload SHASUMS256.txt to GitHub Artifacts ${{ steps.get_version.outputs.version }} + - name: Upload SHASUMS256.txt to GitHub Artifacts v${{ steps.get_version.outputs.version }} if: github.event_name == 'release' uses: actions/upload-artifact@v4 with: @@ -128,10 +119,19 @@ jobs: path: | ./SHASUMS256.txt - - name: Attach Bundle ${{ steps.get_version.outputs.version }} + - name: Attach Bundle v${{ steps.get_version.outputs.version }} if: github.event_name == 'release' uses: AButler/upload-release-assets@v3.0 with: files: 'homebridge-config-ui-x-${{ steps.get_version.outputs.version }}.tar.gz;SHASUMS256.txt' repo-token: ${{ secrets.GITHUB_TOKEN }} - release-tag: ${{ steps.get_version.outputs.version }} \ No newline at end of file + release-tag: v${{ steps.get_version.outputs.version }} + + github-releases-to-discord: + name: Discord Webhooks + needs: build + uses: homebridge/.github/.github/workflows/discord-webhooks.yml@latest + with: + footer_title: "Pre-Release: Homebridge UI" + secrets: + DISCORD_WEBHOOK_URL_BETA: ${{ secrets.DISCORD_WEBHOOK_URL_BETA }} \ No newline at end of file diff --git a/.github/workflows/discord-webhooks.yml b/.github/workflows/discord-webhooks.yml deleted file mode 100644 index 1fe625011..000000000 --- a/.github/workflows/discord-webhooks.yml +++ /dev/null @@ -1,17 +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: - uses: homebridge/.github/.github/workflows/discord-webhooks.yml@latest - with: - footer_title: "Homebridge UI" - secrets: - DISCORD_WEBHOOK_URL_LATEST: ${{ secrets.DISCORD_WEBHOOK_URL_LATEST }} - DISCORD_WEBHOOK_URL_BETA: ${{ secrets.DISCORD_WEBHOOK_URL_BETA }} \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2752d1afd..a2a032b19 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -105,3 +105,12 @@ jobs: files: 'homebridge-config-ui-x-${{ needs.tag.outputs.version }}.tar.gz;SHASUMS256.txt' repo-token: ${{ secrets.GITHUB_TOKEN }} release-tag: ${{ needs.tag.outputs.version }} + + github-releases-to-discord: + name: Discord Webhooks + needs: [tag, publish, build] + uses: homebridge/.github/.github/workflows/discord-webhooks.yml@latest + with: + footer_title: "Homebridge UI" + secrets: + DISCORD_WEBHOOK_URL_LATEST: ${{ secrets.DISCORD_WEBHOOK_URL_LATEST }} \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index de2159b36..d8a35132b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -39,6 +39,9 @@ All notable changes to `homebridge-config-ui-x` will be documented in this file. - updated dependencies - update hb/nest dependencies - fixed shared use of `commander` between homebridge and the UI repo +- allow for tags to start with a `v` +- combined discord release actions with `attach-artifacts` and `release` actions + - prevents the discord webhook from triggering before the release is complete and published ### Homebridge Dependencies diff --git a/src/modules/plugins/plugins.service.ts b/src/modules/plugins/plugins.service.ts index 2d04ab3e6..57fb7ac47 100755 --- a/src/modules/plugins/plugins.service.ts +++ b/src/modules/plugins/plugins.service.ts @@ -686,7 +686,7 @@ export class PluginsService { pluginAction.version !== 'latest' ) { try { - await this.httpService.head(`https://github.com/homebridge/homebridge-config-ui-x/releases/download/${pluginAction.version}/homebridge-config-ui-x-${pluginAction.version}.tar.gz`).toPromise(); + await this.httpService.head(`https://github.com/homebridge/homebridge-config-ui-x/releases/download/v${pluginAction.version}/homebridge-config-ui-x-${pluginAction.version}.tar.gz`).toPromise(); return true; } catch (e) { return false; diff --git a/upgrade-install.sh b/upgrade-install.sh index 033f091ab..bca43cd2a 100755 --- a/upgrade-install.sh +++ b/upgrade-install.sh @@ -28,7 +28,7 @@ fi echo "Downloading SHASUMS256.txt..." curl -fsSL# -o "$tmp_dir/SHASUMS256.txt" \ - https://github.com/homebridge/homebridge-config-ui-x/releases/download/${TARGET_VERSION}/SHASUMS256.txt + https://github.com/homebridge/homebridge-config-ui-x/releases/download/v${TARGET_VERSION}/SHASUMS256.txt if [ "$?" != "0" ]; then echo "Failed to download SHASUMS256.txt" exit 1 @@ -36,7 +36,7 @@ fi echo "Downloading homebridge-config-ui-x-${TARGET_VERSION}.tar.gz..." curl -fL# -o "$tmp_dir/homebridge-config-ui-x-${TARGET_VERSION}.tar.gz" \ - https://github.com/homebridge/homebridge-config-ui-x/releases/download/${TARGET_VERSION}/homebridge-config-ui-x-${TARGET_VERSION}.tar.gz + https://github.com/homebridge/homebridge-config-ui-x/releases/download/v${TARGET_VERSION}/homebridge-config-ui-x-${TARGET_VERSION}.tar.gz if [ "$?" != "0" ]; then echo "Failed to download homebridge-config-ui-x-${TARGET_VERSION}.tar.gz" exit 1