From 1fac5ae08e8b18693b67f304bbdaf2db6edf0dae Mon Sep 17 00:00:00 2001 From: Donavan Becker Date: Sat, 27 Apr 2024 07:54:59 -0500 Subject: [PATCH] v4.56.2 --- .github/release-drafter.yml | 4 +- .github/workflows/alpha-release.yml | 89 +++++++++++++++++++ ...ach Artifacts.yml => attach-artifacts.yml} | 27 ++---- .github/workflows/beta-release.yml | 89 +++++++++++++++++++ .github/workflows/discord-webhooks.yml | 17 ---- .github/workflows/release.yml | 14 ++- CHANGELOG.md | 8 ++ package-lock.json | 4 +- package.json | 4 +- src/modules/plugins/plugins.service.ts | 2 +- upgrade-install.sh | 4 +- 11 files changed, 217 insertions(+), 45 deletions(-) rename .github/workflows/{Attach Artifacts.yml => attach-artifacts.yml} (80%) delete mode 100644 .github/workflows/discord-webhooks.yml 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/alpha-release.yml b/.github/workflows/alpha-release.yml index 7b184e67a..ddfcb31c2 100644 --- a/.github/workflows/alpha-release.yml +++ b/.github/workflows/alpha-release.yml @@ -8,6 +8,7 @@ on: jobs: publish: if: ${{ github.repository == 'homebridge/homebridge-config-ui-x' }} + name: "Publish Pre Release Alpha to NPM" uses: homebridge/.github/.github/workflows/npm-publish.yml@latest with: tag: 'alpha' @@ -17,3 +18,91 @@ jobs: install_cmd: npm ci && cd ui && npm ci secrets: npm_auth_token: ${{ secrets.npm_token }} + + pre-release-alpha: + needs: [publish] + name: "Create New Github Alpha Pre Release" + if: ${{ github.repository == 'homebridge/homebridge-config-ui-x' }} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Create nightly release + id: create_release + uses: viperproject/create-nightly-release@v1 + env: + # This token is provided by Actions, you do not need to create your own token + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: v${{ needs.publish.outputs.NPM_VERSION }} + release_name: v${{ needs.publish.outputs.NPM_VERSION }} + body: | + v${{ needs.publish.outputs.NPM_VERSION }} + [How To Test Upcoming Changes](https://github.com/homebridge/homebridge-config-ui-x/wiki/How-To-Test-Upcoming-Changes) + keep_num: 0 # remove the just created release as well + keep_tags: false + + attach-artifact: + name: Attach Artifact + needs: [publish, pre-release-alpha] + runs-on: ubuntu-latest + + steps: + - name: Setup node + uses: actions/setup-node@v4 + with: + node-version: 20.x + + - name: Install package v${{ needs.publish.outputs.NPM_VERSION }} + run: | + export npm_config_prefix=$(pwd)/package + npm install -g homebridge-config-ui-x@${{ needs.publish.outputs.NPM_VERSION }} + + - name: Remove invalid node-pty node-gyp run v${{ needs.publish.outputs.NPM_VERSION }} + run: | + rm -rf $(pwd)/package/lib/node_modules/homebridge-config-ui-x/node_modules/@homebridge/node-pty-prebuilt-multiarch/build + + - name: Create Bundle v${{ needs.publish.outputs.NPM_VERSION }} + run: | + tar -C $(pwd)/package --owner=0 --group=0 --format=posix -czvf homebridge-config-ui-x-${{ needs.publish.outputs.NPM_VERSION }}.tar.gz . + shasum -a 256 homebridge-config-ui-x-${{ needs.publish.outputs.NPM_VERSION }}.tar.gz > SHASUMS256.txt + + - name: Check Bundle v${{ needs.publish.outputs.NPM_VERSION }} + run: | + if [ $(stat -c%s "homebridge-config-ui-x-${{ needs.publish.outputs.NPM_VERSION }}.tar.gz") -lt 10000000 ]; then + echo "Bundle is under 10MB, stopping" + exit 1 + fi + + - name: Upload tar.gz Bundle to GitHub Artifacts v${{ needs.publish.outputs.NPM_VERSION }} + uses: actions/upload-artifact@v4 + with: + name: 'homebridge-config-ui-x-${{ needs.publish.outputs.NPM_VERSION }}.tar.gz' + path: | + ./homebridge-config-ui-x-${{ needs.publish.outputs.NPM_VERSION }}.tar.gz + + + - name: Upload SHASUMS256.txt to GitHub Artifacts v${{ needs.publish.outputs.NPM_VERSION }} + uses: actions/upload-artifact@v4 + with: + name: 'SHASUMS256.txt' + path: | + ./SHASUMS256.txt + + - name: Attach Bundle v${{ needs.publish.outputs.NPM_VERSION }} + uses: AButler/upload-release-assets@v3.0 + with: + files: 'homebridge-config-ui-x-${{ needs.publish.outputs.NPM_VERSION }}.tar.gz;SHASUMS256.txt' + repo-token: ${{ secrets.GITHUB_TOKEN }} + release-tag: v${{ needs.publish.outputs.NPM_VERSION }} + + github-releases-to-discord: + name: Discord Webhooks + needs: [publish,pre-release-alpha,attach-artifact] + uses: homebridge/.github/.github/workflows/discord-webhooks.yml@latest + with: + title: "Homebridge UI Alpha 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_BETA }} diff --git a/.github/workflows/Attach Artifacts.yml b/.github/workflows/attach-artifacts.yml similarity index 80% rename from .github/workflows/Attach Artifacts.yml rename to .github/workflows/attach-artifacts.yml index 27128a861..238f69478 100644 --- a/.github/workflows/Attach Artifacts.yml +++ b/.github/workflows/attach-artifacts.yml @@ -7,7 +7,7 @@ on: workflow_dispatch: inputs: tag: - description: 'Tag - must not start with v' + description: 'Tag - please make it start with v' required: true jobs: @@ -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,10 @@ 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 }} \ No newline at end of file diff --git a/.github/workflows/beta-release.yml b/.github/workflows/beta-release.yml index e7ce45441..7ba5698ff 100644 --- a/.github/workflows/beta-release.yml +++ b/.github/workflows/beta-release.yml @@ -17,3 +17,92 @@ jobs: install_cmd: npm ci && cd ui && npm ci secrets: npm_auth_token: ${{ secrets.npm_token }} + + pre-release-beta: + needs: [publish] + name: "Create New Github Beta Pre Release" + if: ${{ github.repository == 'homebridge/homebridge-config-ui-x' }} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Create nightly release + id: create_release + uses: viperproject/create-nightly-release@v1 + env: + # This token is provided by Actions, you do not need to create your own token + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: v${{ needs.publish.outputs.NPM_VERSION }} + release_name: v${{ needs.publish.outputs.NPM_VERSION }} + body: | + v${{ needs.publish.outputs.NPM_VERSION }} + [How To Test Upcoming Changes](https://github.com/homebridge/homebridge-config-ui-x/wiki/How-To-Test-Upcoming-Changes) + keep_num: 0 # remove the just created release as well + keep_tags: false + + attach-artifact: + name: Attach Artifact + needs: [publish, pre-release-beta] + runs-on: ubuntu-latest + + steps: + - name: Setup node + uses: actions/setup-node@v4 + with: + node-version: 20.x + + - name: Install package v${{ needs.publish.outputs.NPM_VERSION }} + run: | + export npm_config_prefix=$(pwd)/package + npm install -g homebridge-config-ui-x@${{ needs.publish.outputs.NPM_VERSION }} + + - name: Remove invalid node-pty node-gyp run v${{ needs.publish.outputs.NPM_VERSION }} + run: | + rm -rf $(pwd)/package/lib/node_modules/homebridge-config-ui-x/node_modules/@homebridge/node-pty-prebuilt-multiarch/build + + - name: Create Bundle v${{ needs.publish.outputs.NPM_VERSION }} + run: | + tar -C $(pwd)/package --owner=0 --group=0 --format=posix -czvf homebridge-config-ui-x-${{ needs.publish.outputs.NPM_VERSION }}.tar.gz . + shasum -a 256 homebridge-config-ui-x-${{ needs.publish.outputs.NPM_VERSION }}.tar.gz > SHASUMS256.txt + + - name: Check Bundle v${{ needs.publish.outputs.NPM_VERSION }} + run: | + if [ $(stat -c%s "homebridge-config-ui-x-${{ needs.publish.outputs.NPM_VERSION }}.tar.gz") -lt 10000000 ]; then + echo "Bundle is under 10MB, stopping" + exit 1 + fi + + - name: Upload tar.gz Bundle to GitHub Artifacts v${{ needs.publish.outputs.NPM_VERSION }} + uses: actions/upload-artifact@v4 + with: + name: 'homebridge-config-ui-x-${{ needs.publish.outputs.NPM_VERSION }}.tar.gz' + path: | + ./homebridge-config-ui-x-${{ needs.publish.outputs.NPM_VERSION }}.tar.gz + + + - name: Upload SHASUMS256.txt to GitHub Artifacts v${{ needs.publish.outputs.NPM_VERSION }} + uses: actions/upload-artifact@v4 + with: + name: 'SHASUMS256.txt' + path: | + ./SHASUMS256.txt + + - name: Attach Bundle v${{ needs.publish.outputs.NPM_VERSION }} + uses: AButler/upload-release-assets@v3.0 + with: + files: 'homebridge-config-ui-x-${{ needs.publish.outputs.NPM_VERSION }}.tar.gz;SHASUMS256.txt' + repo-token: ${{ secrets.GITHUB_TOKEN }} + release-tag: v${{ needs.publish.outputs.NPM_VERSION }} + + github-releases-to-discord: + name: Discord Webhooks + needs: [publish,pre-release-beta,attach-artifact] + uses: homebridge/.github/.github/workflows/discord-webhooks.yml@latest + with: + title: "Homebridge UI Beta 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_BETA }} + 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..bba2d40ab 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -51,7 +51,7 @@ jobs: secrets: npm_auth_token: ${{ secrets.npm_token }} - build: + attach-artifact: needs: [tag, publish] if: ${{ github.repository == 'homebridge/homebridge-config-ui-x' }} name: Attach Artifact ${{ needs.tag.outputs.version }} @@ -105,3 +105,15 @@ 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,build_and_test,publish,attach-artifact] + uses: homebridge/.github/.github/workflows/discord-webhooks.yml@latest + with: + title: "Homebridge 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 }} \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 1bf76b789..f0cd69385 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,14 @@ All notable changes to `homebridge-config-ui-x` will be documented in this file. This project tries to adhere to [Semantic Versioning](http://semver.org/). +## v4.56.2 (2024-04-27) + +### Other Changes + +- Prepare for tags with prefex of `v +- Update Discord Webhook +- Update Pre Release Process + ## v4.56.1 (2024-04-03) ### Bug Fixes diff --git a/package-lock.json b/package-lock.json index 20f76e1a4..04dca6b65 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "homebridge-config-ui-x", - "version": "4.56.1", + "version": "4.56.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "homebridge-config-ui-x", - "version": "4.56.1", + "version": "4.56.2", "funding": [ { "type": "github", diff --git a/package.json b/package.json index d3191f7f9..93fe6f316 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "homebridge-config-ui-x", "displayName": "Homebridge UI", - "version": "4.56.1", + "version": "4.56.2", "description": "A web based management, configuration and control platform for Homebridge.", "license": "MIT", "author": "oznu ", @@ -159,4 +159,4 @@ "smart home", "hb-service" ] -} +} \ No newline at end of file diff --git a/src/modules/plugins/plugins.service.ts b/src/modules/plugins/plugins.service.ts index 2d04ab3e6..385d8a248 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` || `https://github.com/homebridge/homebridge-config-ui-x/releases/download/${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..c5389566c 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 || https://github.com/homebridge/homebridge-config-ui-x/releases/download/${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 || https://github.com/homebridge/homebridge-config-ui-x/releases/download/${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