-
Notifications
You must be signed in to change notification settings - Fork 1
55 lines (52 loc) · 1.47 KB
/
publish.yml
File metadata and controls
55 lines (52 loc) · 1.47 KB
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
name: Publish
env:
DEBUG: napi:*
APP_NAME: berry
CARGO_INCREMENTAL: '0'
CARGO_PROFILE_TEST_DEBUG: 0
CARGO_TERM_COLOR: always
on:
workflow_call:
jobs:
publish:
name: Publish
runs-on: ubuntu-latest
needs:
- test-linux-x64-gnu-binding
steps:
- uses: actions/checkout@v5
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 22
cache: 'yarn'
- name: Install dependencies
run: yarn install
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Create npm dirs
run: yarn napi create-npm-dirs
- name: Move artifacts
run: yarn artifacts
- name: List packages
run: ls -R ./npm
shell: bash
- name: Publish
run: |
npm config set provenance true
if git log -1 --pretty=%B | grep "^[0-9]\+\.[0-9]\+\.[0-9]\+$";
then
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
npm publish --access public
elif git log -1 --pretty=%B | grep "^[0-9]\+\.[0-9]\+\.[0-9]\+";
then
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
npm publish --tag next --access public
else
echo "Not a release, skipping publish"
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}