-
Notifications
You must be signed in to change notification settings - Fork 659
243 lines (209 loc) · 7 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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
name: Leo Release
on:
push:
tags:
- 'v*.*.*'
workflow_dispatch:
env:
RUST_BACKTRACE: 1
jobs:
ubuntu:
name: Ubuntu
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt
- name: Build Leo
run: |
cargo build --package leo-lang --release --features noconfig && strip target/release/leo
env:
CARGO_NET_GIT_FETCH_WITH_CLI: true
- id: get_version
uses: battila7/get-version-action@v2
- name: Zip
run: |
mkdir tempdir
mv target/release/leo tempdir
cd tempdir
zip -r leo-${{ steps.get_version.outputs.version }}-x86_64-unknown-linux-gnu.zip leo
cd ..
mv tempdir/leo-${{ steps.get_version.outputs.version }}-x86_64-unknown-linux-gnu.zip .
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
leo-${{ steps.get_version.outputs.version }}-x86_64-unknown-linux-gnu.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
linux-musl:
name: Linux musl
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt
target: x86_64-unknown-linux-musl
default: stable-x86_64-unknown-linux-musl
- name: Build
run: |
docker pull clux/muslrust:stable
docker run -v cargo-cache:/root/.cargo/registry -v $PWD:/volume --rm -t clux/muslrust:stable cargo build --target x86_64-unknown-linux-musl --package leo-lang --release --features noconfig && ldd target/x86_64-unknown-linux-musl/release/leo
- id: get_version
uses: battila7/get-version-action@v2
- name: Zip
run: |
mkdir tempdir
cp target/x86_64-unknown-linux-musl/release/leo tempdir
strip tempdir/leo
cd tempdir
zip -r leo-${{ steps.get_version.outputs.version }}-x86_64-unknown-linux-musl.zip leo
cd ..
mv tempdir/leo-${{ steps.get_version.outputs.version }}-x86_64-unknown-linux-musl.zip .
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
leo-${{ steps.get_version.outputs.version }}-x86_64-unknown-linux-musl.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
macos:
name: macOS
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt
- name: Build Leo
run: |
cargo build --package leo-lang --release && strip target/release/leo
env:
CARGO_NET_GIT_FETCH_WITH_CLI: true
- id: get_version
uses: battila7/get-version-action@v2
- name: Zip
run: |
mkdir tempdir
mv target/release/leo tempdir
cd tempdir
zip -r leo-${{ steps.get_version.outputs.version }}-x86_64-apple-darwin.zip leo
cd ..
mv tempdir/leo-${{ steps.get_version.outputs.version }}-x86_64-apple-darwin.zip .
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
leo-${{ steps.get_version.outputs.version }}-x86_64-apple-darwin.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
macos_m1:
name: macOS M1
runs-on: macos-latest
steps:
- name: Xcode Select
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
- name: Checkout
uses: actions/checkout@v2
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
target: aarch64-apple-darwin
toolchain: stable
override: true
components: rustfmt
- name: Build Leo
run: |
SDKROOT=$(xcrun -sdk macosx11.1 --show-sdk-path) \
MACOSX_DEPLOYMENT_TARGET=$(xcrun -sdk macosx11.1 --show-sdk-platform-version) \
cargo build -p leo-lang --release --target=aarch64-apple-darwin --features noconfig && strip target/aarch64-apple-darwin/release/leo
env:
CARGO_NET_GIT_FETCH_WITH_CLI: true
- id: get_version
uses: battila7/get-version-action@v2
- name: Zip
run: |
mkdir tempdir
mv target/aarch64-apple-darwin/release/leo tempdir
cd tempdir
zip -r leo.zip leo
cp leo.zip leo-${{ steps.get_version.outputs.version }}-aarch64-apple-darwin.zip
cd ..
mv tempdir/leo-${{ steps.get_version.outputs.version }}-aarch64-apple-darwin.zip .
mv tempdir/leo.zip .
- name: Release macos m1 version
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
leo-${{ steps.get_version.outputs.version }}-aarch64-apple-darwin.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Release leo.zip
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
leo.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
windows:
name: Windows
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt
- name: Install LLVM and Clang
uses: KyleMayes/install-llvm-action@v1
with:
version: "11"
directory: ${{ runner.temp }}/llvm
- name: Set LIBCLANG_PATH
run: echo "LIBCLANG_PATH=$((gcm clang).source -replace "clang.exe")" >> $env:GITHUB_ENV
- name: Build Leo
run: |
cargo build --package leo-lang --release --features noconfig
env:
CARGO_NET_GIT_FETCH_WITH_CLI: true
- id: get_version
uses: battila7/get-version-action@v2
- name: Zip
run: |
Compress-Archive target/release/leo.exe leo-${{ steps.get_version.outputs.version }}-x86_64-pc-windows-msvc.zip
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
leo-${{ steps.get_version.outputs.version }}-x86_64-pc-windows-msvc.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}