Skip to content

Build

Build #179

Workflow file for this run

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: [ 'x86_64' ]
buildtype: [ '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: Check file
run: ls -R
- 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=OFF
-DENABLE_DBUS=OFF
-DENABLE_AUDIOCD=OFF
-DENABLE_MTP=OFF
-DENABLE_GPOD=OFF
-DENABLE_SPOTIFY=OFF
-DUSE_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 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: 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: Upload Release Artifacts
uses: actions/upload-artifact@v4
with:
name: strawberry-setup-artifacts
path: |
build/StrawberrySetup*.exe
upload:
name: Upload
runs-on: ubuntu-latest
needs:
- build-windows-mingw
steps:
- name: Get current date
id: date
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: strawberry-setup-artifacts
- 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