Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Snap build/publish Github action #6805

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/workflows/all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ jobs:
- build_focal_64
- build_mac
- build_mingw
- build_snap
- build_source
- build_stretch_64
steps:
Expand Down Expand Up @@ -740,6 +741,24 @@ jobs:
with:
name: release_focal_64
path: bin/clementine_*.deb

build_snap:
name: Build Snap
runs-on: ubuntu-18.04
steps:
- uses: actions/[email protected]
- uses: snapcore/action-build@v1
id: snapcraft
- uses: snapcore/action-publish@v1
if: github.ref == 'refs/heads/master'
with:
store_login: ${{ secrets.SNAP_STORE_LOGIN }}
snap: ${{ steps.snapcraft.outputs.snap }}
release: edge
- uses: actions/upload-artifact@v2
with:
name: release_snap
path: ${{ steps.snapcraft.outputs.snap }}

build_mac:
name: Build Mac DMG
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,4 @@ dist/windows/Python27.zip
src/translations/translations.pot
*.DS_Store
.vscode
*.snap
47 changes: 35 additions & 12 deletions snap/snapcraft.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: clementine
version: '1.3.1.31+git'
adopt-info: clementine
summary: modern music player
description: |
Clementine is a modern music player and library organizer
Expand All @@ -8,8 +8,12 @@ grade: stable
confinement: strict
base: core18

parts:
architectures:
- build-on: amd64
- build-on: i386
- build-on: arm64

parts:
desktop-qt5:
build-packages:
- build-essential
Expand Down Expand Up @@ -37,7 +41,6 @@ parts:
- oxygen-icon-theme
- breeze-icon-theme
- try: [appmenu-qt5]

alsa-lib:
plugin: autotools
source: https://www.alsa-project.org/files/pub/lib/alsa-lib-1.1.5.tar.bz2
Expand All @@ -60,11 +63,10 @@ parts:
- -usr/share/alsa/alsa.conf
- -usr/share/alsa/pcm
- -usr/share/alsa/topology/broadwell

clementine:
plugin: cmake
source-type: git
source: https://github.com/clementine-player/Clementine
source: .
after:
- alsa-lib
- desktop-qt5
Expand All @@ -74,7 +76,7 @@ parts:
make DESTDIR=$SNAPCRAFT_PART_INSTALL install
sed -i 's|Icon=clementine|Icon=/usr/share/icons/hicolor/scalable/apps/clementine\.svg|' $SNAPCRAFT_PART_INSTALL/usr/share/applications/clementine.desktop
sed -i 's|TryExec=.*|TryExec=/snap/bin/clementine|' $SNAPCRAFT_PART_INSTALL/usr/share/applications/clementine.desktop

snapcraftctl set-version "$(cat $SNAPCRAFT_PART_BUILD/src/version.h | grep CLEMENTINE_VERSION_DISPLAY | awk '{ print $3 }' | tr -d '"' | cut -d "-" -f1-2)"
build-packages:
- cmake
- make
Expand Down Expand Up @@ -110,7 +112,6 @@ parts:
- libglew-dev
- libcrypto++-dev
- libsparsehash-dev

stage-packages:
- libstdc++6
- libgcc1
Expand Down Expand Up @@ -166,14 +167,37 @@ parts:
- gstreamer1.0-libav
- dbus-x11
- projectm-data
- qtwayland5
- libqtcore4 # Attempt to get Spotify to work
- glibc-source # Attempt to get Spotify to work
- plasma-integration
- kde-style-breeze
- qt5-gtk-platformtheme

plugs:
gtk-3-themes:
interface: content
target: $SNAP/data-dir/themes
default-provider: gtk-common-themes
icon-themes:
interface: content
target: $SNAP/data-dir/icons
default-provider: gtk-common-themes
sound-themes:
interface: content
target: $SNAP/data-dir/sounds
default-provider: gtk-common-themes

apps:
clementine:
command: desktop-launch $SNAP/usr/bin/clementine
command: bin/desktop-launch $SNAP/usr/bin/clementine
desktop: usr/share/applications/clementine.desktop
environment:
ALSA_CONFIG_PATH: /snap/$SNAPCRAFT_PROJECT_NAME/current/usr/share/alsa/alsa.conf
LD_LIBRARY_PATH: $LD_LIBRARY_PATH:$SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/pulseaudio
DISABLE_WAYLAND: 1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems counter to the attempt at wayland support above.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs to stay.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is needed for clementine to run as an XWayland app when in a wayland session. Without this environment variable, clementine looks like this in Wayland:
Screenshot from 2020-10-06 19-42-12
With the environment variable set in Wayland (running on XWayland) :
Screenshot from 2020-10-06 19-44-48
As you can see the XWayland app keeps the GTK theming and cursor theme.

KDE_FORK_SLAVES: 1
PATH: "$PATH:$SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/libexec/kf5"
plugs:
- home
- udisks2
Expand All @@ -185,7 +209,7 @@ apps:
- x11
- wayland
- alsa
- pulseaudio
- audio-playback
- removable-media
- optical-drive
- raw-usb
Expand All @@ -194,10 +218,9 @@ apps:
- unity7
slots:
- mpris

clementine-tagreader:
command: clementine-tagreader
command: usr/bin/clementine-tagreader
plugs:
- network
- network-manager-observe
- network-bind
- network-bind