Skip to content

Commit 9ed67c4

Browse files
committed
ci: use runner.os for generic OS detection
Use the built-in runner.os context variable when we only need to identify the category and do not care about the specific image used under the category.
1 parent 0acb746 commit 9ed67c4

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

.github/workflows/ci.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -100,13 +100,13 @@ jobs:
100100
pip install meson
101101
102102
- name: Setup MSVC
103-
if: startsWith(matrix.config.os, 'windows-') && matrix.config.msvc == true
103+
if: runner.os == 'Windows' && matrix.config.msvc == true
104104
uses: ilammy/msvc-dev-cmd@v1
105105
with:
106106
arch: ${{ matrix.config.arch }}
107107

108108
- name: Install dependencies (Windows)
109-
if: startsWith(matrix.config.os, 'windows-')
109+
if: runner.os == 'Windows'
110110
run: |
111111
choco install ninja innosetup
112112
@@ -126,7 +126,7 @@ jobs:
126126
popd
127127
128128
- name: Install dependencies (MacOS)
129-
if: startsWith(matrix.config.os, 'macos-')
129+
if: runner.os == 'macOS'
130130
run: |
131131
export HOMEBREW_NO_INSTALL_CLEANUP=1
132132
export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1
@@ -137,7 +137,7 @@ jobs:
137137
brew install pulseaudio # NO OpenAL in github CI
138138
139139
- name: Install dependencies (Linux)
140-
if: startsWith(matrix.config.os, 'ubuntu-')
140+
if: runner.os == 'Linux'
141141
run: |
142142
sudo apt-get update
143143
sudo apt-get install ninja-build build-essential libx11-dev libfreetype6-dev pkg-config libfontconfig1-dev libass-dev libasound2-dev libffms2-dev intltool libboost-all-dev libhunspell-dev libcurl4-openssl-dev libuchardet-dev libgtest-dev libgmock-dev libwxgtk3.2-dev
@@ -165,49 +165,49 @@ jobs:
165165

166166
# Windows artifacts
167167
- name: Generate Windows installer
168-
if: startsWith(matrix.config.os, 'windows-')
168+
if: runner.os == 'Windows'
169169
env:
170170
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
171171
run:
172172
meson compile win-installer -C build
173173

174174
- name: Generate Windows portable installer
175-
if: startsWith(matrix.config.os, 'windows-')
175+
if: runner.os == 'Windows'
176176
run: cd build && ninja win-portable
177177

178178
- name: Upload artifacts - win_installer
179179
uses: actions/upload-artifact@v4
180-
if: startsWith(matrix.config.os, 'windows-')
180+
if: runner.os == 'Windows'
181181
with:
182182
name: ${{ matrix.config.name }} - installer
183183
path: build/Aegisub-*.exe
184184
if-no-files-found: error
185185

186186
- name: Upload artifacts - portable.zip
187187
uses: actions/upload-artifact@v4
188-
if: startsWith(matrix.config.os, 'windows-')
188+
if: runner.os == 'Windows'
189189
with:
190190
name: ${{ matrix.config.name }} - portable
191191
path: build/aegisub-portable-64.zip
192192

193193
# macOS artifacts
194194
- name: Generate macOS installer
195-
if: startsWith(matrix.config.os, 'macos-')
195+
if: runner.os == 'macOS'
196196
run: |
197197
meson compile osx-bundle -C build
198198
meson compile osx-build-dmg -C build
199199
200200
- name: Upload artifacts - macOS dmg
201201
uses: actions/upload-artifact@v4
202-
if: startsWith(matrix.config.os, 'macos-')
202+
if: runner.os == 'macOS'
203203
with:
204204
name: ${{ matrix.config.name }} - installer
205205
path: build/Aegisub-*.dmg
206206
if-no-files-found: error
207207

208208
# Tarball
209209
- name: Generate tarball
210-
if: matrix.config.os == 'ubuntu-latest' && matrix.config.buildtype == 'release'
210+
if: runner.os == 'Linux' && matrix.config.buildtype == 'release'
211211
run: |
212212
set -e
213213
@@ -221,7 +221,7 @@ jobs:
221221
222222
- name: Upload artifacts - tarball
223223
uses: actions/upload-artifact@v4
224-
if: matrix.config.os == 'ubuntu-latest' && matrix.config.buildtype == 'release'
224+
if: runner.os == 'Linux' && matrix.config.buildtype == 'release'
225225
with:
226226
name: Source Tarball
227227
path: build/meson-dist/*.tar.xz

0 commit comments

Comments
 (0)