1818 name : ${{matrix.buildname}}
1919 runs-on : ${{matrix.os}}
2020 if : ${{ github.repository_owner == 'Mudlet' }}
21+ env :
22+ LUA_VERSION : ' 5.1.5'
2123 strategy :
2224 fail-fast : false
2325 matrix :
2830 # oldest OS supported for maximum compatibility of built AppImage
2931 - os : ubuntu-22.04
3032 buildname : ' ubuntu / gcc / lua tests'
31- triplet : x64-linux
3233 compiler : gcc_64
3334 gcc_compiler_version : 10
3435 qt : ' 6.9.0'
@@ -37,26 +38,22 @@ jobs:
3738 - os : ubuntu-22.04
3839 # Another try to use GCC12
3940 buildname : ' ubuntu (x86_64)'
40- triplet : x64-linux
4141 compiler : gcc_64
4242 gcc_compiler_version : 12
4343 qt : ' 6.9.0'
4444 - os : ubuntu-latest
4545 buildname : ' ubuntu / clang'
46- triplet : x64-linux
4746 compiler : clang_64
4847 gcc_compiler_version : 10
4948 qt : ' 6.9.0'
50- - os : macos-13
49+ - os : macos-15-intel
5150 buildname : ' macos (x86_64) / c++, lua tests'
52- triplet : x64-osx
5351 compiler : clang_64
5452 qt : ' 6.9.0'
5553 deploy : ' deploy'
5654 run_tests : ' true'
5755 - os : macos-14
5856 buildname : ' macos (arm64) / c++, lua tests'
59- triplet : arm64-osx
6057 compiler : clang_64
6158 qt : ' 6.9.0'
6259 deploy : ' deploy'
8481 if : runner.os == 'macOS'
8582 uses : leafo/gh-actions-lua@v12
8683 with :
87- luaVersion : " 5.1.5 "
84+ luaVersion : ${{ env.LUA_VERSION }}
8885 buildCache : false
8986
9087 - name : (macOS) Install Luarocks via GitHub Actions
@@ -100,39 +97,31 @@ jobs:
10097 HOMEBREW_NO_INSTALL_CLEANUP : " ON"
10198 run : |
10299 # Install all required dependencies
103- BREWS=("libzzip" "libzip" "ccache" "expect" "assimp" "hunspell" "pcre" "pugixml" "sqlite" "yajl" "boost")
104-
105- # Loop through each brew package
106- for brew in "${BREWS[@]}"; do
107- if ! brew list --formula "${brew}" &>/dev/null; then
108- echo "Installing ${brew}..."
109- brew install "$brew"
110- else
111- echo "${brew} is already installed."
112- fi
113- done
100+ brew install libzzip libzip ccache expect assimp hunspell pcre pugixml sqlite yajl boost
114101
115102 echo "CCACHE_DIR=${{runner.workspace}}/ccache" >> $GITHUB_ENV
116103
117104 # Use latest available XCode
118105 echo "DEVELOPER_DIR=$(xcode-select --print-path)" >> $GITHUB_ENV
119106 echo "SDKROOT=$(xcrun --sdk macosx --show-sdk-path)" >> $GITHUB_ENV
120107
108+ # Detect Homebrew prefix once (differs between x86_64 and ARM64)
109+ if [ "$(uname -m)" = "arm64" ]; then
110+ HOMEBREW_PREFIX=/opt/homebrew
111+ else
112+ HOMEBREW_PREFIX=/usr/local
113+ fi
114+ echo "HOMEBREW_PREFIX=$HOMEBREW_PREFIX" >> $GITHUB_ENV
115+
121116 # Help CMake find Lua installed by gh-actions-lua
122117 # The action installs to .lua/ and .luarocks/ in the runner home
123118 echo "LUA_DIR=$HOME/.lua" >> $GITHUB_ENV
124119
125120 # Help CMake find keg-only Homebrew packages (PCRE is keg-only on macOS)
126- echo "PKG_CONFIG_PATH=/usr/local /opt/pcre/lib/pkgconfig:$PKG_CONFIG_PATH" >> $GITHUB_ENV
121+ echo "PKG_CONFIG_PATH=${HOMEBREW_PREFIX} /opt/pcre/lib/pkgconfig:$PKG_CONFIG_PATH" >> $GITHUB_ENV
127122
128123 # Install lua-yajl early to generate translation statistics
129- # Detect Homebrew prefix (differs between x86_64 and ARM64)
130- if [ "$(uname -m)" = "arm64" ]; then
131- YAJL_PREFIX=/opt/homebrew/opt/yajl
132- else
133- YAJL_PREFIX=/usr/local/opt/yajl
134- fi
135- luarocks --lua-version 5.1 install --local lua-yajl YAJL_DIR=$YAJL_PREFIX
124+ luarocks --lua-version 5.1 install --local lua-yajl YAJL_DIR=${HOMEBREW_PREFIX}/opt/yajl
136125
137126 # Allow stats generation script to see location of lua-yajl
138127 eval "$(luarocks path --local --lua-version "5.1")"
@@ -143,7 +132,7 @@ jobs:
143132 uses : leafo/gh-actions-lua@v12
144133 if : runner.os == 'Linux'
145134 with :
146- luaVersion : " 5.1.5 "
135+ luaVersion : ${{ env.LUA_VERSION }}
147136 buildCache : false
148137
149138 - name : (Linux) Install Luarocks via GitHub Actions
@@ -158,8 +147,27 @@ jobs:
158147 # Install all required dependencies
159148 # imagemagick is for the desktop screenshot
160149 # liblua5.1-0-dev is needed for CMake to find Lua headers/library
161- sudo apt-get install libsecret-1-dev ccache pkg-config pcregrep expect libzip-dev libglu1-mesa-dev libpulse-dev g++-${{matrix.gcc_compiler_version}} \
162- libxkbcommon-x11-0 imagemagick libassimp-dev libpcre3-dev libpugixml-dev libsqlite3-dev libyajl-dev libhunspell-dev liblua5.1-0-dev libboost-dev -y
150+ sudo apt-get install \
151+ ccache \
152+ expect \
153+ g++-${{matrix.gcc_compiler_version}} \
154+ imagemagick \
155+ libassimp-dev \
156+ libboost-dev \
157+ libglu1-mesa-dev \
158+ libhunspell-dev \
159+ liblua5.1-0-dev \
160+ libpcre3-dev \
161+ libpulse-dev \
162+ libpugixml-dev \
163+ libsecret-1-dev \
164+ libsqlite3-dev \
165+ libxkbcommon-x11-0 \
166+ libyajl-dev \
167+ libzip-dev \
168+ pcregrep \
169+ pkg-config \
170+ -y
163171
164172 # switch to GCC that supports C++20 while retaining support for older OS's
165173 sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${{matrix.gcc_compiler_version}} ${{matrix.gcc_compiler_version}}
@@ -170,7 +178,7 @@ jobs:
170178 echo "CCACHE_DIR=${{runner.workspace}}/ccache" >> $GITHUB_ENV
171179
172180 # Install lua-yajl early to generate translation statistics
173- luarocks install --local lua-yajl
181+ luarocks --lua-version 5.1 install --local lua-yajl
174182
175183 # Allow stats generation script to see location of lua-yajl
176184 eval "$(luarocks path --local --lua-version "5.1")"
@@ -250,35 +258,27 @@ jobs:
250258 - name : install dependencies for packaging/tests
251259 if : matrix.deploy == 'deploy' || matrix.run_tests == 'true'
252260 run : |
253- luarocks --lua-version 5.1 install --local LuaFileSystem
254- luarocks --lua-version 5.1 install --local luautf8
261+ LUAROCKS="luarocks --lua-version 5.1 install --local"
262+
263+ $LUAROCKS LuaFileSystem
264+ $LUAROCKS luautf8
255265
256- # Detect paths for dependencies that need DIR hints on macOS
257266 if [ "$RUNNER_OS" = "macOS" ]; then
258- if [ "$(uname -m)" = "arm64" ]; then
259- ZIP_PREFIX=/opt/homebrew/opt/libzip
260- SQLITE_PREFIX=/opt/homebrew/opt/sqlite
261- PCRE_PREFIX=/opt/homebrew/opt/pcre
262- else
263- ZIP_PREFIX=/usr/local/opt/libzip
264- SQLITE_PREFIX=/usr/local/opt/sqlite
265- PCRE_PREFIX=/usr/local/opt/pcre
266- fi
267- luarocks --lua-version 5.1 install --local lua-zip ZIP_DIR=$ZIP_PREFIX
268- luarocks --lua-version 5.1 install --local LuaSQL-SQLite3 2.6.1 SQLITE_DIR=$SQLITE_PREFIX
269- luarocks --lua-version 5.1 install --local lrexlib-pcre PCRE_DIR=$PCRE_PREFIX
267+ $LUAROCKS lua-zip ZIP_DIR=${HOMEBREW_PREFIX}/opt/libzip
268+ $LUAROCKS LuaSQL-SQLite3 2.6.1 SQLITE_DIR=${HOMEBREW_PREFIX}/opt/sqlite
269+ $LUAROCKS lrexlib-pcre PCRE_DIR=${HOMEBREW_PREFIX}/opt/pcre
270270 else
271- luarocks --lua-version 5.1 install --local lua-zip
272- luarocks --lua-version 5.1 install --local LuaSQL-SQLite3 2.6.1
273- luarocks --lua-version 5.1 install --local lrexlib-pcre
271+ $LUAROCKS lua-zip
272+ $LUAROCKS LuaSQL-SQLite3 2.6.1
273+ $LUAROCKS lrexlib-pcre
274274 fi
275275
276276 # CI changelog generation dependencies
277- luarocks --lua-version 5.1 install --local argparse
278- luarocks --lua-version 5.1 install --local lunajson
277+ $LUAROCKS argparse
278+ $LUAROCKS lunajson
279279
280280 # Lua-based tests
281- luarocks --lua-version 5.1 install --local busted
281+ $LUAROCKS busted
282282
283283 # necessary for Qt multimedia and modern Qt
284284 # libfuse2 could be needed for linuxdeployqt on Ubuntu 22.04:
@@ -323,7 +323,6 @@ jobs:
323323 APPLE_USERNAME : ${{secrets.APPLE_USERNAME}}
324324 APPLE_PASSWORD : ${{secrets.APPLE_PASSWORD}}
325325 APPLE_TEAM_ID : ${{secrets.APPLE_TEAM_ID}}
326- TRIPLET : ${{matrix.triplet}}
327326
328327 - name : Upload packaged Mudlet
329328 uses : actions/upload-artifact@v5
0 commit comments