-
Notifications
You must be signed in to change notification settings - Fork 112
64 lines (54 loc) · 1.64 KB
/
Copy pathabi.yml
File metadata and controls
64 lines (54 loc) · 1.64 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
56
57
58
59
60
61
62
63
64
name: DeFi
on:
push:
tags:
- v*
concurrency:
cancel-in-progress: true
group: ${{ github.ref_name }}
# security/LOW: scope GITHUB_TOKEN to read-only. Publishes use
# NPM_TOKEN_ORIGIN_DEFI (env-scoped to `master` environment), not
# GITHUB_TOKEN.
permissions:
contents: read
jobs:
abi-gen:
name: "Generate and publish ABI"
runs-on: ubuntu-latest
environment: master
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 10
run_install: false
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: "20.x"
cache: "pnpm"
cache-dependency-path: contracts/pnpm-lock.yaml
- name: Configure Git to use HTTPS for GitHub
run: git config --global url."https://github.com/".insteadOf "git@github.com:"
- name: Install deps
working-directory: ./contracts
run: pnpm install --frozen-lockfile
- name: "Generate ABI files"
run: (pnpm run abi:generate) && (pnpm run abi:dist)
env:
CONTRACT_SIZE: true
working-directory: ./contracts
- name: Update version from tag
working-directory: ./contracts/dist
run: |
VERSION=${GITHUB_REF_NAME#v}
echo "Version set to $VERSION"
sed -i -e "s/RELEASE_VERSION/$VERSION/g" package.json
- name: "Publish"
run: npm publish --access public
working-directory: ./contracts/dist
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN_ORIGIN_DEFI }}