Skip to content

Commit 1c357f6

Browse files
committed
fix: verified build in release
Signed-off-by: Reinis Martinsons <[email protected]>
1 parent 59fc792 commit 1c357f6

File tree

1 file changed

+65
-14
lines changed

1 file changed

+65
-14
lines changed

.github/workflows/publish.yml

+65-14
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,17 @@ name: Publish Package to npmjs
1212
on:
1313
release:
1414
types: [created]
15+
env:
16+
NODE_VERSION: "20.x"
17+
EVM_ARTIFACTS_PATHS: |
18+
artifacts
19+
cache
20+
typechain
21+
SVM_ARTIFACTS_PATHS: |
22+
target/idl
23+
target/types
24+
src/svm/assets
25+
src/svm/clients
1526
jobs:
1627
build:
1728
runs-on: ubuntu-latest
@@ -22,26 +33,66 @@ jobs:
2233
- name: Validate and extract release information
2334
id: release
2435
uses: manovotny/[email protected]
25-
# Setup Anchor to enable compilation and export of Solana programs
26-
- name: Extract Solana versions
27-
uses: solana-developers/github-actions/[email protected]
28-
id: versions
29-
- name: Setup Anchor & Solana
30-
uses: solana-developers/github-actions/[email protected]
31-
with:
32-
anchor_version: ${{ steps.versions.outputs.anchor_version }}
33-
solana_version: ${{ steps.versions.outputs.solana_version }}
34-
node_version: 20
35-
# - run: anchor build
36+
3637
# Setup .npmrc file to publish to npm
3738
- uses: actions/setup-node@v3
3839
with:
39-
node-version: "20.x"
40+
node-version: "${{ env.NODE_VERSION }}"
4041
always-auth: true
4142
registry-url: "https://registry.npmjs.org"
43+
cache: "yarn"
44+
45+
- name: Install packages
46+
run: yarn install --frozen-lockfile
47+
48+
- name: Cache EVM artifacts
49+
id: evm-artifacts-cache
50+
uses: ./.github/actions/cache-evm-artifacts
51+
with:
52+
path: ${{ env.EVM_ARTIFACTS_PATHS }}
53+
node_version: ${{ env.NODE_VERSION }}
54+
55+
- name: Generate EVM artifacts
56+
if: steps.evm-artifacts-cache.outputs.cache-hit != 'true'
57+
uses: ./.github/actions/generate-evm-artifacts
58+
with:
59+
node_version: ${{ env.NODE_VERSION }}
60+
61+
- name: Cache SVM artifacts
62+
id: svm-artifacts-cache
63+
uses: ./.github/actions/cache-svm-artifacts
64+
with:
65+
path: ${{ env.SVM_ARTIFACTS_PATHS }}
66+
node_version: ${{ env.NODE_VERSION }}
67+
68+
- name: Generate SVM artifacts
69+
if: steps.svm-artifacts-cache.outputs.cache-hit != 'true'
70+
uses: ./.github/actions/generate-svm-artifacts
71+
with:
72+
node_version: ${{ env.NODE_VERSION }}
73+
74+
# This would duplicate installation if the SVM artifacts cache was not hit above, but otherwise the composite
75+
# action would become more complex and we need to add solana-verify anyway.
76+
- name: Setup Anchor & Solana
77+
uses: ./.github/actions/setup-solana-anchor
78+
with:
79+
verify_version: 0.4.3
80+
node_version: ${{ env.NODE_VERSION }}
81+
82+
- name: Cache verified production build binaries
83+
id: verified-production-build-cache
84+
uses: ./.github/actions/cache-svm-artifacts
85+
with:
86+
type: verified-production-binaries
87+
path: target/deploy
88+
node_version: ${{ env.NODE_VERSION }}
89+
90+
- name: Create verified build
91+
if: steps.verified-production-build-cache.outputs.cache-hit != 'true'
92+
run: yarn build-svm-solana-verify
4293

43-
# Perform installs and run a build step.
44-
- run: yarn install --frozen-lockfile && yarn build
94+
- name: Build dist package
95+
run: yarn build-ts
4596

4697
# The last two steps will publish the package. Note that we're using
4798
# information from the `release` step above (I told you we'd use it

0 commit comments

Comments
 (0)