Production Release #19
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: | |
# - '*.*.*' | |
workflow_dispatch: | |
jobs: | |
build_and_test: | |
uses: homebridge/.github/.github/workflows/nodejs-build-and-test.yml@latest | |
with: | |
enable_coverage: true | |
install_cmd: npm ci && cd ui && npm ci | |
secrets: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
publish: | |
needs: build_and_test | |
if: ${{ github.repository == 'homebridge/homebridge-config-ui-x' }} | |
uses: homebridge/.github/.github/workflows/npm-publish.yml@latest | |
with: | |
install_cmd: npm ci && cd ui && npm ci | |
secrets: | |
npm_auth_token: ${{ secrets.npm_token }} | |
build: | |
needs: publish | |
name: Attach Artifact | |
runs-on: ubuntu-latest | |
steps: | |
- name: Setup node | |
uses: actions/setup-node@v1 | |
with: | |
node-version: 20.x | |
# 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 | |
if: startsWith(github.event.release.tag_name, 'v') | |
run: | | |
echo "Release Tag name must not start with 'v', this was supplied ${{github.event.release.tag_name}}" | |
exit 1 | |
- name: Install package | |
run: | | |
export npm_config_prefix=$(pwd)/package | |
npm install -g homebridge-config-ui-x@${{ github.event.release.tag_name }} | |
- name: Remove invalid node-pty node-gyp run | |
run: | | |
rm -rf $(pwd)/package/lib/node_modules/homebridge-config-ui-x/node_modules/@homebridge/node-pty-prebuilt-multiarch/build | |
- name: Create Bundle | |
run: | | |
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/[email protected] | |
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 }} |