-
Notifications
You must be signed in to change notification settings - Fork 54
122 lines (106 loc) · 4.16 KB
/
Copy pathrelease.yml
File metadata and controls
122 lines (106 loc) · 4.16 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
name: Github + NPM Release
on:
push:
branches:
- "main"
permissions:
contents: write
pull-requests: write
id-token: write
jobs:
release-please:
outputs:
# GitHub Actions job-level outputs only accept scalars, so expose
# `releases_created` directly and stringify the full step-outputs
# mapping as JSON for downstream jobs that iterate over per-package keys.
releases_created: ${{ steps.release.outputs.releases_created }}
release_outputs_json: ${{ toJSON(steps.release.outputs) }}
runs-on: ubuntu-latest
environment: publish
steps:
- uses: google-github-actions/release-please-action@v3
id: release
with:
release-type: node
package-name: "@lukso/lsp-smart-contracts"
bump-minor-pre-major: true
default-branch: main
changelog-types: '[{"type": "feat!","section":"BREAKING CHANGES","hidden": false},{"type": "refactor!","section":"BREAKING CHANGES","hidden": false},{"type": "build!","section":"BREAKING CHANGES","hidden": false},{"type":"feat","section":"Features","hidden":false},{"type":"fix","section":"Bug Fixes","hidden":false},{"type":"chore","section":"Miscellaneous","hidden":false}]'
command: manifest
# The logic below handles the npm publication.
# The `if` statements ensure that a publication only occurs when
# a new release is created:
- uses: actions/checkout@v4
if: ${{ steps.release.outputs.releases_created }}
- name: Use Node.js v24
uses: actions/setup-node@v4
if: ${{ steps.release.outputs.releases_created }}
with:
node-version: "24.x"
registry-url: "https://registry.npmjs.org"
scope: "@lukso"
cache: "npm"
# Trusted publishing (OIDC) requires npm >= 11.5.1.
# Node 24 ships with npm 11, but pin to latest to guarantee the version.
- name: Upgrade npm
if: ${{ steps.release.outputs.releases_created }}
run: npm install -g npm@latest
- name: Install Dependencies
if: ${{ steps.release.outputs.releases_created }}
run: npm ci
# `npm run build:package` will generate the artifacts with abis for release (artifacts/*.json)
#
# `npm run build:types` will generate the Typescript typed abis (abi.ts)
#
# `npm run build:js` will generate the `dist/` folder and include:
# - the constants for:
# - methods (`FunctionSelectors`)
# - errors (`ErrorSelectors`)
# - events (`EventSigHashes`)
# - state variables (`StateVariables`)
# - the typed ABIs that can be exported in ESM / common JS
- name: Prepare artifacts to publish
if: ${{ steps.release.outputs.releases_created }}
run: |
npm run build
npm run build:package
npm run build:types
npm run build:js
- name: Publish on NPM
if: ${{ steps.release.outputs.releases_created }}
run: |
(cat <<END > outputs.json
${{toJSON(steps.release.outputs)}}
END
)
node ./publish.mjs outputs.json
deploy-verify:
needs: release-please
if: ${{ needs.release-please.outputs.releases_created }}
strategy:
matrix:
network: ["luksoTestnet", "luksoMainnet"]
runs-on: ubuntu-latest
env:
# 0x983aBC616f2442bAB7a917E6bb8660Df8b01F3bF
CONTRACT_VERIFICATION_TESTNET_PK: ${{ secrets.CONTRACT_VERIFICATION_TESTNET_PK }}
# 0xF0efeD8d49c0FA6CFC861Bf0311b6B3a4414e4b7
CONTRACT_VERIFICATION_MAINNET_PK: ${{ secrets.CONTRACT_VERIFICATION_MAINNET_PK }}
steps:
- uses: actions/checkout@v4
- name: Use Node.js v22
uses: actions/setup-node@v4
with:
node-version: "22.x"
cache: "npm"
- name: Install dependencies
run: npm ci
- name: Build contract artifacts
run: npm run build
- name: Deploy & verify contracts on ${{ matrix.network }}
run: |
(cat <<'END' > outputs.json
${{ needs.release-please.outputs.release_outputs_json }}
END
)
node ./deploy-verify.mjs outputs.json ${{ matrix.network }}