-
Notifications
You must be signed in to change notification settings - Fork 1
50 lines (40 loc) · 1.22 KB
/
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
47
48
49
50
name: Publish nopalm to npm registry
on:
push:
branches:
- main
jobs:
publish_package:
runs-on: ubuntu-latest
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
# Checkout the code
- name: Checkout code
uses: actions/checkout@v3
# Set up Node.js environment
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '20'
registry-url: 'https://registry.npmjs.org/'
# Install all dependencies (including devDependencies for lint/test/build)
- name: Install dependencies
run: yarn install
# Run linting
- name: Run lint
run: yarn lint
# Run tests
- name: Run tests
run: yarn test
# Build production version of react client
- name: Build client
run: yarn build-client
# Verify NPM_TOKEN
- name: Verify NPM_TOKEN
run: |
curl -H "Authorization: Bearer $NPM_TOKEN" https://registry.npmjs.org/-/whoami
# Semantic release step: Automatically determine the version and release
- name: Semantic release the package
run: rm -rf "$PWD/.npmrc" && yarn release