-
Notifications
You must be signed in to change notification settings - Fork 8
44 lines (36 loc) · 1.26 KB
/
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
name: Publish Packages to NPM
on:
push:
branches:
- master
jobs:
publish:
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
registry-url: 'https://registry.npmjs.org'
- uses: actions/cache@v4
with:
path: |
**/node_modules
key: ${{ hashFiles('**/yarn.lock') }}
- uses: oven-sh/setup-bun@v1
- name: Install modules
run: yarn install --frozen-lockfile
# make extra sure this publish wouldn’t break anything
- run: yarn run build check test
# HACK: When putting this workflow into action, the pipeline did not find the
# correct registry and/or Auth Token. To fix this we did the following:
# - adding both of these lines (we are not sure if only one would have done the trick)
# - using `yarn publish` instead of `npm publish`
- run: cp internals/scripts/source/npmrc-template /home/runner/work/_temp/.npmrc
- run: cp internals/scripts/source/npmrc-template .npmrc
- name: publish
run: bun internals/scripts/source/publish.ts
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}