Build #201
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: | |
branches: | |
- main | |
schedule: | |
- cron: '0 0 * * *' | |
jobs: | |
build-windows-mingw: | |
name: Build Windows MinGW | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
arch: [ 'i686', 'x86_64' ] | |
buildtype: [ 'debug', 'release' ] | |
container: | |
image: jonaski/strawberry-mxe-${{matrix.arch}}-${{matrix.buildtype}} | |
steps: | |
- name: Set cmake buildtype | |
shell: bash | |
run: echo "cmake_buildtype=$(echo ${{matrix.buildtype}} | sed 's/.*/\u&/')" >> $GITHUB_ENV | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
repository: strawberrymusicplayer/strawberry | |
fetch-depth: 0 | |
submodules: recursive | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
submodules: recursive | |
path: ./diff | |
- name: Add safe git directory | |
run: git config --global --add safe.directory ${GITHUB_WORKSPACE} | |
- name: Create Build Environment | |
run: cmake -E make_directory build | |
- name: Link MXE directory | |
run: ln -s /strawberry-mxe ~/mxe-shared | |
- name: patch | |
run: patch -p0 < diff/remsparkle.diff | |
- name: Run CMake | |
env: | |
PKG_CONFIG_PATH: /strawberry-mxe/usr/${{matrix.arch}}-w64-mingw32.shared/lib/pkgconfig | |
run: > | |
cmake | |
-S . | |
-B build | |
-DCMAKE_TOOLCHAIN_FILE="../cmake/Toolchain-${{matrix.arch}}-w64-mingw32-shared.cmake" | |
-DCMAKE_BUILD_TYPE="${{env.cmake_buildtype}}" | |
-DCMAKE_PREFIX_PATH="/strawberry-mxe/usr/${{matrix.arch}}-w64-mingw32.shared/qt6" | |
-DBUILD_WERROR=ON | |
-DARCH="${{matrix.arch}}" | |
-DENABLE_WIN32_CONSOLE=$(test "${{matrix.buildtype}}" = "debug" && echo "ON" || echo "OFF") | |
-DENABLE_GIO=OFF | |
-DENABLE_AUDIOCD=OFF | |
-DENABLE_MTP=OFF | |
-DENABLE_GPOD=OFF | |
-DENABLE_SPOTIFY=OFF | |
-DUSE_QTSPARKLE=OFF | |
-DENABLE_SPARKLE=OFF | |
-DENABLE_QTSPARKLE=OFF | |
- name: Run Make | |
run: cmake --build build --config "${{env.cmake_buildtype}}" --parallel $(nproc) | |
- name: Create directories | |
working-directory: build | |
run: mkdir -p gio-modules platforms sqldrivers tls imageformats styles gstreamer-plugins nsisplugins | |
- name: Copy GIO modules | |
working-directory: build | |
run: cp /strawberry-mxe/usr/${{matrix.arch}}-w64-mingw32.shared/lib/gio/modules/{libgiognutls.dll,libgioopenssl.dll} ${GITHUB_WORKSPACE}/build/gio-modules/ | |
- name: Copy Qt platform plugins | |
working-directory: build | |
run: cp /strawberry-mxe/usr/${{matrix.arch}}-w64-mingw32.shared/qt6/plugins/platforms/qwindows.dll ${GITHUB_WORKSPACE}/build/platforms/ | |
- name: Copy Qt styles | |
working-directory: build | |
run: cp /strawberry-mxe/usr/${{matrix.arch}}-w64-mingw32.shared/qt6/plugins/styles/qmodernwindowsstyle.dll ${GITHUB_WORKSPACE}/build/styles/ | |
- name: Copy Qt TLS plugins | |
working-directory: build | |
run: cp /strawberry-mxe/usr/${{matrix.arch}}-w64-mingw32.shared/qt6/plugins/tls/{qschannelbackend.dll,qopensslbackend.dll} ${GITHUB_WORKSPACE}/build/tls/ | |
- name: Copy Qt SQL drivers | |
working-directory: build | |
run: cp /strawberry-mxe/usr/${{matrix.arch}}-w64-mingw32.shared/qt6/plugins/sqldrivers/qsqlite.dll ${GITHUB_WORKSPACE}/build/sqldrivers/ | |
- name: Copy Qt imageformats | |
working-directory: build | |
run: cp /strawberry-mxe/usr/${{matrix.arch}}-w64-mingw32.shared/qt6/plugins/imageformats/{qgif.dll,qico.dll,qjpeg.dll} ${GITHUB_WORKSPACE}/build/imageformats/ | |
- name: Copy gstreamer plugins | |
working-directory: build | |
run: cp /strawberry-mxe/usr/${{matrix.arch}}-w64-mingw32.shared/bin/gstreamer-1.0/*.dll ${GITHUB_WORKSPACE}/build/gstreamer-plugins/ | |
- name: Copy extra binaries | |
working-directory: build | |
run: cp /strawberry-mxe/usr/${{matrix.arch}}-w64-mingw32.shared/bin/{sqlite3.exe,gst-launch-1.0.exe,gst-play-1.0.exe,gst-discoverer-1.0.exe,libsoup-3.0-0.dll,libnghttp2.dll} . | |
- name: Copy extra binaries (debug) | |
if: matrix.buildtype == 'debug' | |
working-directory: build | |
run: cp /strawberry-mxe/usr/${{matrix.arch}}-w64-mingw32.shared/bin/{gdb.exe,libreadline8.dll} . | |
- name: Copy dependencies | |
working-directory: build | |
run: > | |
/strawberry-mxe/tools/copydlldeps.sh | |
-c | |
-d . | |
-F . | |
-F ./platforms | |
-F ./styles | |
-F ./imageformats | |
-F ./tls | |
-F ./sqldrivers | |
-F ./gstreamer-plugins | |
-R /strawberry-mxe/usr/${{matrix.arch}}-w64-mingw32.shared | |
- name: Strip binaries | |
if: matrix.buildtype == 'release' | |
working-directory: build | |
run: find . -type f \( -iname \*.dll -o -iname \*.exe \) -exec /strawberry-mxe/usr/bin/${{matrix.arch}}-w64-mingw32.shared-strip {} \; | |
- name: Strip gdb.exe | |
if: matrix.buildtype == 'debug' | |
working-directory: build | |
run: /strawberry-mxe/usr/bin/${{matrix.arch}}-w64-mingw32.shared-strip gdb.exe | |
- name: Copy nsis files | |
working-directory: build | |
run: cp ${GITHUB_WORKSPACE}/dist/windows/*.nsh ${GITHUB_WORKSPACE}/dist/windows/*.ico . | |
- name: Copy COPYING license file | |
working-directory: build | |
run: cp ${GITHUB_WORKSPACE}/COPYING . | |
- name: List files | |
working-directory: build | |
run: ls | |
- 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: Build Windows installer | |
working-directory: build | |
run: makensis strawberry.nsi | |
- name: Build Windows installer | |
working-directory: build | |
run: makensis strawberry.nsi | |
- name: Upload Release Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: strawberry-mingw-artifacts-${{ matrix.arch }}-${{ matrix.buildtype }} | |
path: | | |
build/StrawberrySetup*.exe | |
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: Install rsync | |
shell: cmd | |
run: choco install --no-progress rsync | |
- name: Cleanup PATH | |
uses: egor-tensin/cleanup-path@v4 | |
with: | |
dirs: ${{env.prefix_path_backslash}}\bin;C:\Windows;C:\Windows\system32;C:\Program Files\Git\bin;C:\Program Files\CMake\bin;C:\Program Files\GitHub CLI;C:\ProgramData\Chocolatey\bin;C:\Program Files (x86)\NSIS | |
- 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: Delete conflicting files | |
shell: bash | |
run: rm -rf /c/{msys64,mingw32,mingw64} /c/strawberry/c "/c/program files/OpenSSL" | |
- name: Delete conflicting icu | |
shell: bash | |
run: find "/c/program files (x86)/windows kits/" -type f \( -iname 'icu*.lib' -o -iname 'icu*.h' \) -print -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: 2022 | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
repository: strawberrymusicplayer/strawberry | |
fetch-depth: 0 | |
submodules: recursive | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
submodules: recursive | |
path: ./diff | |
- 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.buildtype == 'debug' | |
shell: bash | |
run: echo "win32_console=ON" >> $GITHUB_ENV | |
- name: Set ENABLE_WIN32_CONSOLE (release) | |
if: matrix.buildtype == 'release' | |
shell: bash | |
run: echo "win32_console=OFF" >> $GITHUB_ENV | |
- name: patch | |
run: patch -p0 -i diff/remsparkle.diff | |
- 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" | |
-DARCH="${{matrix.arch}}" | |
-DENABLE_WIN32_CONSOLE=${{env.win32_console}} | |
-DPKG_CONFIG_EXECUTABLE="${{env.prefix_path_forwardslash}}/bin/pkg-config.exe" | |
-DICU_ROOT="${{env.prefix_path_forwardslash}}" | |
-DENABLE_GIO=OFF | |
-DENABLE_AUDIOCD=OFF | |
-DENABLE_MTP=OFF | |
-DENABLE_GPOD=OFF | |
-DENABLE_SPOTIFY=ON | |
-DUSE_QTSPARKLE=OFF | |
-DENABLE_SPARKLE=OFF | |
-DENABLE_QTSPARKLE=OFF | |
- 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\qmodernwindowsstyle*.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\*.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\*.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: Download MSVC runtime | |
shell: bash | |
working-directory: build | |
run: curl -f -O -L https://aka.ms/vs/17/release/vc_redist.$(test "${{matrix.arch}}" = "x86_64" && echo "x64" || echo "${{matrix.arch}}").exe | |
- name: Create nsis installer | |
shell: cmd | |
working-directory: build | |
run: makensis strawberry.nsi | |
- name: Upload Release Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: strawberry-msvc-artifacts-${{ matrix.arch }}-${{ matrix.buildtype }} | |
path: | | |
build/StrawberrySetup*.exe | |
upload: | |
name: Upload | |
runs-on: ubuntu-latest | |
needs: | |
- build-windows-mingw | |
- build-windows-msvc | |
steps: | |
- name: Get current date | |
id: date | |
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT | |
- name: Download mingw Debug Artifacts (x86) | |
uses: actions/download-artifact@v4 | |
with: | |
name: strawberry-mingw-artifacts-i686-debug | |
- name: Download mingw Release Artifacts (x86) | |
uses: actions/download-artifact@v4 | |
with: | |
name: strawberry-mingw-artifacts-i686-release | |
- name: Download mingw Debug Artifacts (x64) | |
uses: actions/download-artifact@v4 | |
with: | |
name: strawberry-mingw-artifacts-x86_64-debug | |
- name: Download mingw Release Artifacts (x64) | |
uses: actions/download-artifact@v4 | |
with: | |
name: strawberry-mingw-artifacts-x86_64-release | |
- name: Download msvc Debug Artifacts (x86) | |
uses: actions/download-artifact@v4 | |
with: | |
name: strawberry-msvc-artifacts-x86-debug | |
- name: Download msvc Release Artifacts (x86) | |
uses: actions/download-artifact@v4 | |
with: | |
name: strawberry-msvc-artifacts-x86-release | |
- name: Download msvc Debug Artifacts (x64) | |
uses: actions/download-artifact@v4 | |
with: | |
name: strawberry-msvc-artifacts-x86_64-debug | |
- name: Download msvc Release Artifacts (x64) | |
uses: actions/download-artifact@v4 | |
with: | |
name: strawberry-msvc-artifacts-x86_64-release | |
- name: Create Release | |
uses: ncipollo/release-action@v1 | |
with: | |
tag: ${{ steps.date.outputs.date }} | |
name: "Daily Build ${{ steps.date.outputs.date }}" | |
body: "Daily Build" | |
draft: false | |
prerelease: false | |
artifacts: StrawberrySetup*.exe |