-
Notifications
You must be signed in to change notification settings - Fork 16
46 lines (37 loc) · 1001 Bytes
/
publish.yml
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
39
40
41
42
43
44
45
46
name: Publish to NPM
on:
push:
branches:
- v3
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v3
with:
ref: v3
fetch-depth: 0
- name: Set Build Variables
run: |
echo "NEXT_VERSION=3.0.0-alpha.${GITHUB_RUN_NUMBER}" >> $GITHUB_ENV
- name: Setup Node.js environment
uses: actions/[email protected]
with:
node-version: 18.x
registry-url: https://registry.npmjs.org/
- name: Set package.json version
uses: HarmvZ/[email protected]
with:
version: ${{ env.NEXT_VERSION }}
- name: Install NPM Dependencies
run: npm ci
- name: Run Tests
run: npm test
- name: Publish to NPM
run: npm publish --access public --provenance
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}