-
Notifications
You must be signed in to change notification settings - Fork 152
53 lines (42 loc) · 1.27 KB
/
release.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
51
52
53
name: Release
on:
push:
tags: ["*"]
jobs:
draft-release:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Draft Release
run: |
gh release create ${GITHUB_REF##*/} --title "${GITHUB_REF##*/}" --draft --generate-notes --prerelease
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
publish:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 9
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: 20
registry-url: "https://registry.npmjs.org"
cache: "pnpm"
- name: Install
run: |
git config --global url."https://github.com/".insteadOf git://github.com/
pnpm install --frozen-lockfile --prefer-offline
- name: Build
run: pnpm run build
- name: Publish NPM
run: |
# Prevent `git commit error`
# It will not be pushed to GitHub as it is ephemeral
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
pnpm exec lerna publish from-package --yes
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}