-
Notifications
You must be signed in to change notification settings - Fork 0
212 lines (174 loc) · 7.15 KB
/
release.yml
File metadata and controls
212 lines (174 loc) · 7.15 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
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
name: Release
on:
push:
tags:
- "v*"
permissions:
contents: write
env:
VULKAN_SDK_VERSION: 1.4.341.1
VULKAN_SDK_WINDOWS_SHA256: bcf2d75aa9556889ab974858666e20b3655b6055a0db704ccb47279ff33b5bfe
VULKAN_SDK_LINUX_SHA256: 17c8b7e872d8038fbd4e1239aa8483b495f862ad16b1c58644f7ecd8041d20cc
APPIMAGETOOL_VERSION: 1.9.0
APPIMAGETOOL_SHA256: 46fdd785094c7f6e545b61afcfb0f3d98d8eab243f644b4b17698c01d06083d1
jobs:
build-windows:
name: Windows MSVC
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Python
uses: actions/setup-python@v6
with:
python-version: "3.13"
cache: pip
cache-dependency-path: .github/workflows/release.yml
- name: Setup MSVC
uses: ilammy/msvc-dev-cmd@v1.13.0
- name: Cache Vulkan SDK
id: vulkan-cache-windows
uses: actions/cache@v5
with:
path: VULKAN_SDK
key: ${{ runner.os }}-vulkan-${{ env.VULKAN_SDK_VERSION }}
- name: Cache Meson Wrap Downloads
uses: actions/cache@v5
with:
path: subprojects/packagecache
key: ${{ runner.os }}-meson-wraps-${{ hashFiles('subprojects/*.wrap', 'subprojects/packagefiles/**') }}
- name: Install Vulkan SDK
if: steps.vulkan-cache-windows.outputs.cache-hit != 'true'
shell: pwsh
run: |
$version = '${{ env.VULKAN_SDK_VERSION }}'
$expectedHash = '${{ env.VULKAN_SDK_WINDOWS_SHA256 }}'
$sdkDir = Join-Path $PWD 'VULKAN_SDK'
$installer = Join-Path $PWD 'vulkan_sdk.exe'
Invoke-WebRequest -Uri "https://sdk.lunarg.com/sdk/download/$version/windows/vulkan_sdk.exe?Human=true" -OutFile $installer
$actualHash = (Get-FileHash $installer -Algorithm SHA256).Hash.ToLower()
if ($actualHash -ne $expectedHash) {
throw "Vulkan SDK hash mismatch: expected $expectedHash, got $actualHash"
}
Start-Process -FilePath $installer -ArgumentList @('--root', $sdkDir, '--accept-licenses', '--default-answer', '--confirm-command', 'install', 'copy_only=1') -Wait -NoNewWindow
- name: Set Vulkan SDK Environment
shell: pwsh
run: |
$sdkDir = Join-Path $PWD 'VULKAN_SDK'
"VULKAN_SDK=$sdkDir" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
"VK_SDK_PATH=$sdkDir" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
(Join-Path $sdkDir 'Bin') | Out-File -FilePath $env:GITHUB_PATH -Append -Encoding utf8
- name: Install Meson and Ninja
run: python -m pip install meson ninja
- name: Configure
run: meson setup build --buildtype=release -Db_vscrt=static_from_buildtype -Dvkrt_version='${{ github.ref_name }}'
- name: Build
run: meson compile -C build
- name: Test
run: ./build/vkrt.exe --help && ./build/vkrt.exe --version
shell: bash
- name: Package Windows Artifact
run: |
python scripts/stage_release.py windows . --zip
- name: Test Windows Package
shell: bash
run: ./vkrt-windows-x64/bin/vkrt.exe --help && ./vkrt-windows-x64/bin/vkrt.exe --version
- name: Upload Windows Release Asset
if: github.ref_type == 'tag'
uses: softprops/action-gh-release@v2.6.1
with:
files: vkrt-windows-x64.zip
- name: Upload Windows Artifact
uses: actions/upload-artifact@v6
with:
name: vkrt-windows-x64
path: vkrt-windows-x64.zip
build-linux:
name: Ubuntu Linux
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Python
uses: actions/setup-python@v6
with:
python-version: "3.13"
cache: pip
cache-dependency-path: .github/workflows/release.yml
- name: Cache Vulkan SDK
id: vulkan-cache-linux
uses: actions/cache@v5
with:
path: VULKAN_SDK
key: ${{ runner.os }}-vulkan-${{ env.VULKAN_SDK_VERSION }}
- name: Cache Meson Wrap Downloads
uses: actions/cache@v5
with:
path: subprojects/packagecache
key: ${{ runner.os }}-meson-wraps-${{ hashFiles('subprojects/*.wrap', 'subprojects/packagefiles/**') }}
- name: Cache AppImageTool
uses: actions/cache@v5
with:
path: appimagetool
key: ${{ runner.os }}-appimagetool-${{ env.APPIMAGETOOL_VERSION }}-${{ env.APPIMAGETOOL_SHA256 }}
- name: Install Vulkan SDK
if: steps.vulkan-cache-linux.outputs.cache-hit != 'true'
shell: bash
run: |
curl -fsSL "https://sdk.lunarg.com/sdk/download/${{ env.VULKAN_SDK_VERSION }}/linux/vulkan_sdk.tar.xz?Human=true" -o vulkan_sdk.tar.xz
echo "${{ env.VULKAN_SDK_LINUX_SHA256 }} vulkan_sdk.tar.xz" | sha256sum -c -
tar -xJf vulkan_sdk.tar.xz
mkdir -p VULKAN_SDK
cp -a "${{ env.VULKAN_SDK_VERSION }}/x86_64/." VULKAN_SDK/
- name: Set Vulkan SDK Environment
shell: bash
run: |
echo "VULKAN_SDK=$PWD/VULKAN_SDK" >> "$GITHUB_ENV"
echo "$PWD/VULKAN_SDK/bin" >> "$GITHUB_PATH"
- name: Install Linux Packages
run: |
sudo apt-get update
sudo apt-get install -y libdbus-1-dev libturbojpeg0-dev pkg-config libfuse2 desktop-file-utils libwayland-dev libxkbcommon-dev wayland-protocols libx11-dev libxrandr-dev libxinerama-dev libxi-dev libxcursor-dev libxext-dev
- name: Install Meson and Ninja
run: python -m pip install meson ninja
- name: Configure
run: meson setup build --buildtype=release -Dlinux_window_backend=both -Dnfd_backend=portal -Dvkrt_version='${{ github.ref_name }}'
- name: Build
run: meson compile -C build
- name: Test
run: ./build/vkrt --help && ./build/vkrt --version
- name: Package Linux Artifact
env:
APPIMAGETOOL_VERSION: ${{ env.APPIMAGETOOL_VERSION }}
APPIMAGETOOL_SHA256: ${{ env.APPIMAGETOOL_SHA256 }}
run: |
python scripts/build_appimage.py . --appimage
- name: Test Linux Package
run: ./vkrt-linux-x64/bin/vkrt --help && ./vkrt-linux-x64/bin/vkrt --version
- name: Test Linux Tarball
shell: bash
run: |
mkdir -p packaged-linux
tar -xzf vkrt-linux-x64.tar.gz -C packaged-linux
./packaged-linux/bin/vkrt --help
./packaged-linux/bin/vkrt --version
- name: Test AppImage
shell: bash
run: |
chmod +x vkrt-linux-x86_64.AppImage
./vkrt-linux-x86_64.AppImage --appimage-extract-and-run --help
./vkrt-linux-x86_64.AppImage --appimage-extract-and-run --version
- name: Upload Linux Release Assets
if: github.ref_type == 'tag'
uses: softprops/action-gh-release@v2.6.1
with:
files: |
vkrt-linux-x64.tar.gz
vkrt-linux-x86_64.AppImage
- name: Upload Linux Artifacts
uses: actions/upload-artifact@v6
with:
name: vkrt-linux-x64
path: |
vkrt-linux-x64.tar.gz
vkrt-linux-x86_64.AppImage