-
-
Notifications
You must be signed in to change notification settings - Fork 72
153 lines (120 loc) · 4.99 KB
/
Copy pathbuild.yml
File metadata and controls
153 lines (120 loc) · 4.99 KB
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
name: Release build
on:
push:
branches:
- not-release/**
jobs:
linux:
name: Build Binary on Linux
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Install rust stable toolchain
run: rustup toolchain install stable --profile minimal --no-self-update
- name: Run cargo build
run: cargo build --bins --release --locked
- name: Split and archive debug info
run: |
mkdir -p build
# Split only symbolicator's debug information
objcopy --only-keep-debug target/release/symbolicator{,.debug}
objcopy --strip-debug --strip-unneeded target/release/symbolicator
objcopy --add-gnu-debuglink target/release/symbolicator{.debug,}
zip -j build/symbolicator-Linux-x86_64-debug.zip target/release/symbolicator.debug
# Strip debug info for tools
objcopy --strip-debug --strip-unneeded target/release/wasm-split
objcopy --strip-debug --strip-unneeded target/release/symsorter
# Move all binaries
mv target/release/symbolicator build/symbolicator-Linux-x86_64
mv target/release/wasm-split build/wasm-split-Linux-x86_64
mv target/release/symsorter build/symsorter-Linux-x86_64
- uses: actions/upload-artifact@v3.1.1
with:
name: ${{ github.sha }}
path: build/*
mac:
# Note: This doesn't use a build matrix, as it requires a last step to merge the x86
# and ARM binaries into one universal one. This need will go away once
# https://github.com/rust-lang/cargo/issues/8875 is resolved.
name: Build Binary on MacOS
runs-on: macos-11
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Install rust stable toolchain
run: rustup toolchain install stable --profile minimal --target x86_64-apple-darwin --target aarch64-apple-darwin --no-self-update
- name: Run cargo build for x86_64
run: cargo build --bins --release --locked --target=x86_64-apple-darwin
env:
# Generates separate debug symbol files alongside release builds
CARGO_PROFILE_RELEASE_SPLIT_DEBUGINFO: packed
- name: Run cargo build for ARM
run: cargo build --bins --release --locked --target=aarch64-apple-darwin
env:
# Generates separate debug symbol files alongside release builds
CARGO_PROFILE_RELEASE_SPLIT_DEBUGINFO: packed
- name: Archive debug info and create universal binary
run: |
mkdir -p build
lipo -create -output build/symbolicator-Darwin-universal \
target/x86_64-apple-darwin/release/symbolicator \
target/aarch64-apple-darwin/release/symbolicator
lipo -create -output build/wasm-split-Darwin-universal \
target/x86_64-apple-darwin/release/wasm-split \
target/aarch64-apple-darwin/release/wasm-split
lipo -create -output build/symsorter-Darwin-universal \
target/x86_64-apple-darwin/release/symsorter \
target/aarch64-apple-darwin/release/symsorter
cd target/x86_64-apple-darwin/release
# Recursive zip the debug symbol folder and place the output in the output directory
zip -r ../../../build/symbolicator-x86_64-apple-darwin-debug.zip symbolicator.dSYM
cd ../../../
cd target/x86_64-apple-darwin/release
zip -r ../../../build/symbolicator-aarch64-apple-darwin-debug.zip symbolicator.dSYM
- uses: actions/upload-artifact@v3.1.1
with:
name: ${{ github.sha }}
path: build/*
windows:
name: Build Tools on Windows
runs-on: windows-2019
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Install rust stable toolchain
run: rustup toolchain install stable --profile minimal --no-self-update
- name: Run cargo build
run: cargo build --bins --release --locked
- name: Rename Binaries
run: |
cd target/release
mv symbolicator.exe symbolicator-Windows-x86_64.exe
mv symsorter.exe symsorter-Windows-x86_64.exe
mv wasm-split.exe wasm-split-Windows-x86_64.exe
- uses: actions/upload-artifact@v3.1.1
with:
name: ${{ github.sha }}
path: target/release/*-Windows-x86_64.exe
docs:
name: Build Docs
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Setup python dependencies
run: pip install --upgrade mkdocs mkdocs-material pygments
- name: Build Docs
run: |
mkdocs build
touch site/.nojekyll
cd site && zip -r gh-pages .
- uses: actions/upload-artifact@v3.1.1
with:
name: ${{ github.sha }}
path: site/gh-pages.zip