Package v0.11.8-beta.0 for NPM Release #14
Workflow file for this run
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 | |
Beta: | |
description: 'Beta Release' | |
required: true | |
default: true | |
type: boolean | |
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/* | |
registry-url: 'https://registry.npmjs.org' | |
- name: NPM build | |
run: | | |
npm ci --ignore-scripts | |
npm run build | |
- name: Download NPM Prebuild Artifacts | |
uses: robinraju/[email protected] | |
with: | |
tag: ${{ github.event.inputs.tag }} | |
fileName: 'prebuilds.*.tar.gz' | |
extract: false | |
- name: Unpack NPM Prebuild Artifacts | |
shell: bash | |
run: | | |
for i in `ls prebuilds*tar.gz` | |
do | |
echo $i | |
tar xvzf $i | |
rm $i | |
done | |
- name: List Files ( For debugging ) | |
shell: bash | |
run: find . | |
- name: Fetch Adjust version script | |
if: ${{ inputs.Beta }} | |
run: wget https://raw.githubusercontent.com/homebridge/.github/latest/.github/npm-version-script.js | |
working-directory: .github | |
- name: Adjust version | |
if: ${{ inputs.Beta }} | |
run: node .github/npm-version-script.js ${{ github.ref }} beta | |
- name: npm version (without git commit) | |
if: ${{ inputs.Beta }} | |
run: npm version pre --preid=beta --no-git-tag-version | |
- name: NPM Pack Release | |
run: npm pack | |
- uses: AButler/[email protected] | |
name: Upload NPM Release to ${{ github.event.inputs.tag }} | |
with: | |
files: '*node-pty-prebuilt-multiarch*.tgz' | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
release-tag: ${{ github.event.inputs.tag }} | |
- name: npm publish beta | |
if: ${{ github.repository == 'homebridge/node-pty-prebuilt-multiarch' && inputs.Beta }} | |
run: npm publish --access public --tag=beta | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.npm_token }} | |
- name: npm publish production | |
if: ${{ github.repository == 'homebridge/node-pty-prebuilt-multiarch' && ! inputs.Beta }} | |
run: npm publish --access public | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.npm_token }} | |
# 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 }} |