-
Notifications
You must be signed in to change notification settings - Fork 25
121 lines (101 loc) · 2.97 KB
/
release.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
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
name: Release
on:
push:
tags:
- 'v*.*.*'
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }}
cancel-in-progress: true
jobs:
artifacts:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: 'recursive'
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
- name: Tests
run: forge test --no-match-contract DispatcherDeployTest
- name: Check contract sizes
run: rm -rf out && forge build contracts/ --sizes --deny-warnings
- name: Save compiled contracts and ABIs
if: success()
run: |
mkdir -p release-artifacts
cp -r out release-artifacts
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: compiled-contracts
path: release-artifacts
release:
runs-on: ubuntu-latest
needs: artifacts
environment: release
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: "recursive"
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: compiled-contracts
path: ./release-artifacts
- name: Create Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: release-artifacts/**
generate_release_notes: true
draft: false
prerelease: false
token: ${{ secrets.RELEASE_TOKEN }}
registries:
runs-on: ubuntu-latest
needs: release
environment: release
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: "recursive"
- name: Get Latest Version
id: version
uses: pozetroninc/github-action-get-latest-release@master
with:
repository: ${{ github.repository }}
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.21.3'
- name: Setup Foundry
uses: foundry-rs/foundry-toolchain@v1
- name: Install ABIGen
run: |
go install github.com/ethereum/go-ethereum/cmd/abigen@v1.13.5
- uses: actions/setup-node@v4
with:
node-version: '22.3.0'
registry-url: 'https://registry.npmjs.org'
- name: Install Bun
uses: oven-sh/setup-bun@v2
# Ensure /v4 is updated as the major version changes
- name: Update Go Registry
run: |
GOPROXY=proxy.golang.org go list \
-m github.com/open-ibc/vibc-core-smart-contracts/v4@${{ steps.version.outputs.release }}
- name: Update NPM Registry
run: |
bun install --frozen-lockfile
bun run build
npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}