-
Notifications
You must be signed in to change notification settings - Fork 18
135 lines (117 loc) · 4.04 KB
/
build-release.yaml
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
123
124
125
126
127
128
129
130
131
132
133
134
135
name: Build and release
on:
workflow_dispatch:
pull_request:
push:
tags:
- "**"
concurrency:
group: ${{ github.repository_id }}-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
setup:
runs-on: ubuntu-latest
outputs:
solc-version: ${{ steps.set.outputs.solc-version }}
zksync-version: ${{ steps.set.outputs.zksync-version }}
skip-windows: ${{ steps.check-version.outputs.result }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Define release version
shell: bash
id: set
run: |
if [[ ${{ github.event_name }} != 'pull_request' ]]; then
echo "zksync-version=$(cut -d "-" -f2 <<< ${GITHUB_REF#refs/*/})" | tee -a "${GITHUB_OUTPUT}"
else
echo "zksync-version=1.0.${{ github.run_id }}" | tee -a "${GITHUB_OUTPUT}"
fi
SOLC_VERSION=$(grep 'PROJECT_VERSION' CMakeLists.txt | grep -oP '(\d+\.\d+\.\d+)')
echo "solc-version=${SOLC_VERSION}" | tee -a "${GITHUB_OUTPUT}"
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install semver
run: npm install semver
- name: Check that version is >= 0.6.0
id: check-version
uses: actions/github-script@v7
with:
script: |
const semver = require('semver');
const currentVersion = '${{ steps.set.outputs.solc-version }}';
const result = semver.lt(currentVersion, '0.6.0');
console.log(`Is the version < 0.6.0? ${result}`);
return result;
result-encoding: string
build:
needs: setup
strategy:
fail-fast: false
matrix:
include:
- name: "MacOS x86"
runner: macos-12-large
release-suffix: macosx-amd64
- name: "MacOS arm64"
runner: [self-hosted, macOS, ARM64]
release-suffix: macosx-arm64
- name: "Linux x86"
runner: matterlabs-ci-runner-high-performance
image: matterlabs/llvm_runner:ubuntu20-llvm17-latest
release-suffix: linux-amd64
- name: "Linux ARM64"
runner: matterlabs-ci-runner-arm
image: matterlabs/llvm_runner:ubuntu20-llvm17-latest
release-suffix: linux-arm64
- name: Windows
runner: windows-2019-github-hosted-64core
release-suffix: windows-amd64
runs-on: ${{ matrix.runner }}
container:
image: ${{ matrix.image || '' }}
name: ${{ matrix.name }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Prepare Windows env
if: runner.os == 'Windows'
uses: matter-labs/era-compiler-ci/.github/actions/prepare-msys@v1
- name: Building the Solidity compiler
uses: matter-labs/era-compiler-ci/.github/actions/build-solc@v1
with:
release-suffix: ${{ matrix.release-suffix }}
zksync-version: ${{ needs.setup.outputs.zksync-version }}
solc-version: ${{ needs.setup.outputs.solc-version }}
boost-version: 1.74.0
release:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
needs: build
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Download artifacts
uses: actions/download-artifact@v4
with:
pattern: release*
path: releases
- name: Generate changelog
shell: bash
run: awk '/###/ {flag=!flag; if (seen++) exit; next} flag' ./Changelog.md > release-changelog.txt
- name: Prepare release
uses: softprops/action-gh-release@v2
with:
generate_release_notes: false
name: ZKsync solc ${{ github.ref_name }}
body_path: release-changelog.txt
tag_name: ${{ github.ref_name }}
files: releases/**/**