strawberry-audio-player-win.../.github/workflows/build.yml

1544 lines
53 KiB
YAML
Raw Normal View History

2023-02-21 18:43:01 +01:00
name: Build
2024-02-11 00:10:36 +01:00
on:
push:
pull_request:
types: [opened, synchronize, reopened]
release:
types: [published]
2019-11-24 20:04:05 +01:00
jobs:
2023-05-06 15:02:55 +02:00
build-opensuse:
2022-09-30 21:31:28 +02:00
name: Build openSUSE
if: github.repository != 'strawberrymusicplayer/strawberry-private'
2019-11-24 20:04:05 +01:00
runs-on: ubuntu-latest
2022-09-30 21:31:28 +02:00
strategy:
fail-fast: false
matrix:
opensuse_version: [ 'tumbleweed', 'leap:15.5', 'leap:15.6' ]
2023-09-16 14:06:09 +02:00
qt_version: [ '5', '6' ]
2020-04-08 01:15:39 +02:00
container:
2022-09-30 21:31:28 +02:00
image: opensuse/${{matrix.opensuse_version}}
2019-11-24 20:04:05 +01:00
steps:
- name: Add devel tools building repo
if: matrix.opensuse_version != 'tumbleweed'
run: zypper -n ar -c -f -n 'devel-tools-building' https://download.opensuse.org/repositories/devel:tools:building/$(echo "${{matrix.opensuse_version}}" | cut -d ':' -f 2)/ devel-tools-building
2022-09-30 21:31:28 +02:00
- name: Add tagparser repo
if: matrix.opensuse_version == 'tumbleweed'
run: zypper -n ar -c -f -n 'repo-tagparser' https://download.opensuse.org/repositories/home:/mkittler/openSUSE_Tumbleweed/ repo-tagparser
- name: Refresh repositories
run: zypper -n --gpg-auto-import-keys ref
- name: Upgrade packages
if: matrix.opensuse_version == 'tumbleweed'
run: zypper -n --gpg-auto-import-keys dup
2024-04-03 00:00:44 +02:00
- name: Upgrade packages
if: matrix.opensuse_version != 'tumbleweed'
run: zypper -n --gpg-auto-import-keys up
2022-09-30 21:31:28 +02:00
- name: Install gcc
if: matrix.opensuse_version == 'tumbleweed'
run: zypper -n --gpg-auto-import-keys in gcc gcc-c++
2024-04-03 00:00:44 +02:00
- name: Install gcc 13
2022-09-30 21:31:28 +02:00
if: matrix.opensuse_version != 'tumbleweed'
2024-04-03 00:00:44 +02:00
run: zypper -n --gpg-auto-import-keys in gcc13 gcc13-c++
2022-09-30 21:31:28 +02:00
- name: Install packages
2020-05-30 03:49:37 +02:00
run: >
2022-09-30 21:31:28 +02:00
zypper -n --gpg-auto-import-keys in
2020-05-30 03:49:37 +02:00
lsb-release
rpm-build
git
tar
make
cmake
gettext-tools
openssh-clients
2023-05-06 15:02:55 +02:00
rsync
2020-05-30 03:49:37 +02:00
glibc-devel
libboost_headers-devel
boost-devel
glib2-devel
glib2-tools
dbus-1-devel
alsa-devel
libnotify-devel
protobuf-devel
sqlite3-devel
libpulse-devel
gstreamer-devel
gstreamer-plugins-base-devel
vlc-devel
2021-02-26 22:36:26 +01:00
taglib-devel
libicu-devel
2022-09-30 21:31:28 +02:00
libcdio-devel
libgpod-devel
libmtp-devel
libchromaprint-devel
2023-10-23 19:45:50 +02:00
fftw3-devel
2023-06-27 04:06:30 +02:00
libebur128-devel
2022-09-30 21:31:28 +02:00
desktop-file-utils
update-desktop-files
appstream-glib
hicolor-icon-theme
- name: Install Qt 5
2023-09-16 14:06:09 +02:00
if: matrix.qt_version == '5'
2022-09-30 21:31:28 +02:00
run: >
zypper -n --gpg-auto-import-keys in
2020-05-30 03:49:37 +02:00
libQt5Core-devel
libQt5Gui-devel
libQt5Widgets-devel
libQt5Concurrent-devel
libQt5Network-devel
libQt5Sql-devel
libQt5DBus-devel
libQt5Test-devel
libqt5-qtbase-common-devel
libQt5Sql5-sqlite
libqt5-linguist-devel
libqt5-qtx11extras-devel
2022-09-30 21:31:28 +02:00
- name: Install Qt 6
2023-09-16 14:06:09 +02:00
if: matrix.qt_version == '6'
2022-09-30 21:31:28 +02:00
run: >
zypper -n --gpg-auto-import-keys in
qt6-core-devel
qt6-gui-devel
qt6-widgets-devel
qt6-concurrent-devel
qt6-network-devel
qt6-sql-devel
qt6-dbus-devel
qt6-test-devel
qt6-base-common-devel
qt6-sql-sqlite
qt6-linguist-devel
- name: Install tagparser
if: matrix.opensuse_version == 'tumbleweed'
run: zypper -n --gpg-auto-import-keys in tagparser-devel
2023-12-26 20:47:11 +01:00
- name: Install kdsingleapplication-devel
if: matrix.opensuse_version == 'tumbleweed' && matrix.qt_version == '5'
run: zypper -n --gpg-auto-import-keys in kdsingleapplication-devel
- name: Install kdsingleapplication-qt6-devel
if: matrix.opensuse_version == 'tumbleweed' && matrix.qt_version == '6'
run: zypper -n --gpg-auto-import-keys in kdsingleapplication-qt6-devel
2023-05-06 15:02:55 +02:00
- name: Checkout
uses: actions/checkout@v4
2022-08-09 23:03:24 +02:00
with:
fetch-depth: 0
2023-10-21 05:43:48 +02:00
submodules: recursive
2022-04-20 01:23:02 +02:00
- name: Add safe git directory
2022-09-09 22:29:01 +02:00
run: git config --global --add safe.directory ${GITHUB_WORKSPACE}
2020-05-30 03:49:37 +02:00
- name: Create Build Environment
run: cmake -E make_directory build
- name: Configure CMake
2023-09-16 14:06:09 +02:00
run: cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug -DBUILD_WERROR=ON -DUSE_TAGLIB=ON -DQT_VERSION_MAJOR=${{matrix.qt_version}}
2020-05-30 03:49:37 +02:00
- name: Create source tarball
working-directory: build
run: ../dist/scripts/maketarball.sh
2022-09-30 21:31:28 +02:00
- name: Create RPM build sources directories
run: mkdir -p ~/rpmbuild/SOURCES /usr/src/packages/SOURCES
- name: Copy source tarball
working-directory: build
run: cp strawberry-*.tar.xz /usr/src/packages/SOURCES/
- name: Build RPM (Tumbleweed)
if: matrix.opensuse_version == 'tumbleweed'
working-directory: build
run: rpmbuild -ba ../dist/unix/strawberry.spec
- name: Build RPM (Leap)
if: matrix.opensuse_version != 'tumbleweed'
working-directory: build
env:
2024-04-03 00:00:44 +02:00
CC: gcc-13
CXX: g++-13
2022-09-30 21:31:28 +02:00
run: rpmbuild -ba ../dist/unix/strawberry.spec
2024-02-11 12:12:54 +01:00
- name: Set subdir
id: set-subdir
run: echo "subdir=$(echo ${{matrix.opensuse_version}} | sed 's/leap:/lp/g' | sed 's/\.//g')" > $GITHUB_OUTPUT
- name: Upload source
if: matrix.opensuse_version == 'tumbleweed' && matrix.qt_version == '6'
uses: actions/upload-artifact@v4
2023-05-06 15:02:55 +02:00
with:
2024-02-11 12:12:54 +01:00
name: source
2023-05-06 15:02:55 +02:00
path: |
/usr/src/packages/SOURCES/*.xz
2024-02-11 12:12:54 +01:00
- name: Upload rpm
if: matrix.opensuse_version != 'tumbleweed' && matrix.qt_version == '6'
uses: actions/upload-artifact@v4
with:
name: opensuse-${{steps.set-subdir.outputs.subdir}}
path: |
2023-05-06 15:02:55 +02:00
/usr/src/packages/SRPMS/*.rpm
/usr/src/packages/RPMS/x86_64/*.rpm
build-fedora:
2022-09-30 21:31:28 +02:00
name: Build Fedora
if: github.repository != 'strawberrymusicplayer/strawberry-private'
2021-03-20 22:01:32 +01:00
runs-on: ubuntu-latest
2022-09-30 21:31:28 +02:00
strategy:
fail-fast: false
matrix:
2024-03-23 14:18:17 +01:00
fedora_version: [ '38', '39', '40', '41' ]
2021-03-20 22:01:32 +01:00
container:
2022-09-30 21:31:28 +02:00
image: fedora:${{matrix.fedora_version}}
2020-05-30 03:49:37 +02:00
steps:
2022-09-30 21:31:28 +02:00
- name: Update repositories
2023-08-11 17:03:39 +02:00
run: dnf -y update
2022-09-30 21:31:28 +02:00
- name: Upgrade packages
2023-08-11 17:03:39 +02:00
run: dnf -y upgrade
2022-09-30 21:31:28 +02:00
- name: Install dependencies
2020-05-30 03:49:37 +02:00
run: >
dnf -y --skip-broken install
2022-09-30 21:31:28 +02:00
@development-tools
redhat-lsb-core
which
2020-05-30 03:49:37 +02:00
git
2022-09-30 21:31:28 +02:00
glibc
gcc-c++
rpmdevtools
2020-05-30 03:49:37 +02:00
make
cmake
2022-09-30 21:31:28 +02:00
pkgconfig
glib
man
tar
gettext
openssh
2023-05-06 15:02:55 +02:00
rsync
2020-05-30 03:49:37 +02:00
boost-devel
2022-09-30 21:31:28 +02:00
dbus-devel
2020-05-30 03:49:37 +02:00
protobuf-devel
2022-09-30 21:31:28 +02:00
protobuf-compiler
sqlite-devel
alsa-lib-devel
pulseaudio-libs-devel
libnotify-devel
libicu-devel
2022-09-30 21:31:28 +02:00
qt6-qtbase-devel
qt6-qtbase-private-devel
qt6-qttools-devel
gstreamer1-devel
gstreamer1-plugins-base-devel
taglib-devel
2020-05-30 03:49:37 +02:00
libcdio-devel
libgpod-devel
libmtp-devel
libchromaprint-devel
2023-06-27 04:06:30 +02:00
libebur128-devel
2022-09-30 21:31:28 +02:00
fftw-devel
2020-05-30 03:49:37 +02:00
desktop-file-utils
2022-09-30 21:31:28 +02:00
libappstream-glib
2020-05-30 03:49:37 +02:00
hicolor-icon-theme
2023-12-26 20:47:11 +01:00
kdsingleapplication-qt6-devel
2023-05-06 15:02:55 +02:00
- name: Checkout
uses: actions/checkout@v4
2022-08-09 23:03:24 +02:00
with:
fetch-depth: 0
2023-10-21 05:43:48 +02:00
submodules: recursive
2022-04-20 01:23:02 +02:00
- name: Add safe git directory
2022-09-09 22:29:01 +02:00
run: git config --global --add safe.directory ${GITHUB_WORKSPACE}
2020-05-30 03:49:37 +02:00
- name: Create Build Environment
run: cmake -E make_directory build
- name: Configure CMake
2023-05-06 14:18:35 +02:00
run: cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug -DBUILD_WERROR=ON
2020-05-30 03:49:37 +02:00
- name: Create source tarball
working-directory: build
run: ../dist/scripts/maketarball.sh
- name: Create RPM build sources directories
2022-09-30 21:31:28 +02:00
working-directory: build
2020-05-30 03:49:37 +02:00
run: mkdir -p ~/rpmbuild/SOURCES /usr/src/packages/SOURCES
- name: Copy source tarball
working-directory: build
2022-09-30 21:31:28 +02:00
run: cp strawberry-*.tar.xz ~/rpmbuild/SOURCES/
2020-05-30 03:49:37 +02:00
- name: Build RPM
2022-09-30 21:31:28 +02:00
env:
RPM_BUILD_NCPUS: "2"
2020-05-30 03:49:37 +02:00
working-directory: build
run: rpmbuild -ba ../dist/unix/strawberry.spec
2023-05-06 15:02:55 +02:00
- name: Upload artifacts
uses: actions/upload-artifact@v4
2023-05-06 15:02:55 +02:00
with:
name: fedora-${{matrix.fedora_version}}
path: |
/github/home/rpmbuild/SRPMS/*.rpm
/github/home/rpmbuild/RPMS/x86_64/*.rpm
2020-05-30 03:49:37 +02:00
2021-03-20 22:01:32 +01:00
2023-05-06 15:02:55 +02:00
build-openmandriva:
2022-09-30 21:31:28 +02:00
name: Build OpenMandriva
2024-04-06 21:11:01 +02:00
if: github.repository != 'strawberrymusicplayer/strawberry-private' && false
2020-08-02 04:19:39 +02:00
runs-on: ubuntu-latest
2022-09-30 21:31:28 +02:00
strategy:
fail-fast: false
matrix:
openmandriva_version: [ "cooker" ]
2020-08-02 04:19:39 +02:00
container:
2022-09-30 21:31:28 +02:00
image: openmandriva/${{matrix.openmandriva_version}}
2020-08-02 04:19:39 +02:00
steps:
2024-01-04 02:33:18 +01:00
- name: Update distro
run: dnf distro-sync --assumeyes
2022-09-30 21:31:28 +02:00
- name: Install dependencies
2020-08-02 04:19:39 +02:00
run: >
2023-02-21 18:43:01 +01:00
dnf install -y
2024-01-04 02:33:18 +01:00
which
2022-09-30 21:31:28 +02:00
glibc
gcc-c++
git
gnutar
make
cmake
glib
gettext
lsb-release
rpmdevtools
rpm-build
2023-05-06 15:02:55 +02:00
rsync
2022-09-30 21:31:28 +02:00
glibc-devel
boost-devel
dbus-devel
protobuf-devel
protobuf-compiler
sqlite-devel
libasound-devel
pulseaudio-devel
2024-01-04 02:33:18 +01:00
libGL-devel
2022-09-30 21:31:28 +02:00
libgst-plugins-base1.0-devel
taglib-devel
chromaprint-devel
2023-06-27 04:06:30 +02:00
libebur128-devel
2022-09-30 21:31:28 +02:00
fftw-devel
icu-devel
libcdio-devel
libgpod-devel
libmtp-devel
lib64Qt6Core-devel
lib64Qt6Concurrent-devel
lib64Qt6Network-devel
lib64Qt6Sql-devel
lib64Qt6DBus-devel
lib64Qt6Gui-devel
lib64Qt6Widgets-devel
lib64Qt6Test-devel
qt6-cmake
qt6-qtbase-tools
2023-10-08 00:11:47 +02:00
qt6-qttools-linguist
2022-09-30 21:31:28 +02:00
desktop-file-utils
appstream
appstream-util
hicolor-icon-theme
2024-01-04 02:33:18 +01:00
- name: Remove files
run: rm -rf /usr/lib64/qt6/lib/cmake/Qt6Sql/{Qt6QMYSQL*,Qt6QODBCD*,Qt6QPSQL*,Qt6QIBase*}
2023-05-06 15:02:55 +02:00
- name: Checkout
uses: actions/checkout@v4
2022-08-09 23:03:24 +02:00
with:
fetch-depth: 0
2023-10-21 05:43:48 +02:00
submodules: recursive
2022-04-20 01:23:02 +02:00
- name: Add safe git directory
2022-09-09 22:29:01 +02:00
run: git config --global --add safe.directory ${GITHUB_WORKSPACE}
2020-08-02 04:19:39 +02:00
- name: Create Build Environment
run: cmake -E make_directory build
- name: Configure CMake
2023-05-06 14:18:35 +02:00
run: cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug -DBUILD_WERROR=ON
2020-12-09 00:27:37 +01:00
- name: Create source tarball
working-directory: build
run: ../dist/scripts/maketarball.sh
2022-01-09 03:43:01 +01:00
- name: Create RPM build sources directories
2022-09-30 21:31:28 +02:00
working-directory: build
2022-01-09 03:43:01 +01:00
run: mkdir -p ~/rpmbuild/SOURCES /usr/src/packages/SOURCES
- name: Copy source tarball
working-directory: build
2022-09-30 21:31:28 +02:00
run: cp strawberry-*.tar.xz ~/rpmbuild/SOURCES/
2023-05-06 14:08:34 +02:00
- name: Build RPM
env:
RPM_BUILD_NCPUS: "2"
working-directory: build
run: rpmbuild -ba ../dist/unix/strawberry.spec
2023-05-06 15:02:55 +02:00
- name: Upload artifacts
2024-02-11 12:24:29 +01:00
if: matrix.openmandriva_version != 'cooker'
uses: actions/upload-artifact@v4
2023-05-06 15:02:55 +02:00
with:
name: openmandriva-${{matrix.openmandriva_version}}
path: |
/github/home/rpmbuild/SRPMS/*.rpm
/github/home/rpmbuild/RPMS/x86_64/*.rpm
2023-05-06 14:08:34 +02:00
2023-05-06 15:02:55 +02:00
build-mageia:
2023-05-06 14:08:34 +02:00
name: Build Mageia
2024-04-06 21:10:49 +02:00
if: github.repository != 'strawberrymusicplayer/strawberry-private'
2023-05-06 14:08:34 +02:00
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
mageia_version: [ '9' ]
2023-05-06 14:08:34 +02:00
container:
image: mageia:${{matrix.mageia_version}}
steps:
2024-04-21 16:10:26 +02:00
- name: Set media
run: |
urpmi.removemedia "Core Release"
urpmi.removemedia "Core Updates"
urpmi.addmedia "Core Release" "https://mirrors.kernel.org/mageia/distrib/${{matrix.mageia_version}}/x86_64/media/core/release/"
urpmi.addmedia "Core Updates" "https://mirrors.kernel.org/mageia/distrib/${{matrix.mageia_version}}/x86_64/media/core/updates/"
2023-05-06 14:08:34 +02:00
- name: Update repositories
2024-04-21 16:10:26 +02:00
run: urpmi.update -a
2023-05-06 14:08:34 +02:00
- name: Upgrade packages
run: urpmi --auto --auto-update
- name: Install dependencies
run: >
urpmi --auto --force urpmi-debuginfo-install
git
glibc
gcc-c++
binutils
make
cmake
man
tar
rpmdevtools
gettext
2023-05-06 15:02:55 +02:00
rsync
2023-05-06 14:08:34 +02:00
lib64boost-devel
lib64protobuf-devel
lib64sqlite3-devel
lib64alsa2-devel
lib64pulseaudio-devel
lib64gstreamer1.0-devel
lib64gstreamer-plugins-base1.0-devel
lib64cdio-devel
lib64gpod-devel
lib64mtp-devel
lib64taglib-devel
lib64chromaprint-devel
2023-06-27 04:06:30 +02:00
lib64ebur128-devel
2023-05-06 14:08:34 +02:00
lib64icu-devel
lib64fftw-devel
lib64dbus-devel
lib64appstream-devel
2024-04-06 21:10:49 +02:00
lib64qt6core-devel
lib64qt6gui-devel
lib64qt6widgets-devel
lib64qt6network-devel
lib64qt6concurrent-devel
lib64qt6sql-devel
lib64qt6dbus-devel
lib64qt6help-devel
lib64qt6test-devel
2023-05-06 14:08:34 +02:00
protobuf-compiler
desktop-file-utils
appstream-util
hicolor-icon-theme
2023-05-06 15:02:55 +02:00
- name: Checkout
uses: actions/checkout@v4
2023-05-06 14:08:34 +02:00
with:
fetch-depth: 0
2023-10-21 05:43:48 +02:00
submodules: recursive
2023-05-06 14:08:34 +02:00
- 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: Configure CMake
2023-05-06 14:18:35 +02:00
run: cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug -DBUILD_WERROR=ON
2023-05-06 14:08:34 +02:00
- name: Create source tarball
working-directory: build
run: ../dist/scripts/maketarball.sh
- name: Create RPM build sources directories
working-directory: build
run: mkdir -p ~/rpmbuild/SOURCES /usr/src/packages/SOURCES
- name: Copy source tarball
working-directory: build
run: cp strawberry-*.tar.xz ~/rpmbuild/SOURCES/
2022-01-09 03:43:01 +01:00
- name: Build RPM
env:
2022-09-30 21:31:28 +02:00
RPM_BUILD_NCPUS: "2"
working-directory: build
2022-01-09 03:43:01 +01:00
run: rpmbuild -ba ../dist/unix/strawberry.spec
2023-05-06 15:02:55 +02:00
- name: Upload artifacts
uses: actions/upload-artifact@v4
2023-05-06 15:02:55 +02:00
with:
name: mageia-${{matrix.mageia_version}}
2023-09-25 20:15:56 +02:00
path: |
2023-05-06 15:02:55 +02:00
/github/home/rpmbuild/SRPMS/*.rpm
/github/home/rpmbuild/RPMS/x86_64/*.rpm
2022-01-09 03:43:01 +01:00
2022-08-09 23:03:24 +02:00
2023-05-06 15:02:55 +02:00
build-debian:
2022-09-30 21:31:28 +02:00
name: Build Debian
if: github.repository != 'strawberrymusicplayer/strawberry-private'
2022-03-05 12:13:34 +01:00
runs-on: ubuntu-latest
2022-09-30 21:31:28 +02:00
strategy:
fail-fast: false
matrix:
2023-06-24 00:58:43 +02:00
debian_version: [ 'bullseye', 'bookworm', 'trixie' ]
2022-03-05 12:13:34 +01:00
container:
2022-09-30 21:31:28 +02:00
image: debian:${{matrix.debian_version}}
2022-03-05 12:13:34 +01:00
steps:
2024-03-31 23:09:19 +02:00
- name: Update packages
2023-02-21 18:43:01 +01:00
run: apt update -y
2024-03-31 23:09:19 +02:00
- name: Upgrade packages
run: apt upgrade -y
2022-09-30 21:31:28 +02:00
- name: Install packages
env:
DEBIAN_FRONTEND: noninteractive
2022-03-05 12:13:34 +01:00
run: >
2022-09-30 21:31:28 +02:00
apt install -y
build-essential
dh-make
2022-03-05 12:13:34 +01:00
git
make
cmake
gcc
2022-09-30 21:31:28 +02:00
g++
pkg-config
fakeroot
gettext
2022-03-05 12:13:34 +01:00
lsb-release
2022-09-30 21:31:28 +02:00
dpkg-dev
2023-05-06 15:02:55 +02:00
libglib2.0-dev
2022-09-30 21:31:28 +02:00
libdbus-1-dev
libboost-dev
libprotobuf-dev
protobuf-compiler
libsqlite3-dev
libasound2-dev
libpulse-dev
libtag1-dev
libicu-dev
libgstreamer1.0-dev
libgstreamer-plugins-base1.0-dev
gstreamer1.0-alsa
gstreamer1.0-pulseaudio
libchromaprint-dev
2023-06-27 04:06:30 +02:00
libebur128-dev
2022-09-30 21:31:28 +02:00
libfftw3-dev
libcdio-dev
libmtp-dev
libgpod-dev
- name: Install Qt 5
2022-01-29 01:33:40 +01:00
if: matrix.debian_version == 'bullseye'
2022-09-30 21:31:28 +02:00
env:
DEBIAN_FRONTEND: noninteractive
2023-02-21 18:43:01 +01:00
run: apt install -y qtbase5-dev qtbase5-dev-tools qttools5-dev qttools5-dev-tools libqt5x11extras5-dev
2022-09-30 21:31:28 +02:00
- name: Install Qt 6
2022-01-29 01:33:40 +01:00
if: matrix.debian_version != 'bullseye'
2022-09-30 21:31:28 +02:00
env:
DEBIAN_FRONTEND: noninteractive
2023-02-21 18:43:01 +01:00
run: apt install -y qt6-base-dev qt6-base-dev-tools qt6-tools-dev qt6-tools-dev-tools qt6-l10n-tools
2023-05-06 15:02:55 +02:00
- name: Checkout
uses: actions/checkout@v4
2022-08-09 23:03:24 +02:00
with:
fetch-depth: 0
2023-10-21 05:43:48 +02:00
submodules: recursive
2022-04-20 01:23:02 +02:00
- name: Add safe git directory
2022-09-09 22:29:01 +02:00
run: git config --global --add safe.directory ${GITHUB_WORKSPACE}
2022-03-05 12:13:34 +01:00
- name: Create Build Environment
run: cmake -E make_directory build
- name: Configure CMake
2023-05-06 14:18:35 +02:00
run: cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug -DBUILD_WERROR=ON
2022-09-30 21:31:28 +02:00
- name: make deb
run: dpkg-buildpackage -b -d -uc -us -nc -j2
2023-05-06 15:02:55 +02:00
- name: Copy deb
run: cp ../*.deb .
- name: Upload artifacts
uses: actions/upload-artifact@v4
2023-05-06 15:02:55 +02:00
with:
name: debian-${{matrix.debian_version}}
path: "*.deb"
2021-02-27 14:58:34 +01:00
2022-08-09 23:03:24 +02:00
2023-05-06 15:02:55 +02:00
build-ubuntu:
2022-09-30 21:31:28 +02:00
name: Build Ubuntu
if: github.repository != 'strawberrymusicplayer/strawberry-private'
2021-10-09 00:26:05 +02:00
runs-on: ubuntu-latest
2022-09-30 21:31:28 +02:00
strategy:
fail-fast: false
matrix:
2024-01-30 18:42:32 +01:00
ubuntu_version: [ 'focal', 'jammy', 'mantic', 'noble' ]
2021-10-09 00:26:05 +02:00
container:
2022-09-30 21:31:28 +02:00
image: ubuntu:${{matrix.ubuntu_version}}
2021-10-09 00:26:05 +02:00
steps:
2024-03-31 23:09:19 +02:00
- name: Update packages
2023-02-21 18:43:01 +01:00
run: apt update -y
2024-03-31 23:09:19 +02:00
- name: Upgrade packages
run: apt upgrade -y
2022-09-30 21:31:28 +02:00
- name: Install packages
env:
DEBIAN_FRONTEND: noninteractive
2021-10-09 00:26:05 +02:00
run: >
2023-02-21 18:43:01 +01:00
apt install -y
2022-09-30 21:31:28 +02:00
build-essential
dh-make
2021-10-09 00:26:05 +02:00
git
make
cmake
2022-09-30 21:31:28 +02:00
pkg-config
2021-10-09 00:26:05 +02:00
gcc
2022-09-30 21:31:28 +02:00
g++
fakeroot
wget
curl
gettext
lsb-release
dpkg-dev
libglib2.0-dev
libboost-dev
libdbus-1-dev
libprotobuf-dev
protobuf-compiler
libsqlite3-dev
libasound2-dev
libpulse-dev
libtag1-dev
libicu-dev
libgstreamer1.0-dev
libgstreamer-plugins-base1.0-dev
libgstreamer-plugins-good1.0-dev
gstreamer1.0-alsa
gstreamer1.0-pulseaudio
libchromaprint-dev
2023-06-27 04:06:30 +02:00
libebur128-dev
2022-09-30 21:31:28 +02:00
libfftw3-dev
libcdio-dev
libmtp-dev
libgpod-dev
- name: Install Qt 5
2022-01-29 01:33:40 +01:00
if: matrix.ubuntu_version == 'focal'
2022-09-30 21:31:28 +02:00
env:
DEBIAN_FRONTEND: noninteractive
2023-02-21 18:43:01 +01:00
run: apt install -y qtbase5-dev qtbase5-dev-tools qttools5-dev qttools5-dev-tools libqt5x11extras5-dev
2022-09-30 21:31:28 +02:00
- name: Install Qt 6
2022-01-29 01:33:40 +01:00
if: matrix.ubuntu_version != 'focal'
2022-09-30 21:31:28 +02:00
env:
DEBIAN_FRONTEND: noninteractive
2023-02-21 18:43:01 +01:00
run: apt install -y qt6-base-dev qt6-base-dev-tools qt6-tools-dev qt6-tools-dev-tools qt6-l10n-tools
2023-05-06 15:02:55 +02:00
- name: Checkout
uses: actions/checkout@v4
2022-08-09 23:03:24 +02:00
with:
fetch-depth: 0
2023-10-21 05:43:48 +02:00
submodules: recursive
2022-04-20 01:23:02 +02:00
- name: Add safe git directory
2022-09-09 22:29:01 +02:00
run: git config --global --add safe.directory ${GITHUB_WORKSPACE}
2021-10-09 00:26:05 +02:00
- name: Create Build Environment
run: cmake -E make_directory build
- name: Configure CMake
2023-05-06 14:18:35 +02:00
run: cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug -DBUILD_WERROR=ON
2022-09-30 21:31:28 +02:00
- name: make deb
run: dpkg-buildpackage -b -d -uc -us -nc -j2
2023-05-06 15:02:55 +02:00
- name: Copy deb
run: cp ../*.deb ../*.ddeb .
- name: Upload artifacts
uses: actions/upload-artifact@v4
2023-05-06 15:02:55 +02:00
with:
name: ubuntu-${{matrix.ubuntu_version}}
path: |
*.deb
*.ddeb
2021-10-09 00:26:05 +02:00
2023-05-07 02:27:46 +02:00
upload-ubuntu-ppa:
name: Upload Ubuntu PPA
2024-02-11 01:19:39 +01:00
if: github.repository == 'strawberrymusicplayer/strawberry' && github.event.pull_request.head.repo.fork == false && (github.event_name == 'release' || (github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/ci')))
2023-05-07 02:27:46 +02:00
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
2024-01-30 18:42:32 +01:00
ubuntu_version: [ 'focal', 'jammy', 'mantic', 'noble' ]
2023-05-07 02:27:46 +02:00
container:
image: ubuntu:${{matrix.ubuntu_version}}
steps:
2024-03-31 23:09:19 +02:00
- name: Update packages
2023-05-07 02:27:46 +02:00
run: apt update -y
2024-03-31 23:09:19 +02:00
- name: Upgrade packages
run: apt upgrade -y
2023-05-07 02:27:46 +02:00
- name: Install packages
env:
DEBIAN_FRONTEND: noninteractive
run: >
apt install -y
git
build-essential
dh-make
make
cmake
pkg-config
gcc
g++
fakeroot
gettext
lsb-release
gpg
dput
dpkg-dev
libglib2.0-dev
libboost-dev
libdbus-1-dev
libprotobuf-dev
libsqlite3-dev
libasound2-dev
libpulse-dev
libtag1-dev
libicu-dev
libgstreamer1.0-dev
libgstreamer-plugins-base1.0-dev
libgstreamer-plugins-good1.0-dev
libchromaprint-dev
2023-06-27 04:06:30 +02:00
libebur128-dev
2023-05-07 02:27:46 +02:00
libfftw3-dev
libcdio-dev
libmtp-dev
libgpod-dev
gstreamer1.0-alsa
gstreamer1.0-pulseaudio
protobuf-compiler
2024-03-31 23:09:19 +02:00
- name: Install keyboxd
if: matrix.ubuntu_version == 'noble'
env:
DEBIAN_FRONTEND: noninteractive
run: apt install -y keyboxd
2023-05-07 02:27:46 +02:00
- name: Install Qt 5
if: matrix.ubuntu_version == 'focal'
env:
DEBIAN_FRONTEND: noninteractive
run: apt install -y qtbase5-dev qtbase5-dev-tools qttools5-dev qttools5-dev-tools libqt5x11extras5-dev
- name: Install Qt 6
if: matrix.ubuntu_version != 'focal'
env:
DEBIAN_FRONTEND: noninteractive
run: apt install -y qt6-base-dev qt6-base-dev-tools qt6-tools-dev qt6-tools-dev-tools qt6-l10n-tools
- name: Checkout
uses: actions/checkout@v4
2023-05-07 02:27:46 +02:00
with:
fetch-depth: 0
2023-10-21 05:43:48 +02:00
submodules: recursive
2023-05-07 02:27:46 +02:00
- 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: Configure CMake
run: cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug -DBUILD_WERROR=ON
- name: Delete build directory
run: rm -rf build
- name: Import Ubuntu PPA GPG private key
uses: crazy-max/ghaction-import-gpg@v6
2023-05-07 02:27:46 +02:00
with:
gpg_private_key: ${{secrets.UBUNTU_PPA_GPG_PRIVATE_KEY}}
- name: dpkg-buildpackage
run: dpkg-buildpackage -S -d -k573D197B5EA20EDF
2023-09-25 20:16:26 +02:00
- name: Upload Unstable PPA
2024-02-11 00:10:36 +01:00
if: github.event_name == 'push'
2023-09-25 20:16:26 +02:00
run: dput ppa:jonaski/strawberry-unstable ../*_source.changes
2023-05-07 02:27:46 +02:00
- name: Upload Stable PPA
2024-02-11 00:10:36 +01:00
if: github.event_name == 'release'
2023-07-12 14:22:15 +02:00
run: dput ppa:jonaski/strawberry ../*_source.changes
2023-05-07 02:27:46 +02:00
build-macos-public:
name: Build macOS Public
if: github.repository != 'strawberrymusicplayer/strawberry-private'
2023-09-07 19:48:41 +02:00
strategy:
fail-fast: false
matrix:
runner: [ 'macos-11' ]
2023-09-07 19:48:41 +02:00
buildtype: [ 'release' ]
runs-on: ${{ matrix.runner }}
2023-09-07 19:48:41 +02:00
steps:
- name: Set arch
shell: bash
run: echo "arch=$(uname -m)" >> $GITHUB_ENV
2023-09-07 19:48:41 +02:00
- name: Set buildtype
run: echo "buildtype=$(echo ${{matrix.buildtype}} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
- name: Set cmake buildtype
run: echo "cmake_buildtype=$(echo ${{env.buildtype}} | awk '{print toupper(substr($0,0,1))tolower(substr($0,2))}')" >> $GITHUB_ENV
- name: Uninstall homebrew
run: |
curl -sfLO https://raw.githubusercontent.com/Homebrew/install/master/uninstall.sh
chmod +x ./uninstall.sh
sudo ./uninstall.sh --force
rm -f uninstall.sh
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
2023-10-21 05:43:48 +02:00
submodules: recursive
2023-09-07 19:48:41 +02:00
- name: Import certificate file
if: github.repository == 'strawberrymusicplayer/strawberry' && github.event.pull_request.head.repo.fork == false
uses: apple-actions/import-codesign-certs@v2
with:
p12-file-base64: ${{ secrets.APPLE_DEVELOPER_ID_CERTIFICATE }}
p12-password: ${{ secrets.APPLE_DEVELOPER_ID_CERTIFICATE_PASSWORD }}
2023-10-15 06:28:38 +02:00
2023-09-07 19:48:41 +02:00
- name: Download macOS dependencies
run: curl -f -O -L https://github.com/strawberrymusicplayer/strawberry-macos-dependencies/releases/latest/download/strawberry-macos-${{env.arch}}-${{env.buildtype}}.tar.xz
2023-09-07 19:48:41 +02:00
- name: Extract macOS dependencies
run: sudo tar -C / -xf strawberry-macos-${{env.arch}}-${{env.buildtype}}.tar.xz
2023-09-07 19:48:41 +02:00
- name: Set prefix path
run: echo "prefix_path=/opt/strawberry_macos_${{env.arch}}_${{env.buildtype}}" >> $GITHUB_ENV
2023-09-07 19:48:41 +02:00
- name: Update PATH
run: echo "${{env.prefix_path}}/bin" >> $GITHUB_PATH
- name: Create Build Environment
run: cmake -E make_directory build
- name: Configure CMake
env:
MACOSX_DEPLOYMENT_TARGET: 11.0
PKG_CONFIG_PATH: ${{env.prefix_path}}/lib/pkgconfig
LDFLAGS: -L${{env.prefix_path}}/lib -Wl,-rpath,${{env.prefix_path}}/lib
run: >
cmake
--log-level="DEBUG"
-S .
-B build
-DCMAKE_BUILD_TYPE="${{env.cmake_buildtype}}"
2023-09-24 01:50:58 +02:00
-DCMAKE_PREFIX_PATH="${{env.prefix_path}}/lib/cmake"
2023-09-07 19:48:41 +02:00
-DBUILD_WITH_QT6=ON
-DBUILD_WERROR=OFF
-DUSE_BUNDLE=ON
-DENABLE_DBUS=OFF
-DICU_ROOT="${{env.prefix_path}}"
-DFFTW3_DIR="${{env.prefix_path}}"
-DAPPLE_DEVELOPER_ID=$(test '${{github.repository}}' = 'strawberrymusicplayer/strawberry' && test '${{github.event.pull_request.base.repo.full_name}}' = '${{github.event.pull_request.head.repo.full_name}}' && echo "383J84DVB6" || echo "")
2023-09-07 19:48:41 +02:00
- name: Build
run: cmake --build build --config Release --parallel 4
- name: Install
working-directory: build
run: make install
- name: Deploy
env:
GIO_EXTRA_MODULES: ${{env.prefix_path}}/lib/gio/modules
GST_PLUGIN_SCANNER: ${{env.prefix_path}}/libexec/gstreamer-1.0/gst-plugin-scanner
GST_PLUGIN_PATH: ${{env.prefix_path}}/lib/gstreamer-1.0
2023-10-14 03:29:14 +02:00
LIBSOUP_LIBRARY_PATH: ${{env.prefix_path}}/lib/libsoup-3.0.0.dylib
2023-09-07 19:48:41 +02:00
working-directory: build
run: make deploy
2024-01-26 18:58:10 +01:00
- name: Manually Codesign
if: github.repository == 'strawberrymusicplayer/strawberry' && github.event.pull_request.head.repo.fork == false
working-directory: build
2024-01-26 18:58:10 +01:00
run: codesign -s 383J84DVB6 -f strawberry.app/Contents/Frameworks/{libsoup-3.0.0.dylib,libnghttp2.14.dylib,libpsl.5.dylib,libpcre2-16.0.dylib,libpng16.16.dylib,libzstd.1.dylib} strawberry.app/Contents/Frameworks/png.framework/png strawberry.app
2023-09-07 19:48:41 +02:00
- name: Deploy check
working-directory: build
run: make deploycheck
2023-10-15 16:51:13 +02:00
- name: Verify code-signing
if: github.repository == 'strawberrymusicplayer/strawberry' && github.event.pull_request.head.repo.fork == false
2023-10-15 16:51:13 +02:00
working-directory: build
run: codesign --deep -v strawberry.app
2023-09-07 19:48:41 +02:00
- name: Create DMG
working-directory: build
run: make dmg
- name: SSH key setup
2024-02-11 12:12:54 +01:00
if: github.repository == 'strawberrymusicplayer/strawberry' && (github.event_name == 'release' || (github.event_name == 'push' && github.event.pull_request.head.repo.fork == false && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/ci' || github.ref == 'refs/heads/macos')))
2023-09-07 19:48:41 +02:00
uses: shimataro/ssh-key-action@v2
with:
known_hosts: ${{secrets.SSH_KNOWN_HOSTS}}
key: ${{ secrets.SSH_KEY }}
- name: Set Upload path
2024-02-11 12:12:54 +01:00
id: set-upload-path
if: github.repository == 'strawberrymusicplayer/strawberry' && (github.event_name == 'release' || (github.event_name == 'push' && github.event.pull_request.head.repo.fork == false && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/ci' || github.ref == 'refs/heads/macos')))
run: |
2024-02-11 00:10:36 +01:00
if [ "${{github.event_name}}" = "release" ]; then
2024-02-11 12:12:54 +01:00
echo "upload_path=${{secrets.DOWNLOADS_PATH}}/stable_releases/macos" >> $GITHUB_OUTPUT
else
2024-02-11 12:12:54 +01:00
echo "upload_path=${{secrets.DOWNLOADS_PATH}}/development_releases/macos" >> $GITHUB_OUTPUT
fi
2023-09-07 19:48:41 +02:00
- name: Create server path
2024-02-11 12:12:54 +01:00
if: steps.set-upload-path.outputs.upload_path != ''
run: ssh -p ${{secrets.SSH_PORT}} -o StrictHostKeyChecking=no ${{secrets.SSH_USER}}@${{secrets.SSH_HOST}} mkdir -p ${{steps.set-upload-path.outputs.upload_path}}
2023-09-07 19:48:41 +02:00
- name: rsync
2024-02-11 12:12:54 +01:00
if: steps.set-upload-path.outputs.upload_path != ''
run: rsync -e "ssh -p ${{secrets.SSH_PORT}} -o StrictHostKeyChecking=no" -var build/*.dmg ${{secrets.SSH_USER}}@${{secrets.SSH_HOST}}:${{steps.set-upload-path.outputs.upload_path}}/
2023-09-07 19:48:41 +02:00
build-macos-private:
name: Build macOS Private
if: github.repository == 'strawberrymusicplayer/strawberry-private'
strategy:
fail-fast: false
matrix:
runner: [ 'macos-arm64' ]
buildtype: [ 'release' ]
runs-on: ${{ matrix.runner }}
steps:
- name: Set arch
shell: bash
run: echo "arch=$(uname -m)" >> $GITHUB_ENV
- name: Set buildtype
run: echo "buildtype=$(echo ${{matrix.buildtype}} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
- name: Set cmake buildtype
run: echo "cmake_buildtype=$(echo ${{env.buildtype}} | awk '{print toupper(substr($0,0,1))tolower(substr($0,2))}')" >> $GITHUB_ENV
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive
- name: Unlock keychain
2023-10-22 21:13:28 +02:00
run: security unlock-keychain -p ${{ secrets.MACOS_KEYCHAIN_PASSWORD }}
- name: Set prefix path
run: echo "prefix_path=/opt/strawberry_macos_${{env.arch}}_${{env.buildtype}}" >> $GITHUB_ENV
- name: Update PATH
run: echo "${{env.prefix_path}}/bin" >> $GITHUB_PATH
- name: Create Build Environment
run: cmake -E make_directory build
- name: Configure CMake
env:
MACOSX_DEPLOYMENT_TARGET: 11.0
PKG_CONFIG_PATH: ${{env.prefix_path}}/lib/pkgconfig
LDFLAGS: -L${{env.prefix_path}}/lib -Wl,-rpath,${{env.prefix_path}}/lib
run: >
cmake
--log-level="DEBUG"
-S .
-B build
-DCMAKE_BUILD_TYPE="${{env.cmake_buildtype}}"
-DCMAKE_PREFIX_PATH="${{env.prefix_path}}/lib/cmake"
-DBUILD_WITH_QT6=ON
-DBUILD_WERROR=OFF
-DUSE_BUNDLE=ON
-DENABLE_DBUS=OFF
-DICU_ROOT="${{env.prefix_path}}"
-DFFTW3_DIR="${{env.prefix_path}}"
-DAPPLE_DEVELOPER_ID="383J84DVB6"
- name: Build
run: cmake --build build --config Release --parallel 4
- name: Install
working-directory: build
run: make install
- name: Deploy
env:
GIO_EXTRA_MODULES: ${{env.prefix_path}}/lib/gio/modules
GST_PLUGIN_SCANNER: ${{env.prefix_path}}/libexec/gstreamer-1.0/gst-plugin-scanner
GST_PLUGIN_PATH: ${{env.prefix_path}}/lib/gstreamer-1.0
LIBSOUP_LIBRARY_PATH: ${{env.prefix_path}}/lib/libsoup-3.0.0.dylib
working-directory: build
run: make deploy
- name: Manually Codesign
working-directory: build
run: codesign -s 383J84DVB6 -f strawberry.app/Contents/Frameworks/png.framework/png strawberry.app
- name: Deploy check
working-directory: build
run: make deploycheck
- name: Verify code-signing
working-directory: build
run: codesign --deep -v strawberry.app
- name: Create DMG
working-directory: build
run: make dmg
- name: Set Upload path
2024-02-11 12:12:54 +01:00
id: set-upload-path
run: |
2024-02-11 00:10:36 +01:00
if [ "${{github.event_name}}" = "release" ]; then
2024-02-11 12:12:54 +01:00
echo "upload_path=${{secrets.DOWNLOADS_PATH}}/stable_releases/macos" >> $GITHUB_OUTPUT
else
2024-02-11 12:12:54 +01:00
echo "upload_path=${{secrets.DOWNLOADS_PATH}}/development_releases/macos" >> $GITHUB_OUTPUT
fi
- name: Create server path
2024-02-11 12:12:54 +01:00
run: ssh -p ${{secrets.SSH_PORT}} -o StrictHostKeyChecking=no ${{secrets.SSH_USER}}@${{secrets.SSH_HOST}} mkdir -p ${{steps.set-upload-path.outputs.upload_path}}
- name: rsync
2024-02-11 12:12:54 +01:00
run: rsync -e "ssh -p ${{secrets.SSH_PORT}} -o StrictHostKeyChecking=no" -var build/*.dmg ${{secrets.SSH_USER}}@${{secrets.SSH_HOST}}:${{steps.set-upload-path.outputs.upload_path}}/
2022-09-30 21:31:28 +02:00
build-windows-mingw:
name: Build Windows MinGW
if: github.repository != 'strawberrymusicplayer/strawberry-private'
2022-09-30 21:31:28 +02:00
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
arch: [ 'i686', 'x86_64' ]
buildtype: [ 'debug', 'release' ]
2022-09-30 21:31:28 +02:00
container:
image: jonaski/strawberry-mxe-${{matrix.arch}}-${{matrix.buildtype}}
2022-09-30 21:31:28 +02:00
steps:
- name: Set cmake buildtype
shell: bash
run: echo "cmake_buildtype=$(echo ${{matrix.buildtype}} | sed 's/.*/\u&/')" >> $GITHUB_ENV
2023-05-06 15:02:55 +02:00
- name: Checkout
uses: actions/checkout@v4
2022-09-30 21:31:28 +02:00
with:
fetch-depth: 0
2023-10-21 05:43:48 +02:00
submodules: recursive
2022-02-08 22:00:55 +01:00
2022-04-20 01:23:02 +02:00
- name: Add safe git directory
2022-09-09 22:29:01 +02:00
run: git config --global --add safe.directory ${GITHUB_WORKSPACE}
2022-04-20 01:23:02 +02:00
2022-02-08 22:00:55 +01:00
- name: Create Build Environment
run: cmake -E make_directory build
2022-09-30 21:31:28 +02:00
- name: Link MXE directory
run: ln -s /strawberry-mxe ~/mxe-shared
2022-02-08 22:00:55 +01:00
- name: Run CMake
2022-09-30 21:31:28 +02:00
env:
PKG_CONFIG_PATH: /strawberry-mxe/usr/${{matrix.arch}}-w64-mingw32.shared/lib/pkgconfig
2022-02-08 22:00:55 +01:00
run: >
2023-05-06 14:18:35 +02:00
cmake
-S .
-B build
2022-09-30 21:31:28 +02:00
-DCMAKE_TOOLCHAIN_FILE="../cmake/Toolchain-${{matrix.arch}}-w64-mingw32-shared.cmake"
-DCMAKE_BUILD_TYPE="${{env.cmake_buildtype}}"
2022-09-30 21:31:28 +02:00
-DCMAKE_PREFIX_PATH="/strawberry-mxe/usr/${{matrix.arch}}-w64-mingw32.shared/qt6"
2022-02-08 22:00:55 +01:00
-DBUILD_WITH_QT6=ON
-DBUILD_WERROR=OFF
2022-09-30 21:31:28 +02:00
-DARCH="${{matrix.arch}}"
-DENABLE_WIN32_CONSOLE=$(test "${{matrix.buildtype}}" = "debug" && echo "ON" || echo "OFF")
2022-09-30 21:31:28 +02:00
-DENABLE_DBUS=OFF
-DENABLE_LIBGPOD=OFF
-DENABLE_LIBMTP=OFF
-DENABLE_AUDIOCD=OFF
-DProtobuf_PROTOC_EXECUTABLE="/strawberry-mxe/usr/x86_64-pc-linux-gnu/bin/protoc"
2022-02-08 22:00:55 +01:00
- name: Run Make
run: cmake --build build --config "${{env.cmake_buildtype}}" --parallel $(nproc)
2022-08-13 20:40:31 +02:00
- name: Create directories
working-directory: build
2022-09-30 21:31:28 +02:00
run: mkdir -p gio-modules platforms sqldrivers tls imageformats styles gstreamer-plugins nsisplugins
2022-08-13 20:40:31 +02:00
- name: Copy GIO modules
working-directory: build
2022-09-30 21:31:28 +02:00
run: cp /strawberry-mxe/usr/${{matrix.arch}}-w64-mingw32.shared/lib/gio/modules/{libgiognutls.dll,libgioopenssl.dll} ${GITHUB_WORKSPACE}/build/gio-modules/
2022-08-13 20:40:31 +02:00
- name: Copy Qt platform plugins
working-directory: build
2022-09-30 21:31:28 +02:00
run: cp /strawberry-mxe/usr/${{matrix.arch}}-w64-mingw32.shared/qt6/plugins/platforms/qwindows.dll ${GITHUB_WORKSPACE}/build/platforms/
2022-08-13 20:40:31 +02:00
- 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/
2022-08-13 20:40:31 +02:00
- name: Copy Qt TLS plugins
working-directory: build
2022-09-30 21:31:28 +02:00
run: cp /strawberry-mxe/usr/${{matrix.arch}}-w64-mingw32.shared/qt6/plugins/tls/{qschannelbackend.dll,qopensslbackend.dll} ${GITHUB_WORKSPACE}/build/tls/
2022-08-13 20:40:31 +02:00
- name: Copy Qt SQL drivers
working-directory: build
2022-09-30 21:31:28 +02:00
run: cp /strawberry-mxe/usr/${{matrix.arch}}-w64-mingw32.shared/qt6/plugins/sqldrivers/qsqlite.dll ${GITHUB_WORKSPACE}/build/sqldrivers/
2022-08-13 20:40:31 +02:00
2022-09-30 21:31:28 +02:00
- name: Copy Qt imageformats
2022-08-13 20:40:31 +02:00
working-directory: build
2022-09-30 21:31:28 +02:00
run: cp /strawberry-mxe/usr/${{matrix.arch}}-w64-mingw32.shared/qt6/plugins/imageformats/{qgif.dll,qico.dll,qjpeg.dll} ${GITHUB_WORKSPACE}/build/imageformats/
2022-08-13 20:40:31 +02:00
- 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/
2022-08-13 20:40:31 +02:00
2022-09-30 21:31:28 +02:00
- name: Copy extra binaries
2022-08-13 20:40:31 +02:00
working-directory: build
2023-07-18 21:28:39 +02:00
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} .
2022-08-13 20:40:31 +02:00
- 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} .
2022-08-13 20:40:31 +02:00
- name: Copy dependencies
working-directory: build
run: >
2022-09-30 21:31:28 +02:00
/strawberry-mxe/tools/copydlldeps.sh
2022-08-13 20:40:31 +02:00
-c
-d .
-F .
-F ./platforms
-F ./styles
2022-09-30 21:31:28 +02:00
-F ./imageformats
2022-08-13 20:40:31 +02:00
-F ./tls
-F ./sqldrivers
-F ./gstreamer-plugins
2022-09-30 21:31:28 +02:00
-R /strawberry-mxe/usr/${{matrix.arch}}-w64-mingw32.shared
2022-08-13 20:40:31 +02:00
2022-09-30 21:31:28 +02:00
- name: Strip binaries
if: matrix.buildtype == 'release'
2022-08-13 20:40:31 +02:00
working-directory: build
2022-09-30 21:31:28 +02:00
run: find . -type f \( -iname \*.dll -o -iname \*.exe \) -exec /strawberry-mxe/usr/bin/${{matrix.arch}}-w64-mingw32.shared-strip {} \;
2022-08-13 20:40:31 +02:00
2023-05-01 17:26:12 +02:00
- name: Strip gdb.exe
if: matrix.buildtype == 'debug'
2023-05-01 17:26:12 +02:00
working-directory: build
run: /strawberry-mxe/usr/bin/${{matrix.arch}}-w64-mingw32.shared-strip gdb.exe
2022-09-30 21:31:28 +02:00
- name: Copy nsis files
2022-08-13 20:40:31 +02:00
working-directory: build
2022-09-30 21:31:28 +02:00
run: cp ${GITHUB_WORKSPACE}/dist/windows/*.nsi ${GITHUB_WORKSPACE}/dist/windows/*.nsh ${GITHUB_WORKSPACE}/dist/windows/*.ico .
2022-08-13 20:40:31 +02:00
2022-09-30 21:31:28 +02:00
- name: Copy COPYING license file
2022-08-13 20:40:31 +02:00
working-directory: build
2022-09-30 21:31:28 +02:00
run: cp ${GITHUB_WORKSPACE}/COPYING .
2022-08-13 20:40:31 +02:00
2023-08-09 19:40:51 +02:00
- 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
2022-09-30 21:31:28 +02:00
- name: Build Windows installer
2022-02-08 22:00:55 +01:00
working-directory: build
2022-08-13 20:40:31 +02:00
run: makensis strawberry.nsi
2023-05-06 15:02:55 +02:00
- name: Upload artifacts
uses: actions/upload-artifact@v4
2023-05-06 15:02:55 +02:00
with:
2024-01-01 04:50:23 +01:00
name: windows-mingw-${{matrix.arch}}-${{matrix.buildtype}}
2023-05-06 15:02:55 +02:00
path: build/StrawberrySetup*.exe
2022-08-13 20:40:31 +02:00
2022-09-30 21:31:28 +02:00
build-windows-msvc:
name: Build Windows MSVC
if: github.repository != 'strawberrymusicplayer/strawberry-private'
runs-on: windows-2022
2022-09-30 21:31:28 +02:00
strategy:
fail-fast: false
matrix:
arch: [ 'x86', 'x86_64' ]
buildtype: [ 'debug', 'release' ]
2022-08-13 20:40:31 +02:00
steps:
2023-05-07 05:25:47 +02:00
- name: Set prefix path
2023-05-06 15:02:55 +02:00
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
2022-08-13 20:40:31 +02:00
- name: Create downloads directory
shell: cmd
run: mkdir downloads
2022-08-13 20:40:31 +02:00
- 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
2022-08-13 20:40:31 +02:00
2023-05-07 05:25:47 +02:00
- name: Extract Windows MSVC dependencies
shell: bash
working-directory: downloads
run: tar -C /c -xf strawberry-msvc-${{matrix.arch}}-${{matrix.buildtype}}.tar.xz
2023-05-07 05:25:47 +02:00
- 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
2023-10-19 23:25:06 +02:00
run: rm -rf /c/msys64 /c/mingw32 /c/mingw64 /c/strawberry/c "/c/program files/OpenSSL" "/c/program files/postgresql"
2023-05-07 05:25:47 +02:00
- 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
2023-05-07 05:25:47 +02:00
- 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
2022-08-13 20:40:31 +02:00
- name: Extract NSIS LockedList plugin
shell: cmd
working-directory: downloads
run: 7z x LockedList.zip
2022-08-13 20:40:31 +02:00
- 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
2022-08-13 20:40:31 +02:00
- name: Extract NSIS Registry plugin
shell: cmd
working-directory: downloads
run: 7z x Registry.zip
2022-08-13 20:40:31 +02:00
- 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
2022-08-13 20:40:31 +02:00
- name: Extract NSIS Inetc plugin
shell: cmd
working-directory: downloads
run: 7z x Inetc.zip
2022-08-13 20:40:31 +02:00
- name: Install NSIS plugins
shell: cmd
working-directory: downloads
2022-08-13 20:40:31 +02:00
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\"
2022-08-13 20:40:31 +02:00
2023-05-07 05:25:47 +02:00
- name: Setup MSVC Environment
uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{matrix.arch}}
sdk: 10.0.20348.0
2024-02-23 21:59:06 +01:00
vsversion: 2022
2023-05-07 05:25:47 +02:00
toolset: 14.3
2022-08-13 20:40:31 +02:00
2023-05-07 05:25:47 +02:00
- name: Checkout
uses: actions/checkout@v4
2023-05-07 05:25:47 +02:00
with:
fetch-depth: 0
2023-10-21 05:43:48 +02:00
submodules: recursive
2022-08-13 20:40:31 +02:00
- name: Add safe git directory
shell: bash
2022-09-09 22:29:01 +02:00
run: git config --global --add safe.directory ${GITHUB_WORKSPACE}
2022-08-13 20:40:31 +02:00
- name: Create Build Environment
shell: cmd
2022-08-13 20:40:31 +02:00
run: cmake -E make_directory build
2022-09-30 21:31:28 +02:00
- name: Set ENABLE_WIN32_CONSOLE (debug)
2022-10-01 01:40:32 +02:00
if: matrix.build_type == 'debug'
2022-09-30 21:31:28 +02:00
shell: bash
run: echo "win32_console=ON" >> $GITHUB_ENV
- name: Set ENABLE_WIN32_CONSOLE (release)
2022-10-01 01:40:32 +02:00
if: matrix.build_type == 'release'
2022-09-30 21:31:28 +02:00
shell: bash
run: echo "win32_console=OFF" >> $GITHUB_ENV
2022-08-13 20:40:31 +02:00
- name: Run CMake
shell: cmd
2022-08-13 20:40:31 +02:00
run: >
2023-05-06 14:18:35 +02:00
cmake
-S .
-B build
2022-08-13 20:40:31 +02:00
-G "Ninja"
-DCMAKE_BUILD_TYPE="${{env.cmake_buildtype}}"
2023-05-07 05:25:47 +02:00
-DCMAKE_PREFIX_PATH="${{env.prefix_path_forwardslash}}/lib/cmake"
2022-08-13 20:40:31 +02:00
-DBUILD_WITH_QT6=ON
2022-09-30 21:31:28 +02:00
-DARCH="${{matrix.arch}}"
-DENABLE_WIN32_CONSOLE=${{env.win32_console}}
2022-08-13 20:40:31 +02:00
-DUSE_TAGLIB=ON
2023-05-07 05:25:47 +02:00
-DPKG_CONFIG_EXECUTABLE="${{env.prefix_path_forwardslash}}/bin/pkg-config.exe"
-DICU_ROOT="${{env.prefix_path_forwardslash}}"
2024-02-23 22:57:00 +01:00
-DFFTW3_DIR="${{env.prefix_path_forwardslash}}"
2022-08-13 20:40:31 +02:00
- name: Run Make
shell: cmd
2022-08-13 20:40:31 +02:00
env:
CL: "/MP"
run: cmake --build build --config "${{env.cmake_buildtype}}" --parallel 4
2022-08-13 20:40:31 +02:00
2022-02-08 22:00:55 +01:00
- name: Copy extra binaries
shell: cmd
2022-02-08 22:00:55 +01:00
working-directory: build
run: |
2023-05-07 05:25:47 +02:00
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
2023-07-18 21:28:39 +02:00
copy ${{env.prefix_path_backslash}}\bin\gst-play-1.0.exe
2023-05-07 05:25:47 +02:00
copy ${{env.prefix_path_backslash}}\bin\gst-discoverer-1.0.exe
copy ${{env.prefix_path_backslash}}\bin\sqlite3.exe
2022-02-08 22:00:55 +01:00
- name: Create directories
shell: cmd
2022-02-08 22:00:55 +01:00
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
2022-02-08 22:00:55 +01:00
working-directory: build
2023-05-07 05:25:47 +02:00
run: copy ${{env.prefix_path_backslash}}\lib\gio\modules\*.dll .\gio-modules\
2022-02-08 22:00:55 +01:00
- name: Copy Qt platform plugins
shell: cmd
2022-02-08 22:00:55 +01:00
working-directory: build
2023-05-07 05:25:47 +02:00
run: copy ${{env.prefix_path_backslash}}\plugins\platforms\qwindows*.dll .\platforms\
2022-02-08 22:00:55 +01:00
- name: Copy Qt styles
shell: cmd
2022-02-08 22:00:55 +01:00
working-directory: build
run: copy ${{env.prefix_path_backslash}}\plugins\styles\qmodernwindowsstyle*.dll .\styles\
2022-02-08 22:00:55 +01:00
- name: Copy Qt TLS plugins
shell: cmd
2022-02-08 22:00:55 +01:00
working-directory: build
2023-05-07 05:25:47 +02:00
run: copy ${{env.prefix_path_backslash}}\plugins\tls\*.dll .\tls\
2022-02-08 22:00:55 +01:00
- name: Copy Qt SQL drivers
shell: cmd
2022-02-08 22:00:55 +01:00
working-directory: build
2023-05-07 05:25:47 +02:00
run: copy ${{env.prefix_path_backslash}}\plugins\sqldrivers\qsqlite*.dll .\sqldrivers\
2022-02-08 22:00:55 +01:00
- name: Copy Qt imageformats plugins
shell: cmd
2022-02-08 22:00:55 +01:00
working-directory: build
2023-05-07 05:25:47 +02:00
run: copy ${{env.prefix_path_backslash}}\plugins\imageformats\*.dll .\imageformats\
2022-02-08 22:00:55 +01:00
- name: Copy gstreamer plugins
shell: cmd
2022-02-08 22:00:55 +01:00
working-directory: build
run: copy ${{env.prefix_path_backslash}}\lib\gstreamer-1.0\*.dll .\gstreamer-plugins\
2022-02-08 22:00:55 +01:00
- 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
2022-02-08 22:00:55 +01:00
- 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
2023-05-07 05:25:47 +02:00
-R ${{env.prefix_path_unix}}/bin
2022-02-08 22:00:55 +01:00
- name: Copy nsis files
shell: cmd
2022-02-08 22:00:55 +01:00
working-directory: build
run: |
copy ..\dist\windows\*.nsi .
copy ..\dist\windows\*.nsh .
copy ..\dist\windows\*.ico .
- name: Copy COPYING license file
shell: cmd
2022-02-08 22:00:55 +01:00
working-directory: build
run: copy ..\COPYING .
2023-05-07 05:25:47 +02:00
- name: List files
shell: cmd
2022-02-08 22:00:55 +01:00
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
2022-02-08 22:00:55 +01:00
- name: Create nsis installer
shell: cmd
2022-02-08 22:00:55 +01:00
working-directory: build
run: makensis strawberry.nsi
2023-05-06 15:02:55 +02:00
- name: Upload artifacts
uses: actions/upload-artifact@v4
2022-02-08 22:00:55 +01:00
with:
2024-01-01 04:50:23 +01:00
name: windows-msvc-${{matrix.arch}}-${{matrix.buildtype}}
2022-02-08 22:00:55 +01:00
path: build/StrawberrySetup*.exe
2020-08-26 22:35:18 +02:00
2024-02-11 12:12:54 +01:00
upload:
name: Upload
if: (success() || failure()) && github.repository == 'strawberrymusicplayer/strawberry' && (github.event_name == 'release' || (github.event_name == 'push' && github.event.pull_request.head.repo.fork == false && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/ci')))
runs-on: ubuntu-latest
2022-02-08 22:00:55 +01:00
needs:
2024-02-11 12:12:54 +01:00
- build-opensuse
- build-fedora
- build-debian
- build-ubuntu
- build-windows-mingw
2022-09-30 21:31:28 +02:00
- build-windows-msvc
2022-02-08 22:00:55 +01:00
steps:
2024-02-11 12:12:54 +01:00
- name: Install packages
env:
DEBIAN_FRONTEND: noninteractive
run: sudo apt install -y git rsync
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
2023-05-06 15:02:55 +02:00
- name: Download artifacts
uses: actions/download-artifact@v4
2022-02-08 22:00:55 +01:00
with:
2024-02-11 12:12:54 +01:00
path: artifacts
2023-05-06 15:02:55 +02:00
- name: SSH key setup
2022-02-08 22:00:55 +01:00
uses: shimataro/ssh-key-action@v2
with:
2023-05-06 15:02:55 +02:00
known_hosts: ${{secrets.SSH_KNOWN_HOSTS}}
key: ${{secrets.SSH_KEY}}
2024-02-11 12:12:54 +01:00
- name: Upload
run: |
for i in $(find artifacts -type f); do
if [ "${{github.event_name}}" = "release" ]; then
upload_path="${{secrets.RELEASES_PATH}}/"
else
distro=$(echo "$i" | cut -d '/' -f 2)
2024-02-11 12:17:04 +01:00
if [ "$(echo "$i" | grep '-' || true)" = "" ]; then
2024-02-11 12:12:54 +01:00
upload_path="${{secrets.BUILDS_PATH}}/${distro}/"
else
distro_name=$(echo "${distro}" | cut -d '-' -f 1)
distro_version=$(echo "${distro}" | cut -d '-' -f 2)
upload_path="${{secrets.BUILDS_PATH}}/${distro_name}/${distro_version}/"
fi
fi
ssh -p ${{secrets.SSH_PORT}} -o StrictHostKeyChecking=no ${{secrets.SSH_USER}}@${{secrets.SSH_HOST}} mkdir -p ${upload_path}
rsync -e "ssh -p ${{secrets.SSH_PORT}} -o StrictHostKeyChecking=no" -var $i ${{secrets.SSH_USER}}@${{secrets.SSH_HOST}}:${upload_path}/
done
2023-05-07 02:24:39 +02:00
2024-02-11 12:12:54 +01:00
attach:
name: Attach to release
if: (success() || failure()) && github.event_name == 'release'
runs-on: ubuntu-latest
2023-05-07 02:24:39 +02:00
needs:
- build-opensuse
- build-fedora
2024-04-06 21:10:49 +02:00
- build-mageia
2023-05-07 02:24:39 +02:00
- build-debian
- build-ubuntu
- build-windows-mingw
- build-windows-msvc
steps:
2023-10-11 17:37:47 +02:00
- name: Install packages
env:
DEBIAN_FRONTEND: noninteractive
2024-02-24 01:18:02 +01:00
run: sudo apt install -y git jq gh
2023-05-07 02:24:39 +02:00
- name: Checkout
uses: actions/checkout@v4
2023-05-07 02:24:39 +02:00
with:
fetch-depth: 0
- name: Show release assets
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
2024-02-24 01:18:02 +01:00
run: gh release view "${{github.event.release.tag_name}}" --json assets | jq -r '.assets[].name'
2023-05-07 02:24:39 +02:00
- name: Download artifacts
uses: actions/download-artifact@v4
2023-05-07 02:24:39 +02:00
with:
path: artifacts
- name: Add artifacts to release
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
run: |
2024-02-11 01:19:39 +01:00
echo "Release version: ${{github.event.release.tag_name}}"
filenames=()
2024-02-24 01:18:02 +01:00
files=()
2023-05-07 02:24:39 +02:00
for i in $(find artifacts -type f); do
filename=$(basename $i)
if [[ ${filenames[@]} =~ ${filename} ]]; then
echo "Skipping duplicate file: ${filename}"
continue
fi
filenames+=("${filename}")
2024-02-24 01:18:02 +01:00
existing_asset=$(gh release view "${{github.event.release.tag_name}}" --json assets | jq -r '.assets[].name' | tr -d '[:blank:]' | grep ".*/${filename}\$" 2>/dev/null || true)
2023-05-07 02:24:39 +02:00
if [ "${existing_asset}" = "" ]; then
echo "Adding file: ${filename}"
2024-02-24 01:18:02 +01:00
files+=("${i}")
2023-05-07 02:24:39 +02:00
else
echo "Release already has file: ${filename}"
2023-05-07 02:24:39 +02:00
fi
done
2024-02-24 01:18:02 +01:00
files_list="${files[@]}"
if ! [ "${files_list}" = "" ]; then
2024-02-11 12:12:54 +01:00
echo "Adding files to GitHub release"
2024-02-24 01:18:02 +01:00
gh release upload "${{github.event.release.tag_name}}" ${files_list}
2023-05-07 02:24:39 +02:00
fi