-
Notifications
You must be signed in to change notification settings - Fork 11
42 lines (40 loc) · 1.43 KB
/
publish-from-package.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
name: Publish from package.json
on: [workflow_dispatch]
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
# pulls all commits (needed for lerna / semantic release to correctly version)
fetch-depth: 0
# pulls all tags (needed for lerna / semantic release to correctly version)
- name: Pull All Git Tags
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
- uses: fregante/setup-git-user@v1
- name: Setup Nodejs
uses: actions/setup-node@v3
with:
node-version: 16
# lerna expects to be authenticated for publishing to NPM. This step will fail CI if NPM is not authenticated
- name: Check NPM authentication
run: |
echo "//registry.npmjs.org/:_authToken=${{ secrets.SEMANTIC_RELEASE_NPM_TOKEN }}" >> .npmrc
npm whoami
- name: Install and Setup Dependencies
run: npm ci
# build must come before running linting and tests for the `dist` directory to exist.
- name: Build
run: npm run build
- name: Lint
run: npm run lint
- name: Test
run: npm run test
- name: Coverage Report
uses: codecov/codecov-action@v3
- name: Publish to NPM from package.json versions
run: npx lerna@6 publish from-package --yes
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}