-
Notifications
You must be signed in to change notification settings - Fork 221
173 lines (165 loc) · 5.65 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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
on:
push:
tags:
- 'v*'
name: Build Release Binaries
jobs:
linux-x86-64:
name: Linux x86-64
runs-on: solang-ubuntu-latest
container: ghcr.io/hyperledger/solang-llvm:ci-6
steps:
- name: Checkout sources
uses: actions/[email protected]
with:
submodules: recursive
- name: Rust stable
run: rustup default 1.72.0
- name: Build
run: cargo build --verbose --release
- name: Run tests
run: cargo test --workspace --verbose --release
- name: Upload binary
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: target/release/solang
asset_name: solang-linux-x86-64
tag: ${{ github.ref }}
linux-arm64:
name: Linux arm64
runs-on: linux-arm64
if: ${{ github.repository_owner == 'hyperledger' }}
container: ghcr.io/hyperledger/solang-llvm:ci-6
steps:
- name: Checkout sources
uses: actions/[email protected]
with:
submodules: recursive
- name: Rust stable
run: rustup default 1.72.0
- name: Build
run: cargo build --verbose --release
- name: Run tests
run: cargo test --workspace --verbose --release
- name: Upload binary
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: target/release/solang
asset_name: solang-linux-arm64
tag: ${{ github.ref }}
windows:
name: Windows
runs-on: windows-latest
steps:
- name: Checkout sources
uses: actions/checkout@v3
with:
submodules: recursive
- name: Download LLVM
run: curl -sSL -o c:\llvm.zip https://github.com/hyperledger/solang-llvm/releases/download/llvm15-1/llvm15.0-win.zip
- name: Extract LLVM
run: unzip c:\llvm.zip -d c:/
- name: Add LLVM to Path
run: echo "c:\llvm15.0\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8
- uses: dtolnay/[email protected]
with:
components: clippy
- name: Build
run: cargo build --release --verbose
- name: Run tests
run: cargo test --workspace --release --verbose
- name: Upload binary
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: target/release/solang.exe
asset_name: solang.exe
tag: ${{ github.ref }}
mac-arm:
name: Mac Arm
runs-on: macos-13-xlarge
steps:
- name: Checkout sources
uses: actions/checkout@v3
with:
submodules: recursive
- uses: dtolnay/[email protected]
- name: Get LLVM
run: curl -sSL --output llvm15.0-mac-arm.tar.xz https://github.com/hyperledger/solang-llvm/releases/download/llvm15-1/llvm15.0-mac-arm.tar.xz
- name: Extract LLVM
run: tar Jxf llvm15.0-mac-arm.tar.xz
- name: Add LLVM to Path
run: echo "$(pwd)/llvm15.0/bin" >> $GITHUB_PATH
- name: Build
run: cargo build --release --verbose
- name: Run tests
run: cargo test --workspace --release --verbose
- name: Upload binary
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: target/release/solang
asset_name: solang-mac-arm
tag: ${{ github.ref }}
mac-intel:
name: Mac Intel
# The Hyperledger self-hosted intel macs have the label macos-latest
# and run macos 12. We don't want to build llvm on macos 12, because
# then it can't be used on macos 11.
runs-on: macos-11
steps:
- name: Checkout sources
uses: actions/checkout@v3
with:
submodules: recursive
- uses: dtolnay/[email protected]
- name: Get LLVM
run: wget -q -O llvm15.0-mac-intel.tar.xz https://github.com/hyperledger/solang-llvm/releases/download/llvm15-1/llvm15.0-mac-intel.tar.xz
- name: Extract LLVM
run: tar Jxf llvm15.0-mac-intel.tar.xz
- name: Add LLVM to Path
run: echo "$(pwd)/llvm15.0/bin" >> $GITHUB_PATH
- name: Build
run: cargo build --release --verbose
- name: Run tests
run: cargo test --workspace --release --verbose
- name: Upload binary
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: target/release/solang
asset_name: solang-mac-intel
tag: ${{ github.ref }}
mac-universal:
name: Mac Universal Binary
runs-on: macos-latest
needs: [mac-arm, mac-intel]
steps:
- run: |
curl -sSL --output solang-mac-intel https://github.com/hyperledger/solang/releases/download/${GITHUB_REF/refs\/tags\//}/solang-mac-intel
curl -sSL --output solang-mac-arm https://github.com/hyperledger/solang/releases/download/${GITHUB_REF/refs\/tags\//}/solang-mac-arm
lipo -create -output solang-mac solang-mac-intel solang-mac-arm
- name: Upload binary
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: solang-mac
asset_name: solang-mac
tag: ${{ github.ref }}
container-multiarch:
name: Multiarch Container Image
runs-on: linux-arm64
if: ${{ github.repository_owner == 'hyperledger' }}
steps:
- name: Checkout sources
uses: actions/checkout@v3
- run: |
echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u $GITHUB_ACTOR --password-stdin
docker buildx build . \
--push \
--provenance=false \
--tag ghcr.io/${GITHUB_REPOSITORY}:${GITHUB_REF/refs\/tags\//} \
--platform linux/arm64,linux/amd64 \
--label org.opencontainers.image.description="Solidity Compiler for Solana and Substrate version $(git describe --tags)"