-
Notifications
You must be signed in to change notification settings - Fork 19
54 lines (54 loc) · 1.77 KB
/
publish.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
---
# yamllint disable rule:line-length
name: "Publish to NPM"
on: # yamllint disable-line rule:truthy
release:
types:
- "published"
jobs:
publish:
name: Publish to NPM
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
- uses: bahmutov/npm-install@v1
- run: yarn test
- uses: battila7/get-version-action@v2
# Set the version in package.json to match the tag
- run: "npm version ${{ steps.get_version.outputs.version-without-v }}"
- uses: JS-DevTools/npm-publish@v3
with:
token: ${{ secrets.NPM_TOKEN }}
tag: ${{ steps.get_version.outputs.version }}
access: public
# NOTE: this publishes an alternate version that doesn't depend on protobuf-ts/runtime
publish-js-client:
name: Publish JS client to NPM
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
cache: "yarn"
# Install deps in base package and build into js-dist
- uses: bahmutov/npm-install@v1
- name: Run build
run: yarn build-js-client
- uses: bahmutov/npm-install@v1
with:
working-directory: ./js-dist
- uses: battila7/get-version-action@v2
# Set the version in package.json to match the tag
- run: "npm version ${{ steps.get_version.outputs.version-without-v }}"
working-directory: ./js-dist
- uses: JS-DevTools/npm-publish@v3
with:
token: ${{ secrets.NPM_TOKEN }}
tag: ${{ steps.get_version.outputs.version }}
# Point at the js-dist directory as the working directory
package: js-dist
access: public