diff --git a/.github/workflows/alpha-release.yml b/.github/workflows/alpha-release.yml index a8247b67e..7df39e3d4 100644 --- a/.github/workflows/alpha-release.yml +++ b/.github/workflows/alpha-release.yml @@ -55,7 +55,17 @@ jobs: - 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 }} + for i in {1..10}; do + npm install -g homebridge-config-ui-x@${{ needs.publish.outputs.NPM_VERSION }} && break || { + if [ $? -eq 1 ] && grep -q 'ETARGET' <<< "$(npm install -g homebridge-config-ui-x@${{ needs.publish.outputs.NPM_VERSION }} 2>&1)"; then + echo "Attempt $i failed with ETARGET error. Retrying in 1 minute..." + sleep 60 + else + echo "Attempt $i failed with a different error. Exiting..." + exit 1 + fi + } + done - name: Remove invalid node-pty node-gyp run v${{ needs.publish.outputs.NPM_VERSION }} run: | diff --git a/.github/workflows/beta-release.yml b/.github/workflows/beta-release.yml index 5477d9f95..3ccca6953 100644 --- a/.github/workflows/beta-release.yml +++ b/.github/workflows/beta-release.yml @@ -54,7 +54,17 @@ jobs: - 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 }} + for i in {1..10}; do + npm install -g homebridge-config-ui-x@${{ needs.publish.outputs.NPM_VERSION }} && break || { + if [ $? -eq 1 ] && grep -q 'ETARGET' <<< "$(npm install -g homebridge-config-ui-x@${{ needs.publish.outputs.NPM_VERSION }} 2>&1)"; then + echo "Attempt $i failed with ETARGET error. Retrying in 1 minute..." + sleep 60 + else + echo "Attempt $i failed with a different error. Exiting..." + exit 1 + fi + } + done - name: Remove invalid node-pty node-gyp run v${{ needs.publish.outputs.NPM_VERSION }} run: | diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3284b46cb..e90b3161b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -66,7 +66,17 @@ jobs: - name: Install package run: | export npm_config_prefix=$(pwd)/package - npm install -g homebridge-config-ui-x@${{ needs.tag.outputs.version }} + for i in {1..10}; do + npm install -g homebridge-config-ui-x@${{ needs.tag.outputs.version }} && break || { + if [ $? -eq 1 ] && grep -q 'ETARGET' <<< "$(npm install -g homebridge-config-ui-x@${{ needs.tag.outputs.version }} 2>&1)"; then + echo "Attempt $i failed with ETARGET error. Retrying in 1 minute..." + sleep 60 + else + echo "Attempt $i failed with a different error. Exiting..." + exit 1 + fi + } + done - name: Remove invalid node-pty node-gyp run run: | diff --git a/CHANGELOG.md b/CHANGELOG.md index 3288db4e5..52ead8af9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ All notable changes to `homebridge-config-ui-x` will be documented in this file. ### Other Changes - fix types + update dependencies +- fix attach artifacts to release workflow ### Homebridge Dependencies