From 617d3ac537d4bf2d907323d6102428fde238217a Mon Sep 17 00:00:00 2001 From: Ben <43026681+bwp91@users.noreply.github.com> Date: Sun, 19 Nov 2023 10:17:58 +0000 Subject: [PATCH] update github release workflow --- .github/workflows/Attach Artifacts.yml | 12 +++++++++--- .github/workflows/release.yml | 18 ++++++++---------- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/.github/workflows/Attach Artifacts.yml b/.github/workflows/Attach Artifacts.yml index 7f0203286..1f8e1c0f8 100644 --- a/.github/workflows/Attach Artifacts.yml +++ b/.github/workflows/Attach Artifacts.yml @@ -2,6 +2,8 @@ name: Manually Attach Artifacts ( If the automation fails ) run-name: Manually Attach Artifacts against ${{ github.event.inputs.tag }} on: + repository_dispatch: + types: [attach-artifacts] workflow_dispatch: inputs: tag: @@ -19,6 +21,10 @@ jobs: with: node-version: 20.x + - name: Get previous tag + id: previoustag + uses: "WyriHaximus/github-action-get-previous-tag@v1" + # 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 # https://github.com/orgs/community/discussions/25017 @@ -30,7 +36,7 @@ jobs: - name: Install package run: | export npm_config_prefix=$(pwd)/package - npm install -g homebridge-config-ui-x@${{ github.event.inputs.tag }} + npm install -g homebridge-config-ui-x@$${{ needs.analyze-tags.outputs.previous-tag }} - name: Remove invalid node-pty node-gyp run run: | @@ -39,11 +45,11 @@ jobs: - name: Create Bundle run: | tar -C $(pwd)/package --owner=0 --group=0 --format=posix -czvf homebridge-config-ui-x-${{ github.event.inputs.tag }}.tar.gz . - shasum -a 256 homebridge-config-ui-x-${{ github.event.inputs.tag }}.tar.gz > SHASUMS256.txt + shasum -a 256 homebridge-config-ui-x-${{ needs.analyze-tags.outputs.previous-tag }}.tar.gz > SHASUMS256.txt - name: Attach Bundle uses: AButler/upload-release-assets@v2.0 with: - files: 'homebridge-config-ui-x-${{ github.event.inputs.tag }}.tar.gz;SHASUMS256.txt' + files: 'homebridge-config-ui-x-${{ needs.analyze-tags.outputs.previous-tag }}.tar.gz;SHASUMS256.txt' repo-token: ${{ secrets.GITHUB_TOKEN }} release-tag: ${{ github.event.inputs.tag }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5691ac3cb..2ca42613a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,11 +2,11 @@ name: Node Release run-name: Production Release ${{ github.event.release.tag_name }} on: -# Removed publish on push, and forced manual release from github -# push: -# branches: [latest] -# tags: -# - '*.*.*' + # Removed publish on push, and forced manual release from github + # push: + # branches: [latest] + # tags: + # - '*.*.*' workflow_dispatch: jobs: @@ -61,9 +61,7 @@ jobs: tar -C $(pwd)/package --owner=0 --group=0 --format=posix -czvf homebridge-config-ui-x-${{ github.event.release.tag_name }}.tar.gz . shasum -a 256 homebridge-config-ui-x-${{ github.event.release.tag_name }}.tar.gz > SHASUMS256.txt - - name: Attach Bundle - uses: AButler/upload-release-assets@v2.0 + - name: Repository Dispatch + uses: peter-evans/repository-dispatch@v2 with: - files: 'homebridge-config-ui-x-${{ github.event.release.tag_name }}.tar.gz;SHASUMS256.txt' - repo-token: ${{ secrets.GITHUB_TOKEN }} - release-tag: ${{ github.event.release.tag_name }} + event-type: attach-artifacts