-
Notifications
You must be signed in to change notification settings - Fork 123
64 lines (56 loc) · 1.7 KB
/
npm-publisher.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
54
55
56
57
58
59
60
61
62
63
64
name: Publish types package to NPM
on:
workflow_dispatch:
inputs:
version:
description: Package version
type: string
required: true
project_name:
description: Project name
type: choice
options:
- blockscout-ens
required: true
workflow_call:
inputs:
version:
description: Package version
type: string
required: true
project_name:
description: Project name
type: string
required: true
jobs:
publish:
runs-on: ubuntu-latest
name: Publish package to NPM registry
permissions:
id-token: write
steps:
- name: Checkout repo
uses: actions/checkout@v4
# Also it will setup .npmrc file to publish to npm
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'
- name: Install Protoc
uses: arduino/setup-protoc@v3
- name: Update package version
run: |
cd ./${{ inputs.project_name }}/types
npm version ${{ inputs.version }}
- name: Build the package
run: |
cd ./${{ inputs.project_name }}/types
npm install
npm run build
- name: Publish to NPM registry
run: |
cd ./${{ inputs.project_name }}/types
npm publish --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}