From 3146dfa2b6e7b7f1d1e24ed2a62e2bb01aef337d Mon Sep 17 00:00:00 2001 From: mbkma <39454100+mbkma@users.noreply.github.com> Date: Thu, 12 Mar 2026 00:28:16 +0100 Subject: ci: migrate from Travis CI to GitHub Actions (#373) * ci: migrate from Travis CI to GitHub Actions Replace Travis CI configuration with GitHub Actions workflows. Add CI build workflow for Debian, Fedora, Ubuntu, and Archlinux. Add release workflow for automated GitHub releases on tags. Add dependabot configuration for GHA pin updates. Remove obsolete .travis.yml. * ci: add missing PKGBUILD depends to archlinux CI script * remove .build.yml * ci: remove redundant GH CLI installation step * ci: add set -eo pipefail to workflow scripts * build: add AC_CONFIG_MACRO_DIRS([m4]) for gettext m4 macros * ci: add missing pkgs * ci: build mate-desktop from source * ci: disable pt language for help in search tool in Fedora build --------- Co-authored-by: Victor Kareh --- .github/dependabot.yml | 8 +++ .github/workflows/archlinux.sh | 49 +++++++++++++ .github/workflows/builds.sh | 46 ++++++++++++ .github/workflows/builds.yml | 94 ++++++++++++++++++++++++ .github/workflows/debian.sh | 54 ++++++++++++++ .github/workflows/fedora.sh | 50 +++++++++++++ .github/workflows/mate-desktop.sh | 148 ++++++++++++++++++++++++++++++++++++++ .github/workflows/release.yml | 26 +++++++ .github/workflows/ubuntu.sh | 53 ++++++++++++++ 9 files changed, 528 insertions(+) create mode 100644 .github/dependabot.yml create mode 100755 .github/workflows/archlinux.sh create mode 100755 .github/workflows/builds.sh create mode 100644 .github/workflows/builds.yml create mode 100755 .github/workflows/debian.sh create mode 100755 .github/workflows/fedora.sh create mode 100755 .github/workflows/mate-desktop.sh create mode 100644 .github/workflows/release.yml create mode 100755 .github/workflows/ubuntu.sh (limited to '.github') diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..80851cd3 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,8 @@ +# Enable dependabot to keep our GHA pins automatically +# updated, so we don't fall too far behind in the future +version: 2 +updates: + - package-ecosystem: github-actions + directory: "/" + schedule: + interval: weekly diff --git a/.github/workflows/archlinux.sh b/.github/workflows/archlinux.sh new file mode 100755 index 00000000..ac20758a --- /dev/null +++ b/.github/workflows/archlinux.sh @@ -0,0 +1,49 @@ +#!/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-utils +requires+=( + autoconf-archive + gcc + gettext + git + glib2-devel + inkscape + intltool + itstool + libcanberra + libgtop + libsm + libxml2 + make + mate-common + mate-desktop + mate-panel + python + udisks2 + which + yelp-tools +) + +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 00000000..11c063b4 --- /dev/null +++ b/.github/workflows/builds.sh @@ -0,0 +1,46 @@ +#!/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 + if [ "$DISTRO" = "fedora" ]; then + # disable pt language for help in search tool + # See: https://github.com/itstool/itstool/issues/36 + infobegin "Apply Portuguese gsearchtool help workaround" + sed -i 's/^IGNORE_HELP_LINGUAS =.*$/IGNORE_HELP_LINGUAS = pt/' gsearchtool/help/Makefile.am + infoend + fi + + 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 00000000..eafdc6f2 --- /dev/null +++ b/.github/workflows/builds.yml @@ -0,0 +1,94 @@ +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 + +env: + MATE_DESKTOP_VERSION: 1.28.2 + CACHE_PATH: /tmp/.cache + +jobs: + build: + name: Build on ${{matrix.container}} (using ${{matrix.cc}}) + runs-on: ubuntu-latest + container: + image: ${{matrix.container}} + volumes: + - /tmp/.cache + - /var/cache/apt + + 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/ccache-action@v1.2 + with: + key: ${{ env.DISTRO }}-${{ matrix.cc }} + + # INFO: mate-utils depends mate-desktop 1.27.1+, so we should install it from source. + - name: Cache mate-desktop binary packages + uses: actions/cache@v5 + id: cache-mate-desktop + with: + path: ${{ env.CACHE_PATH }} + key: ${{ env.DISTRO }}-build-mate-desktop-${{env.MATE_DESKTOP_VERSION}} + - name: Built and install mate-desktop from source + run: .github/workflows/mate-desktop.sh ${{env.MATE_DESKTOP_VERSION}} ${{ env.CACHE_PATH }} + # INFO: mate-utils depends mate-desktop 1.27.1+, install finished. + + - 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 00000000..7e431930 --- /dev/null +++ b/.github/workflows/debian.sh @@ -0,0 +1,54 @@ +#!/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 + g++ + git + gtk-doc-tools + libcanberra-gtk3-dev + libglib2.0-dev + libgtk-3-dev + libgtop2-dev + libmate-panel-applet-dev + libudisks2-dev + libx11-dev + libxext-dev + libxt-dev + make + mate-common + x11proto-xext-dev + xsltproc + yelp-tools + zlib1g-dev + gobject-introspection + iso-codes + libdconf-dev + libgirepository1.0-dev +) + +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 00000000..c8892639 --- /dev/null +++ b/.github/workflows/fedora.sh @@ -0,0 +1,50 @@ +#!/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 + desktop-file-utils + e2fsprogs-devel + gcc + gcc-c++ + git + hardlink + libX11-devel + libXmu-devel + libcanberra-devel + libgtop2-devel + libudisks2-devel + make + mate-common + mate-panel-devel + mesa-libGL-devel + popt-devel + redhat-rpm-config + usermode + yelp-tools + dconf-devel + gobject-introspection-devel + iso-codes-devel +) + +infobegin "Update system" +dnf update -y +infoend + +infobegin "Install dependency packages" +dnf install -y ${requires[@]} +infoend diff --git a/.github/workflows/mate-desktop.sh b/.github/workflows/mate-desktop.sh new file mode 100755 index 00000000..b55046d5 --- /dev/null +++ b/.github/workflows/mate-desktop.sh @@ -0,0 +1,148 @@ +#!/usr/bin/bash + +set -e +set -o pipefail + +NAME="mate-desktop" +TEMP_DIR=$(mktemp -d) +OS=$(cat /etc/os-release | grep ^ID | head -n 1 | awk -F= '{ print $2}') +TAG=$1 +CACHE_DIR=$2 + +# Use grouped output messages +infobegin() { + echo "::group::${1}" +} +infoend() { + echo "::endgroup::" +} + +# Required packages to build mate-desktop +# https://gitlab.archlinux.org/archlinux/packaging/packages/mate-desktop +arch_requires=( + autoconf-archive + gobject-introspection + mate-common + intltool +) + +# https://salsa.debian.org/debian-mate-team/mate-desktop/-/blob/master/debian/control +debian_requires=( + autoconf-archive + autopoint + gobject-introspection + gtk-doc-tools + intltool + iso-codes + libdconf-dev + libgdk-pixbuf-2.0-dev + libgirepository1.0-dev + libglib2.0-dev + libglib2.0-doc + libgtk-3-dev + libgtk-3-doc + librsvg2-bin + libstartup-notification0-dev + libx11-dev + libxml2-dev + libxrandr-dev + mate-common +) + +# https://src.fedoraproject.org/rpms/mate-desktop/blob/rawhide/f/mate-desktop.spec +fedora_requires=( + dconf-devel + desktop-file-utils + gobject-introspection-devel + make + mate-common + startup-notification-devel + gtk3-devel + iso-codes-devel + gobject-introspection-devel + cairo-gobject-devel +) + +# https://git.launchpad.net/ubuntu/+source/mate-desktop/tree/debian/control +ubuntu_requires=( + autoconf-archive + autopoint + gobject-introspection + gtk-doc-tools + intltool + iso-codes + libdconf-dev + libgdk-pixbuf-2.0-dev + libgirepository1.0-dev + libglib2.0-dev + libglib2.0-doc + libgtk-3-dev + libgtk-3-doc + librsvg2-bin + libstartup-notification0-dev + libx11-dev + libxml2-dev + libxrandr-dev + mate-common +) + +requires=$(eval echo '${'"${OS}_requires[@]}") + +infobegin "Install Depends for mate-desktop" +case ${OS} in +arch) + pacman --noconfirm -Syu + pacman --noconfirm -S ${requires[@]} + ;; +debian | ubuntu) + apt-get update -qq + env DEBIAN_FRONTEND=noninteractive \ + apt-get install --assume-yes --no-install-recommends ${requires[@]} + ;; +fedora) + dnf update -y + dnf install -y ${requires[@]} + ;; +esac +infoend + +# Use cached packages first +if [ -f $CACHE_DIR/${NAME}-${TAG}.tar.xz ]; then + echo "Found cache package, reuse it" + tar -C / -Jxf $CACHE_DIR/${NAME}-${TAG}.tar.xz +else + git clone --recurse-submodules https://github.com/mate-desktop/${NAME} + + # Foldable output information + infobegin "Configure" + cd ${NAME} + git checkout v${TAG} + if [[ ${OS} == "debian" || ${OS} == "ubuntu" ]]; then + ./autogen.sh --prefix=/usr --libdir=/usr/lib/x86_64-linux-gnu --libexecdir=/usr/lib/x86_64-linux-gnu || { + cat config.log + exit 1 + } + else + ./autogen.sh --prefix=/usr || { + cat config.log + exit 1 + } + fi + infoend + + infobegin "Build" + make -j ${JOBS} + infoend + + infobegin "Install" + make install + infoend + + # Cache this package version + infobegin "Cache" + [ -d ${CACHE_DIR} ] || mkdir -p ${CACHE_DIR} + make install DESTDIR=${TEMP_DIR} + cd $TEMP_DIR + tar -J -cf $CACHE_DIR/${NAME}-${TAG}.tar.xz * + infoend +fi diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..7382340c --- /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-utils-*.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 00000000..95f5e7d7 --- /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 + g++ + git + gtk-doc-tools + libcanberra-gtk3-dev + libdconf-dev + libglib2.0-dev + libgtk-3-dev + libgtop2-dev + libmate-panel-applet-dev + libudisks2-dev + libx11-dev + libxext-dev + libxt-dev + make + mate-common + x11proto-xext-dev + xsltproc + yelp-tools + zlib1g-dev + gobject-introspection + iso-codes + libgirepository1.0-dev +) + +infobegin "Update system" +apt-get update -y +infoend + +infobegin "Install dependency packages" +env DEBIAN_FRONTEND=noninteractive \ + apt-get install --assume-yes \ + ${requires[@]} +infoend -- cgit v1.2.1