-
Notifications
You must be signed in to change notification settings - Fork 7
61 lines (49 loc) · 1.53 KB
/
publish-npm-packages.yaml
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
54
55
56
57
58
59
60
61
name: Publish packages to npm
on:
push:
branches: ['main']
env:
NODE_OPTIONS: '--max_old_space_size=4096'
jobs:
canary-release-to-npm:
name: 'Canary release to npm'
needs: stable-release-to-npm
environment: publish-npm
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
registry-url: 'https://registry.npmjs.org'
- name: Setup antlr4
uses: ./.github/actions/setup-antlr4
- name: Install dependencies with frozen lock file and generate parser
run: npm ci
- name: Build and release canary package to npm
run: node ./release-canary.js
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
stable-release-to-npm:
name: 'Stable release to npm'
environment: publish-npm
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
- name: Setup antlr4
uses: ./.github/actions/setup-antlr4
- name: Install dependencies with frozen lock file and generate parser
run: npm ci
- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@3de3850952bec538fde60aac71731376e57b9b57 # v1.4.8
with:
publish: npm run release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}