-
Notifications
You must be signed in to change notification settings - Fork 123
251 lines (244 loc) · 8.61 KB
/
release_build.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
244
245
246
247
248
249
250
251
name: Release Build
# Perform optimized/release builds, create a release, and attach build
# artifacts to the release when a version tag is pushed.
#
# The tag needs to be pushed by name, as `git push --tags` to push all
# tags does not appear to trigger the action.
#
# The versioned release process is similar to the following:
# 1. Add an annotated tag with the release version string.
# git tag -a v0.9.2
# 2. Draft a message for the annotated tag that is similar to the
# following. The body of this message will serve as the body of the
# release message that is specified when the release is created.
# Release v0.9.2
#
# Release Highlights
# - Brief description of new item 1.
# - Brief description of new item 2.
# 3. Push the tag to GitHub.
# git push origin v0.9.2
on:
push:
tags:
- v*
jobs:
linux:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- {
name: "Ubuntu GCC Release",
os: ubuntu-20.04,
artifact: "gfxreconstruct-ubuntu-gcc-release",
cc: "gcc", cxx: "g++"
}
steps:
- name: Clone repository
uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y libx11-xcb-dev libxcb-keysyms1-dev libwayland-dev libxrandr-dev liblz4-dev libzstd-dev
- name: Run build script
run: |
python3 scripts/build.py --skip-check-code-style --skip-tests --parallel 0
- name: Prepare artifacts
run: |
cp LICENSE.txt build/linux/x64/output/bin/
cp LICENSE_ThirdParty.txt build/linux/x64/output/bin/
cp USAGE_desktop_Vulkan.md build/linux/x64/output/bin/
cp layer/vk_layer_settings.txt build/linux/x64/output/bin/
mv build/linux/x64/output/bin gfxreconstruct-dev
mv build/linux/x64/output/lib*/*.so gfxreconstruct-dev/
mv build/linux/x64/output/share/vulkan/explicit_layer.d/*.json gfxreconstruct-dev/
- name: Upload artifacts
uses: actions/upload-artifact@v1
with:
name: ${{ matrix.config.artifact }}
path: ./gfxreconstruct-dev
windows:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- {
name: "Windows MSVC Release",
os: windows-latest,
artifact: "gfxreconstruct-windows-msvc-release",
cc: "cl", cxx: "cl"
}
steps:
- name: Clone repository
uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Run build script
run: |
python scripts\build.py --skip-check-code-style --skip-tests --parallel 0
- name: Prepare artifacts
run: |
copy LICENSE.txt build\windows\x64\output\bin\
copy LICENSE_ThirdParty.txt build\windows\x64\output\bin\
copy USAGE_desktop_D3D12.md build\windows\x64\output\bin\
copy USAGE_desktop_Vulkan.md build\windows\x64\output\bin\
copy layer\vk_layer_settings.txt build\windows\x64\output\bin\
move build\windows\x64\output\bin gfxreconstruct-dev
- name: Upload artifacts
uses: actions/upload-artifact@v1
with:
name: ${{ matrix.config.artifact }}
path: .\gfxreconstruct-dev
android:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- {
name: "Android Release/Debug",
os: ubuntu-latest,
artifact: "gfxreconstruct-android"
}
steps:
- name: Clone repository
uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Update submodules
run: |
git submodule update --init
- name: Gradle build
run: |
cd android
sh gradlew assembleRelease assembleDebug
- name: Prepare artifacts
run: |
mkdir gfxreconstruct-dev
mkdir gfxreconstruct-dev/layer
mkdir gfxreconstruct-dev/tools
cp LICENSE.txt gfxreconstruct-dev/
cp LICENSE_ThirdParty.txt gfxreconstruct-dev/
cp USAGE_android.md gfxreconstruct-dev/
cp layer/vk_layer_settings.txt gfxreconstruct-dev/
cp -r android/layer/build/intermediates/cmake/release/obj/arm64-v8a gfxreconstruct-dev/layer/
cp -r android/layer/build/intermediates/cmake/release/obj/armeabi-v7a gfxreconstruct-dev/layer/
cp android/tools/replay/build/outputs/apk/debug/replay-debug.apk gfxreconstruct-dev/tools/
cp android/scripts/gfxrecon.py gfxreconstruct-dev/tools/
- name: Upload artifacts
uses: actions/upload-artifact@v1
with:
name: ${{ matrix.config.artifact }}
path: ./gfxreconstruct-dev
release:
name: Create Release for Tag
runs-on: ubuntu-latest
needs: [ linux, windows, android ]
steps:
- name: Clone repository
uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Get tag body
id: get_tag_body
run: |
# Retrieve the body of the annotated tag's multi-line message and convert it to
# JSON, as an array of strings, with each line of the message as an array element.
tag_name=`echo "${{ github.ref }}" | cut -d "/" -f 3`
tag_body=`git tag -l --format='%(body)' "$tag_name"`
tag_body_json="["
while read -r line ; do tag_body_json+="\"${line}\"," ; done < <(echo "$tag_body")
tag_body_json="${tag_body_json::-1}]" # Replace the trailing ',' with ']'
echo "::set-output name=tag_body_json::$tag_body_json"
- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body: "${{ join(fromJson(steps.get_tag_body.outputs.tag_body_json), '\n') }}"
draft: false
prerelease: false
- name: Get release URL
run: |
echo "${{ steps.create_release.outputs.upload_url }}" > ./release_url
- name: Upload release URL
uses: actions/upload-artifact@v1
with:
name: release_url
path: ./release_url
publish:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
needs: release
strategy:
fail-fast: false
matrix:
config:
- {
name: "Upload Ubuntu Release Artifact",
os: ubuntu-latest,
artifact: "gfxreconstruct-ubuntu-gcc-release",
command: "tar czf",
suffix: "ubuntu-gcc.tar.gz",
type: "application/x-gtar"
}
- {
name: "Upload Windows Release Artifact",
os: ubuntu-latest,
artifact: "gfxreconstruct-windows-msvc-release",
command: "zip -r",
suffix: "windows-msvc.zip",
type: "application/zip"
}
- {
name: "Upload Android Release Artifact",
os: ubuntu-latest,
artifact: "gfxreconstruct-android",
command: "zip -r",
suffix: "android.zip",
type: "application/zip"
}
steps:
- name: Get tag name
id: get_tag_name
run: |
tag_name=`echo "${{ github.ref }}" | cut -d "/" -f 3`
echo "::set-output name=tag_name::$tag_name"
- name: Download artifacts
uses: actions/download-artifact@v1
with:
name: ${{ matrix.config.artifact }}
path: ./gfxreconstruct-${{ steps.get_tag_name.outputs.tag_name }}
- name: Make release artifacts
run: |
${{ matrix.config.command }} gfxreconstruct-${{ steps.get_tag_name.outputs.tag_name }}-${{ matrix.config.suffix }} gfxreconstruct-${{ steps.get_tag_name.outputs.tag_name }}
- name: Download release URL
uses: actions/download-artifact@v1
with:
name: release_url
path: ./
- name: Set upload URL
id: set_upload_url
run: |
upload_url=`cat ./release_url`
echo "::set-output name=upload_url::$upload_url"
- name: Upload release artifacts
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.set_upload_url.outputs.upload_url }}
asset_name: gfxreconstruct-${{ steps.get_tag_name.outputs.tag_name }}-${{ matrix.config.suffix }}
asset_path: ./gfxreconstruct-${{ steps.get_tag_name.outputs.tag_name }}-${{ matrix.config.suffix }}
asset_content_type: ${{ matrix.config.type }}