Added various NPM scripts.
This commit is contained in:
37
npm/npm-push/action.yaml
Normal file
37
npm/npm-push/action.yaml
Normal file
@@ -0,0 +1,37 @@
|
||||
name: npm-push
|
||||
description: "Publish an NPM package to a registry."
|
||||
inputs:
|
||||
tgz:
|
||||
description: "Path to the tarball file to publish."
|
||||
required: true
|
||||
registry:
|
||||
description: "NPM registry URL."
|
||||
required: false
|
||||
default: "https://npm.pkg.github.com"
|
||||
apiKey:
|
||||
description: "NPM authentication token."
|
||||
required: true
|
||||
nodeVersion:
|
||||
description: "Node.js version to use."
|
||||
required: false
|
||||
default: "20"
|
||||
access:
|
||||
description: "Package access level: public or restricted."
|
||||
required: false
|
||||
default: "public"
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: "Setup Node.js"
|
||||
uses: https://github.com/actions/setup-node@v4
|
||||
with:
|
||||
node-version: ${{ inputs.nodeVersion }}
|
||||
registry-url: ${{ inputs.registry }}
|
||||
- name: "Publish package"
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{ inputs.apiKey }}
|
||||
run: |
|
||||
echo "Publishing ${{ inputs.tgz }} to ${{ inputs.registry }}"
|
||||
npm publish ${{ inputs.tgz }} --access ${{ inputs.access }}
|
||||
echo "Package published successfully"
|
||||
shell: bash
|
||||
Reference in New Issue
Block a user