-
Notifications
You must be signed in to change notification settings - Fork 229
229 lines (196 loc) · 6.63 KB
/
tagged-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
name: "Tagged Release"
on:
push:
tags:
- "*"
env:
CARGO_TERM_COLOR: always
jobs:
create-release:
name: Create Release
runs-on: ubuntu-20.04
steps:
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
body: |
- `viewsvg` is a simple application that showcases *resvg* capabilities
- `resvg-0.*.0.tar.xz` is a sources archive with vendored Rust dependencies
- `resvg-explorer-extension.exe` is an SVG thumbnailer for Windows Explorer
draft: false
prerelease: false
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
release-linux:
name: Release Linux
runs-on: ubuntu-20.04
needs: ["create-release"]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Build resvg
run: cargo build --release
- name: Build usvg
working-directory: crates/usvg
run: cargo build --release
- name: Collect
working-directory: target/release
run: |
strip -s resvg
strip -s usvg
tar czf resvg-linux-x86_64.tar.gz resvg
tar czf usvg-linux-x86_64.tar.gz usvg
mkdir ../../bin
cp resvg-linux-x86_64.tar.gz ../../bin/
cp usvg-linux-x86_64.tar.gz ../../bin/
- name: Get version
id: get_version
uses: battila7/get-version-action@v2
- name: Make vendored archive
run: |
VERSION=${{ steps.get_version.outputs.version-without-v }}
echo $VERSION
git clone https://github.com/RazrFalcon/resvg resvg-$VERSION
cd resvg-"$VERSION"
mkdir -p .cargo
cargo vendor > .cargo/config
cd ..
env XZ_OPT="-9e" tar \
--exclude=".git" \
--exclude=".gitignore" \
--exclude="resvg-$VERSION/.github" \
--exclude="resvg-$VERSION/version-bump.md" \
--exclude="resvg-$VERSION/docs" \
-cJf resvg-"$VERSION".tar.xz resvg-"$VERSION"
cp resvg-"$VERSION".tar.xz bin/
- name: Upload binaries
uses: alexellis/upload-assets@0.2.2
env:
GITHUB_TOKEN: ${{ github.token }}
with:
asset_paths: '["bin/*"]'
release-windows:
name: Release Windows
runs-on: windows-2019
needs: ["create-release"]
steps:
- name: Checkout
uses: actions/checkout@v2
# Toolchain is stable-x86_64-pc-windows-msvc by default. No need to change it.
- name: Build resvg
env:
RUSTFLAGS: -Ctarget-feature=+crt-static # make sure it's static
run: cargo build --release
- name: Build usvg
working-directory: crates/usvg
env:
RUSTFLAGS: -Ctarget-feature=+crt-static # make sure it's static
run: cargo build --release
- name: Compress
working-directory: target/release
shell: cmd
run: |
7z a -tzip -mx9 resvg-win64.zip resvg.exe
7z a -tzip -mx9 usvg-win64.zip usvg.exe
- name: Build thumbnailer
working-directory: tools/explorer-thumbnailer
env:
RUSTFLAGS: -Ctarget-feature=+crt-static # make sure it's static
run: cargo build --release
- name: Build thumbnailer installer
working-directory: tools/explorer-thumbnailer/install
shell: cmd
run: |
"%programfiles(x86)%\Inno Setup 6\iscc.exe" "installer.iss"
- name: Install Qt
uses: jurplel/install-qt-action@v2
with:
version: '5.15.2'
# Unlike other binaries, viewsvg isn't built with crt-static
- name: Build C API
working-directory: crates/c-api
run: cargo build --release
- name: Prepare Developer Command Prompt for MSVC
uses: ilammy/msvc-dev-cmd@v1
- name: Build viewsvg
working-directory: tools/viewsvg
run: |
qmake
nmake
mkdir viewsvg-bin
cp release/viewsvg.exe viewsvg-bin/viewsvg.exe
windeployqt --no-translations viewsvg-bin/viewsvg.exe
del viewsvg-bin/libGLESv2.dll
del viewsvg-bin/libEGL.dll
del viewsvg-bin/d3dcompiler_47.dll
del viewsvg-bin/opengl32sw.dll
Remove-Item "viewsvg-bin/iconengines" -Recurse
Remove-Item "viewsvg-bin/imageformats" -Recurse
cd viewsvg-bin
7z a -tzip -mx9 viewsvg-win64.zip *
- name: Collect
run: |
mkdir bin
cp target/release/resvg-win64.zip bin/
cp target/release/usvg-win64.zip bin/
cp tools/explorer-thumbnailer/install/resvg-explorer-extension.exe bin/
cp tools/viewsvg/viewsvg-bin/viewsvg-win64.zip bin/
- name: Upload binaries
uses: alexellis/upload-assets@0.2.2
env:
GITHUB_TOKEN: ${{ github.token }}
with:
asset_paths: '["bin/*"]'
release-macos:
name: Release macOS
runs-on: macos-latest
needs: ["create-release"]
steps:
- name: Checkout
uses: actions/checkout@v2
# Some weird CI glitch. Make sure we have the latest Rust.
- name: Install latest stable toolchain
uses: dtolnay/rust-toolchain@stable
- name: Build resvg
run: cargo build --release
- name: Build usvg
working-directory: crates/usvg
run: cargo build --release
- name: Compress
working-directory: target/release
run: |
7z a -tzip -mx9 resvg-macos-x86_64.zip resvg
7z a -tzip -mx9 usvg-macos-x86_64.zip usvg
- name: Build C API
working-directory: crates/c-api
run: cargo build --release
- name: Install Qt
uses: jurplel/install-qt-action@v2
with:
version: '5.15.2'
- name: Build viewsvg
working-directory: tools/viewsvg
run: |
qmake
make
macdeployqt viewsvg.app
rm -r viewsvg.app/Contents/Plugins/iconengines
rm -r viewsvg.app/Contents/Plugins/imageformats
7z a -tzip -mx9 viewsvg-macos-x86_64.zip viewsvg.app
- name: Collect
run: |
mkdir bin
cp target/release/resvg-macos-x86_64.zip bin/
cp target/release/usvg-macos-x86_64.zip bin/
cp tools/viewsvg/viewsvg-macos-x86_64.zip bin/
- name: Upload binaries
uses: alexellis/upload-assets@0.2.2
env:
GITHUB_TOKEN: ${{ github.token }}
with:
asset_paths: '["bin/*"]'