-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (46 loc) · 1.32 KB
/
publish-npm.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: Publish packages to NPM
on:
pull_request:
paths:
- "packages/realm/**/*"
branches:
- main
types:
- closed
jobs:
publish:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
permissions: write-all
env:
NPM_AUTH_TOKEN: ${{secrets.NPM_AUTH_TOKEN}}
steps:
- name: Checkout Code
uses: actions/checkout@v3
with:
token: ${{secrets.REALM_PAT}}
fetch-depth: 2
- name: Install pnpm
uses: pnpm/action-setup@v2.0.1
with:
version: 8.6.12
- name: Setup Node.js environment
uses: actions/setup-node@v3
with:
node-version: 18
cache: "pnpm"
registry-url: https://registry.npmjs.org
- name: Install dependencies
run: pnpm install --no-frozen-lockfile
- name: Publish
run: |
git config --global user.email "god@realm.codes"
git config --global user.name "realmorg"
npm config set //registry.npmjs.org/:_authToken ${NPM_AUTH_TOKEN}
npm run publish-pkgs
git status
git add .
git reset -- pnpm-lock.yaml
git commit -m 'chore: version update'
git restore pnpm-lock.yaml
git push -u origin $(git branch --show-current) --follow-tags