Package v0.11.3 for NPM Release #2
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: "Package GitHub release for NPM" | |
run-name: Package ${{ github.event.inputs.tag }} for NPM Release | |
on: | |
workflow_dispatch: | |
inputs: | |
tag: | |
description: 'Tag' | |
required: true | |
jobs: | |
Package_NPM_Release: | |
name: Package NPM Release | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
- name: Setup Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: lts/* | |
- name: Download GitHub Release | |
uses: robinraju/[email protected] | |
with: | |
tag: ${{ github.event.inputs.tag }} | |
fileName: 'prebuilds-*tar.gz' | |
extract: true | |
- name: List | |
shell: bash | |
run: | | |
find . | |
- name: Check prebuilds exist | |
shell: bash | |
run: | | |
fileCount=$(ls prebuilds/*/*node | wc -l) | |
echo "Prebuild count ${fileCount}" | |
if [ "$fileCount" -eq 0 ]; then exit 1; fi | |
- name: NPM build | |
run: | | |
npm install | |
npm run build | |
- name: Package | |
shell: bash | |
run: | | |
npm pack | |
- name: Attach NPM package to Github Release | |
uses: AButler/[email protected] | |
with: | |
files: 'homebridge-node-pty-prebuilt-multiarch-*.tgz' | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
release-tag: ${{ github.event.inputs.tag }} | |
Publish_NPM_Release: | |
name: Publish NPM Release | |
needs: Package_NPM_Release | |
if: ${{ github.repository == 'homebridge/node-pty-prebuilt-multiarch' }} | |
uses: homebridge/.github/.github/workflows/npm-publish.yml@latest | |
with: | |
install_cmd: npm ci | |
secrets: | |
npm_auth_token: ${{ secrets.npm_token }} | |