-
Notifications
You must be signed in to change notification settings - Fork 80
46 lines (37 loc) · 1.12 KB
/
npm-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: npm-publish
on:
push:
branches:
- main
jobs:
release:
runs-on: ubuntu-latest
steps:
# Step 1: Checkout the repository
- name: Checkout code
uses: actions/checkout@v3
# Step 2: Set up Node.js
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
registry-url: 'https://registry.npmjs.org/'
# Step 3: Install pnpm
- name: Install pnpm
run: |
npm install -g pnpm
# Step 4: Install dependencies with pnpm
- name: Install dependencies
run: pnpm install --frozen-lockfile
# Step 5: Build the library with pnpm
- name: Build ng-mdx
run: pnpm run lib.build
# Step 6: Copy the root README.md to the library folder
- name: Copy README.md to library folder
run: cp README.md dist/ngx-md/README.md
# Step 7: Run semantic-release to publish to npm
- name: Run semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
run: pnpx semantic-release