summaryrefslogtreecommitdiff
path: root/.github/workflows
diff options
context:
space:
mode:
Diffstat (limited to '.github/workflows')
-rwxr-xr-x.github/workflows/archlinux.sh44
-rwxr-xr-x.github/workflows/builds.sh38
-rw-r--r--.github/workflows/builds.yml77
-rwxr-xr-x.github/workflows/debian.sh53
-rwxr-xr-x.github/workflows/fedora.sh43
-rw-r--r--.github/workflows/release.yml26
-rwxr-xr-x.github/workflows/ubuntu.sh53
7 files changed, 334 insertions, 0 deletions
diff --git a/.github/workflows/archlinux.sh b/.github/workflows/archlinux.sh
new file mode 100755
index 0000000..3ebcf03
--- /dev/null
+++ b/.github/workflows/archlinux.sh
@@ -0,0 +1,44 @@
+#!/usr/bin/bash
+
+set -eo pipefail
+
+# Use grouped output messages
+infobegin() {
+ echo "::group::${1}"
+}
+infoend() {
+ echo "::endgroup::"
+}
+
+# Required packages on Archlinux
+requires=(
+ ccache # Use ccache to speed up build
+ clang # Build with clang on Archlinux
+)
+
+# https://gitlab.archlinux.org/archlinux/packaging/packages/mate-session-manager
+requires+=(
+ autoconf-archive
+ dbus-glib
+ gcc
+ gettext
+ git
+ glib2-devel
+ gtk3
+ libsm
+ make
+ mate-common
+ mate-desktop
+ python
+ systemd
+ which
+ xtrans
+)
+
+infobegin "Update system"
+pacman --noconfirm -Syu
+infoend
+
+infobegin "Install dependency packages"
+pacman --noconfirm -S ${requires[@]}
+infoend
diff --git a/.github/workflows/builds.sh b/.github/workflows/builds.sh
new file mode 100755
index 0000000..b192d97
--- /dev/null
+++ b/.github/workflows/builds.sh
@@ -0,0 +1,38 @@
+#!/usr/bin/bash
+
+set -e
+set -o pipefail
+
+CPUS=$(grep processor /proc/cpuinfo | wc -l)
+
+# Use grouped output messages
+infobegin() {
+ echo "::group::${1}"
+}
+infoend() {
+ echo "::endgroup::"
+}
+
+if [ -f autogen.sh ]; then
+ infobegin "Configure (autotools)"
+ NOCONFIGURE=1 ./autogen.sh
+ ./configure --prefix=/usr --enable-compile-warnings=maximum || {
+ cat config.log
+ exit 1
+ }
+ infoend
+
+ infobegin "Build (autotools)"
+ make -j ${CPUS}
+ infoend
+
+ infobegin "Check (autotools)"
+ make -j ${CPUS} check || {
+ true
+ }
+ infoend
+
+ infobegin "Distcheck (autotools)"
+ make -j ${CPUS} distcheck
+ infoend
+fi
diff --git a/.github/workflows/builds.yml b/.github/workflows/builds.yml
new file mode 100644
index 0000000..22eb58f
--- /dev/null
+++ b/.github/workflows/builds.yml
@@ -0,0 +1,77 @@
+name: CI Build
+
+on:
+ push:
+ branches:
+ - master
+ pull_request:
+ branches:
+ - master
+ workflow_dispatch:
+
+# cancel already running builds of the same branch or pull request
+concurrency:
+ group: ci-${{ github.workflow }}-${{ github.event.pull_request.number || github.head_ref || github.sha }}
+ cancel-in-progress: true
+
+
+jobs:
+ build:
+ name: Build on ${{matrix.container}} (using ${{matrix.cc}})
+ runs-on: ubuntu-latest
+ container:
+ image: ${{matrix.container}}
+
+ strategy:
+ fail-fast: false # don't cancel other jobs in the matrix if one fails
+ matrix:
+ container:
+ [
+ "debian:testing",
+ "fedora:latest",
+ "ubuntu:rolling",
+ "archlinux:latest",
+ ]
+ cc: ["gcc"]
+ cxx: ["g++"]
+ include:
+ - container: "archlinux:latest"
+ cc: "clang"
+ cxx: "clang++"
+
+ env:
+ # Speed up build with ccache
+ CC: ccache ${{ matrix.cc }}
+ CXX: ccache ${{ matrix.cxx }}
+ CONTAINER: ${{ matrix.container }}
+
+ steps:
+ - name: Setup environment variables
+ id: distro-name
+ shell: bash
+ run: |
+ split=(${CONTAINER//:/ })
+ distro=${split[0]}
+ short_sha=${SHA:0:8}
+ echo "DISTRO=$distro" | tee -a $GITHUB_ENV
+ - name: Install git command
+ shell: bash
+ run: |
+ echo "::group::Install git ..."
+ apt-get update -qq && apt-get install --assume-yes git || true
+ dnf update -y && dnf install -y git || true
+ pacman --noconfirm -Sy git || true
+ echo "::endgroup::"
+ - name: Repository checkout
+ uses: actions/checkout@v5
+ with:
+ submodules: "true"
+ - name: Install dependency packages
+ run: .github/workflows/${{ env.DISTRO }}.sh
+ - name: Enable ccache to speed up builds
+ uses: hendrikmuhs/[email protected]
+ with:
+ key: ${{ env.DISTRO }}-${{ matrix.cc }}
+
+ - name: Build the source code
+ run: .github/workflows/builds.sh
diff --git a/.github/workflows/debian.sh b/.github/workflows/debian.sh
new file mode 100755
index 0000000..3592010
--- /dev/null
+++ b/.github/workflows/debian.sh
@@ -0,0 +1,53 @@
+#!/usr/bin/bash
+
+set -eo pipefail
+
+# Use grouped output messages
+infobegin() {
+ echo "::group::${1}"
+}
+infoend() {
+ echo "::endgroup::"
+}
+
+# Required packages on Debian
+requires=(
+ ccache # Use ccache to speed up build
+)
+
+requires+=(
+ autoconf-archive
+ autopoint
+ gcc
+ git
+ intltool
+ libdbus-glib-1-dev
+ libgl1-mesa-dev
+ libgles2-mesa-dev
+ libglib2.0-dev
+ libgtk-3-dev
+ libice-dev
+ libsm-dev
+ libstartup-notification0-dev
+ libsystemd-dev
+ libx11-dev
+ libxau-dev
+ libxext-dev
+ libxrender-dev
+ libxt-dev
+ libxtst-dev
+ make
+ mate-common
+ xmlto
+ xsltproc
+)
+
+infobegin "Update system"
+apt-get update -qq
+infoend
+
+infobegin "Install dependency packages"
+env DEBIAN_FRONTEND=noninteractive \
+ apt-get install --assume-yes \
+ ${requires[@]}
+infoend
diff --git a/.github/workflows/fedora.sh b/.github/workflows/fedora.sh
new file mode 100755
index 0000000..14405fb
--- /dev/null
+++ b/.github/workflows/fedora.sh
@@ -0,0 +1,43 @@
+#!/usr/bin/bash
+
+set -eo pipefail
+
+# Use grouped output messages
+infobegin() {
+ echo "::group::${1}"
+}
+infoend() {
+ echo "::endgroup::"
+}
+
+# Required packages on Fedora
+requires=(
+ ccache # Use ccache to speed up build
+)
+
+requires+=(
+ autoconf-archive
+ dbus-glib-devel
+ desktop-file-utils
+ gcc
+ git
+ gtk3-devel
+ libSM-devel
+ libXtst-devel
+ make
+ mate-common
+ mesa-libGLES-devel
+ pango-devel
+ redhat-rpm-config
+ systemd-devel
+ xmlto
+ xorg-x11-xtrans-devel
+)
+
+infobegin "Update system"
+dnf update -y
+infoend
+
+infobegin "Install dependency packages"
+dnf install -y ${requires[@]}
+infoend
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
new file mode 100644
index 0000000..6b76882
--- /dev/null
+++ b/.github/workflows/release.yml
@@ -0,0 +1,26 @@
+name: Release Version
+on:
+ push:
+ tags:
+ - "v*.*.*"
+
+jobs:
+ release:
+ name: Release New Version
+ runs-on: ubuntu-latest
+ steps:
+ - name: Repository checkout
+ uses: actions/checkout@v5
+ with:
+ submodules: "true"
+
+ - name: Install dependency packages
+ run: sudo .github/workflows/ubuntu.sh
+
+ - name: Build the source code
+ run: .github/workflows/builds.sh autotools
+ - name: Create github release
+ run: |
+ gh release create ${{ github.ref_name }} --title ${{ github.ref_name }} --generate-notes mate-session-manager-*.tar.xz
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
diff --git a/.github/workflows/ubuntu.sh b/.github/workflows/ubuntu.sh
new file mode 100755
index 0000000..6bfff4a
--- /dev/null
+++ b/.github/workflows/ubuntu.sh
@@ -0,0 +1,53 @@
+#!/usr/bin/bash
+
+set -eo pipefail
+
+# Use grouped output messages
+infobegin() {
+ echo "::group::${1}"
+}
+infoend() {
+ echo "::endgroup::"
+}
+
+# Required packages on Ubuntu
+requires=(
+ ccache # Use ccache to speed up build
+)
+
+requires+=(
+ autoconf-archive
+ autopoint
+ gcc
+ git
+ intltool
+ libdbus-glib-1-dev
+ libgl1-mesa-dev
+ libgles2-mesa-dev
+ libglib2.0-dev
+ libgtk-3-dev
+ libice-dev
+ libsm-dev
+ libstartup-notification0-dev
+ libsystemd-dev
+ libx11-dev
+ libxau-dev
+ libxext-dev
+ libxrender-dev
+ libxt-dev
+ libxtst-dev
+ make
+ mate-common
+ xmlto
+ xsltproc
+)
+
+infobegin "Update system"
+apt-get update -y
+infoend
+
+infobegin "Install dependency packages"
+env DEBIAN_FRONTEND=noninteractive \
+ apt-get install --assume-yes \
+ ${requires[@]}
+infoend