-
-
Notifications
You must be signed in to change notification settings - Fork 0
38 lines (31 loc) 路 968 Bytes
/
Copy pathnpm-prerelease.yml
File metadata and controls
38 lines (31 loc) 路 968 Bytes
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
32
33
34
35
36
37
38
# This workflow publishes a package to NPM under the `next` tag
name: Prerelease package on npm
on:
push:
branches:
- prerelease
jobs:
prerelease:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16
registry-url: https://registry.npmjs.org
- name: Install dependencies
run: npm ci
- name: Get package version
uses: martinbeentjes/npm-get-version-action@v1.3.1
id: version
- name: Publish if prerelease
run: |
if [[ "${{ steps.version.outputs.current-version}}" =~ ^(.*-(alpha|beta|next|rc)(\..+)?)$ ]]; then
npm publish --access public --tag next
else
echo "Skipping publish since version is not a prerelease."
fi
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}