Skip to content

Package v0.11.2 for NPM Release #1

Package v0.11.2 for NPM Release

Package v0.11.2 for NPM Release #1

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 == 'NorthernMan54/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 }}