MSVC test build #1156
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: [push, pull_request] | |
jobs: | |
build-windows-msvc: | |
name: Build Windows MSVC | |
runs-on: windows-2022 | |
strategy: | |
fail-fast: false | |
matrix: | |
arch: [ 'x86', 'x86_64' ] | |
buildtype: [ 'debug', 'release' ] | |
steps: | |
- name: Set prefix path | |
shell: bash | |
run: | | |
echo "prefix_path_backslash=c:\strawberry_msvc_${{matrix.arch}}_${{matrix.buildtype}}" >> $GITHUB_ENV | |
echo "prefix_path_forwardslash=c:/strawberry_msvc_${{matrix.arch}}_${{matrix.buildtype}}" >> $GITHUB_ENV | |
echo "prefix_path_unix=/c/strawberry_msvc_${{matrix.arch}}_${{matrix.buildtype}}" >> $GITHUB_ENV | |
- name: Set cmake buildtype | |
shell: bash | |
run: echo "cmake_buildtype=$(echo ${{matrix.buildtype}} | sed 's/.*/\u&/')" >> $GITHUB_ENV | |
- name: Create downloads directory | |
shell: cmd | |
run: mkdir downloads | |
- name: Download Windows MSVC dependencies | |
shell: cmd | |
working-directory: downloads | |
run: curl -f -O -L https://github.com/strawberrymusicplayer/strawberry-msvc-dependencies/releases/latest/download/strawberry-msvc-${{matrix.arch}}-${{matrix.buildtype}}.tar.xz | |
- name: Extract Windows MSVC dependencies | |
shell: bash | |
working-directory: downloads | |
run: tar -C /c -xf strawberry-msvc-${{matrix.arch}}-${{matrix.buildtype}}.tar.xz | |
- name: Update PATH | |
run: echo "${{env.prefix_path_backslash}}\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append | |
- name: Copy bin files | |
shell: bash | |
run: cp /c/strawberry/c/bin/{patch.exe,strip.exe,strings.exe,objdump.exe} ${{env.prefix_path_unix}}/bin | |
- name: List installed packages | |
shell: cmd | |
run: choco list | |
- name: Uninstall conflicting mingw | |
shell: cmd | |
run: choco uninstall mingw -y -f | |
- name: Delete conflicting files | |
shell: bash | |
run: rm -rf /c/strawberry/c "/c/program files/OpenSSL" "/c/program files/postgresql" | |
- name: Delete conflicting icu | |
shell: bash | |
run: | | |
find "/c/program files (x86)/windows kits/" -iname 'icu*.lib' -delete | |
find "/c/program files (x86)/windows kits/" -iname 'icu*.h' -delete | |
- name: Download NSIS LockedList plugin | |
shell: cmd | |
working-directory: downloads | |
run: curl -f -O -L https://nsis.sourceforge.io/mediawiki/images/d/d3/LockedList.zip | |
- name: Extract NSIS LockedList plugin | |
shell: cmd | |
working-directory: downloads | |
run: 7z x LockedList.zip | |
- name: Download NSIS Registry plugin | |
shell: cmd | |
working-directory: downloads | |
run: curl -f -O -L https://nsis.sourceforge.io/mediawiki/images/4/47/Registry.zip | |
- name: Extract NSIS Registry plugin | |
shell: cmd | |
working-directory: downloads | |
run: 7z x Registry.zip | |
- name: Download NSIS Inetc plugin | |
shell: cmd | |
working-directory: downloads | |
run: curl -f -O -L https://nsis.sourceforge.io/mediawiki/images/c/c9/Inetc.zip | |
- name: Extract NSIS Inetc plugin | |
shell: cmd | |
working-directory: downloads | |
run: 7z x Inetc.zip | |
- name: Install NSIS plugins | |
shell: cmd | |
working-directory: downloads | |
run: | | |
copy "Plugins\LockedList64.dll" "C:\Program Files (x86)\NSIS\Plugins\" | |
copy "Plugins\x86-unicode\LockedList.dll" "C:\Program Files (x86)\NSIS\Plugins\x86-unicode\" | |
copy "Desktop\Plugin\registry.dll" "C:\Program Files (x86)\NSIS\Plugins\" | |
copy "Desktop\Plugin\registry.dll" "C:\Program Files (x86)\NSIS\Plugins\x86-unicode\" | |
copy "Plugins\x86-unicode\INetC.dll" "C:\Program Files (x86)\NSIS\Plugins\x86-unicode\" | |
- name: Setup MSVC Environment | |
uses: ilammy/msvc-dev-cmd@v1 | |
with: | |
arch: ${{matrix.arch}} | |
sdk: 10.0.20348.0 | |
vsversion: 17 | |
toolset: 14.3 | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Add safe git directory | |
shell: bash | |
run: git config --global --add safe.directory ${GITHUB_WORKSPACE} | |
- name: Create Build Environment | |
shell: cmd | |
run: cmake -E make_directory build | |
- name: Set ENABLE_WIN32_CONSOLE (debug) | |
if: matrix.build_type == 'debug' | |
shell: bash | |
run: echo "win32_console=ON" >> $GITHUB_ENV | |
- name: Set ENABLE_WIN32_CONSOLE (release) | |
if: matrix.build_type == 'release' | |
shell: bash | |
run: echo "win32_console=OFF" >> $GITHUB_ENV | |
- name: Run CMake | |
shell: cmd | |
run: > | |
cmake | |
-S . | |
-B build | |
-G "Ninja" | |
-DCMAKE_BUILD_TYPE="${{env.cmake_buildtype}}" | |
-DCMAKE_PREFIX_PATH="${{env.prefix_path_forwardslash}}/lib/cmake" | |
-DBUILD_WITH_QT6=ON | |
-DARCH="${{matrix.arch}}" | |
-DENABLE_WIN32_CONSOLE=${{env.win32_console}} | |
-DUSE_TAGLIB=ON | |
-DPKG_CONFIG_EXECUTABLE="${{env.prefix_path_forwardslash}}/bin/pkg-config.exe" | |
-DICU_ROOT="${{env.prefix_path_forwardslash}}" | |
- name: Run Make | |
shell: cmd | |
env: | |
CL: "/MP" | |
run: cmake --build build --config "${{env.cmake_buildtype}}" --parallel 4 | |
- name: Copy extra binaries | |
shell: cmd | |
working-directory: build | |
run: | | |
copy ${{env.prefix_path_backslash}}\bin\libssl-3*.dll | |
copy ${{env.prefix_path_backslash}}\bin\libcrypto-3*.dll | |
copy ${{env.prefix_path_backslash}}\bin\soup-3.0-0.dll | |
copy ${{env.prefix_path_backslash}}\bin\gst-launch-1.0.exe | |
copy ${{env.prefix_path_backslash}}\bin\gst-play-1.0.exe | |
copy ${{env.prefix_path_backslash}}\bin\gst-discoverer-1.0.exe | |
copy ${{env.prefix_path_backslash}}\bin\sqlite3.exe | |
- name: Create directories | |
shell: cmd | |
working-directory: build | |
run: | | |
mkdir gio-modules | |
mkdir platforms | |
mkdir styles | |
mkdir tls | |
mkdir sqldrivers | |
mkdir imageformats | |
mkdir gstreamer-plugins | |
mkdir nsisplugins | |
- name: Copy GIO modules | |
shell: cmd | |
working-directory: build | |
run: copy ${{env.prefix_path_backslash}}\lib\gio\modules\*.dll .\gio-modules\ | |
- name: Copy Qt platform plugins | |
shell: cmd | |
working-directory: build | |
run: copy ${{env.prefix_path_backslash}}\plugins\platforms\qwindows*.dll .\platforms\ | |
- name: Copy Qt styles | |
shell: cmd | |
working-directory: build | |
run: copy ${{env.prefix_path_backslash}}\plugins\styles\qwindowsvistastyle*.dll .\styles\ | |
- name: Copy Qt TLS plugins | |
shell: cmd | |
working-directory: build | |
run: copy ${{env.prefix_path_backslash}}\plugins\tls\*.dll .\tls\ | |
- name: Copy Qt SQL drivers | |
shell: cmd | |
working-directory: build | |
run: copy ${{env.prefix_path_backslash}}\plugins\sqldrivers\qsqlite*.dll .\sqldrivers\ | |
- name: Copy Qt imageformats plugins | |
shell: cmd | |
working-directory: build | |
run: copy ${{env.prefix_path_backslash}}\plugins\imageformats\*.dll .\imageformats\ | |
- name: Copy gstreamer plugins | |
shell: cmd | |
working-directory: build | |
run: | | |
copy ${{env.prefix_path_backslash}}\lib\gstreamer-1.0\gstaes.dll .\gstreamer-plugins\ | |
copy ${{env.prefix_path_backslash}}\lib\gstreamer-1.0\gstaiff.dll .\gstreamer-plugins\ | |
copy ${{env.prefix_path_backslash}}\lib\gstreamer-1.0\gstapetag.dll .\gstreamer-plugins\ | |
copy ${{env.prefix_path_backslash}}\lib\gstreamer-1.0\gstapp.dll .\gstreamer-plugins\ | |
copy ${{env.prefix_path_backslash}}\lib\gstreamer-1.0\gstasf.dll .\gstreamer-plugins\ | |
copy ${{env.prefix_path_backslash}}\lib\gstreamer-1.0\gstasfmux.dll .\gstreamer-plugins\ | |
copy ${{env.prefix_path_backslash}}\lib\gstreamer-1.0\gstaudioconvert.dll .\gstreamer-plugins\ | |
copy ${{env.prefix_path_backslash}}\lib\gstreamer-1.0\gstaudiofx.dll .\gstreamer-plugins\ | |
copy ${{env.prefix_path_backslash}}\lib\gstreamer-1.0\gstaudiomixer.dll .\gstreamer-plugins\ | |
copy ${{env.prefix_path_backslash}}\lib\gstreamer-1.0\gstaudioparsers.dll .\gstreamer-plugins\ | |
copy ${{env.prefix_path_backslash}}\lib\gstreamer-1.0\gstaudiorate.dll .\gstreamer-plugins\ | |
copy ${{env.prefix_path_backslash}}\lib\gstreamer-1.0\gstaudioresample.dll .\gstreamer-plugins\ | |
copy ${{env.prefix_path_backslash}}\lib\gstreamer-1.0\gstaudiotestsrc.dll .\gstreamer-plugins\ | |
copy ${{env.prefix_path_backslash}}\lib\gstreamer-1.0\gstautodetect.dll .\gstreamer-plugins\ | |
copy ${{env.prefix_path_backslash}}\lib\gstreamer-1.0\gstbs2b.dll .\gstreamer-plugins\ | |
copy ${{env.prefix_path_backslash}}\lib\gstreamer-1.0\gstcoreelements.dll .\gstreamer-plugins\ | |
copy ${{env.prefix_path_backslash}}\lib\gstreamer-1.0\gstdash.dll .\gstreamer-plugins\ | |
copy ${{env.prefix_path_backslash}}\lib\gstreamer-1.0\gstdirectsound.dll .\gstreamer-plugins\ | |
copy ${{env.prefix_path_backslash}}\lib\gstreamer-1.0\gstequalizer.dll .\gstreamer-plugins\ | |
copy ${{env.prefix_path_backslash}}\lib\gstreamer-1.0\gstfaac.dll .\gstreamer-plugins\ | |
copy ${{env.prefix_path_backslash}}\lib\gstreamer-1.0\gstfaad.dll .\gstreamer-plugins\ | |
copy ${{env.prefix_path_backslash}}\lib\gstreamer-1.0\gstfdkaac.dll .\gstreamer-plugins\ | |
copy ${{env.prefix_path_backslash}}\lib\gstreamer-1.0\gstflac.dll .\gstreamer-plugins\ | |
copy ${{env.prefix_path_backslash}}\lib\gstreamer-1.0\gstgio.dll .\gstreamer-plugins\ | |
copy ${{env.prefix_path_backslash}}\lib\gstreamer-1.0\gstgme.dll .\gstreamer-plugins\ | |
copy ${{env.prefix_path_backslash}}\lib\gstreamer-1.0\gsthls.dll .\gstreamer-plugins\ | |
copy ${{env.prefix_path_backslash}}\lib\gstreamer-1.0\gsticydemux.dll .\gstreamer-plugins\ | |
copy ${{env.prefix_path_backslash}}\lib\gstreamer-1.0\gstid3demux.dll .\gstreamer-plugins\ | |
copy ${{env.prefix_path_backslash}}\lib\gstreamer-1.0\gstid3tag.dll .\gstreamer-plugins\ | |
copy ${{env.prefix_path_backslash}}\lib\gstreamer-1.0\gstisomp4.dll .\gstreamer-plugins\ | |
copy ${{env.prefix_path_backslash}}\lib\gstreamer-1.0\gstlame.dll .\gstreamer-plugins\ | |
copy ${{env.prefix_path_backslash}}\lib\gstreamer-1.0\gstlibav.dll .\gstreamer-plugins\ | |
copy ${{env.prefix_path_backslash}}\lib\gstreamer-1.0\gstmpg123.dll .\gstreamer-plugins\ | |
copy ${{env.prefix_path_backslash}}\lib\gstreamer-1.0\gstmusepack.dll .\gstreamer-plugins\ | |
copy ${{env.prefix_path_backslash}}\lib\gstreamer-1.0\gstogg.dll .\gstreamer-plugins\ | |
copy ${{env.prefix_path_backslash}}\lib\gstreamer-1.0\gstopenmpt.dll .\gstreamer-plugins\ | |
copy ${{env.prefix_path_backslash}}\lib\gstreamer-1.0\gstopus.dll .\gstreamer-plugins\ | |
copy ${{env.prefix_path_backslash}}\lib\gstreamer-1.0\gstopusparse.dll .\gstreamer-plugins\ | |
copy ${{env.prefix_path_backslash}}\lib\gstreamer-1.0\gstpbtypes.dll .\gstreamer-plugins\ | |
copy ${{env.prefix_path_backslash}}\lib\gstreamer-1.0\gstplayback.dll .\gstreamer-plugins\ | |
copy ${{env.prefix_path_backslash}}\lib\gstreamer-1.0\gstreplaygain.dll .\gstreamer-plugins\ | |
copy ${{env.prefix_path_backslash}}\lib\gstreamer-1.0\gstrtp.dll .\gstreamer-plugins\ | |
copy ${{env.prefix_path_backslash}}\lib\gstreamer-1.0\gstrtsp.dll .\gstreamer-plugins\ | |
copy ${{env.prefix_path_backslash}}\lib\gstreamer-1.0\gstsoup.dll .\gstreamer-plugins\ | |
copy ${{env.prefix_path_backslash}}\lib\gstreamer-1.0\gstspectrum.dll .\gstreamer-plugins\ | |
copy ${{env.prefix_path_backslash}}\lib\gstreamer-1.0\gstspeex.dll .\gstreamer-plugins\ | |
copy ${{env.prefix_path_backslash}}\lib\gstreamer-1.0\gsttaglib.dll .\gstreamer-plugins\ | |
copy ${{env.prefix_path_backslash}}\lib\gstreamer-1.0\gsttcp.dll .\gstreamer-plugins\ | |
copy ${{env.prefix_path_backslash}}\lib\gstreamer-1.0\gsttwolame.dll .\gstreamer-plugins\ | |
copy ${{env.prefix_path_backslash}}\lib\gstreamer-1.0\gsttypefindfunctions.dll .\gstreamer-plugins\ | |
copy ${{env.prefix_path_backslash}}\lib\gstreamer-1.0\gstudp.dll .\gstreamer-plugins\ | |
copy ${{env.prefix_path_backslash}}\lib\gstreamer-1.0\gstvolume.dll .\gstreamer-plugins\ | |
copy ${{env.prefix_path_backslash}}\lib\gstreamer-1.0\gstvorbis.dll .\gstreamer-plugins\ | |
copy ${{env.prefix_path_backslash}}\lib\gstreamer-1.0\gstwasapi.dll .\gstreamer-plugins\ | |
copy ${{env.prefix_path_backslash}}\lib\gstreamer-1.0\gstwasapi2.dll .\gstreamer-plugins\ | |
copy ${{env.prefix_path_backslash}}\lib\gstreamer-1.0\gstwavenc.dll .\gstreamer-plugins\ | |
copy ${{env.prefix_path_backslash}}\lib\gstreamer-1.0\gstwavpack.dll .\gstreamer-plugins\ | |
copy ${{env.prefix_path_backslash}}\lib\gstreamer-1.0\gstwavparse.dll .\gstreamer-plugins\ | |
copy ${{env.prefix_path_backslash}}\lib\gstreamer-1.0\gstxingmux.dll .\gstreamer-plugins\ | |
- name: Download copydlldeps.sh | |
shell: bash | |
working-directory: build | |
run: curl -f -O -L https://raw.githubusercontent.com/strawberrymusicplayer/strawberry-mxe/master/tools/copydlldeps.sh | |
- name: Copy dependencies | |
shell: bash | |
working-directory: build | |
run: > | |
./copydlldeps.sh | |
-c | |
-d . | |
-F . | |
-F ./platforms | |
-F ./styles | |
-F ./tls | |
-F ./sqldrivers | |
-F ./imageformats | |
-F ./gio-modules | |
-F ./gstreamer-plugins | |
-R ${{env.prefix_path_unix}}/bin | |
- name: Copy nsis files | |
shell: cmd | |
working-directory: build | |
run: | | |
copy ..\dist\windows\*.nsi . | |
copy ..\dist\windows\*.nsh . | |
copy ..\dist\windows\*.ico . | |
- name: Copy COPYING license file | |
shell: cmd | |
working-directory: build | |
run: copy ..\COPYING . | |
- name: List files | |
shell: cmd | |
working-directory: build | |
run: dir | |
- name: Check that all files are included in nsi | |
shell: bash | |
working-directory: build | |
run: | | |
files_missing= | |
for i in $(ls -1 *.dll *.exe); do | |
nsi_file_entry=$(grep -i "^\s\+File\s\+\"$i\"$" strawberry.nsi || true) | |
if [ "${nsi_file_entry}" = "" ]; then | |
echo "File ${i} is missing File entry." | |
fi | |
nsi_file_delete_entry=$(grep -i "^\s\+Delete\s\+\"\$INSTDIR\\\\$i\"$" strawberry.nsi || true) | |
if [ "${nsi_file_delete_entry}" = "" ] ; then | |
echo "File ${i} is missing Delete entry." | |
fi | |
if [ "${nsi_file_entry}" = "" ] || [ "${nsi_file_delete_entry}" = "" ] ; then | |
if [ "${files_missing}" = "" ]; then | |
files_missing="${i}" | |
else | |
files_missing="${files_missing} $i" | |
fi | |
fi | |
done | |
if ! [ "${files_missing}" = "" ]; then | |
echo "Files missing in nsi: ${files_missing}" | |
exit 1 | |
fi | |
- name: Create nsis installer | |
shell: cmd | |
working-directory: build | |
run: makensis strawberry.nsi |