-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yaml
31 lines (29 loc) · 1012 Bytes
/
action.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
name: NPM Publish Prerelease
description: Publish an npm package appending timestamp and commit sha to current version
inputs:
access:
description: Visibility of package, allowed values are 'null', 'public' and 'restricted'
required: false
default: "null"
node-version:
description: Node version used to install and publish the package
required: false
default: "lts/*"
npm-token:
description: NPM access token used to publish the package to the npm registry
required: true
runs:
using: composite
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node-version }}
registry-url: "https://registry.npmjs.org"
- shell: bash
run: |
npm ci
npm version --no-git-tag-version $(npm pkg get version | xargs)-$(date +%s)-${{ github.sha }}
npm publish --tag ${{ github.ref_name }} --access ${{ inputs.access }}
env:
NODE_AUTH_TOKEN: ${{ inputs.npm-token }}