diff options
Diffstat (limited to '.github/workflows')
| -rw-r--r-- | .github/workflows/builds.yml | 12 | ||||
| -rwxr-xr-x | .github/workflows/marco.sh | 187 | ||||
| -rw-r--r-- | .github/workflows/release.yml | 6 |
3 files changed, 204 insertions, 1 deletions
diff --git a/.github/workflows/builds.yml b/.github/workflows/builds.yml index a3dcaba4..4f512ecb 100644 --- a/.github/workflows/builds.yml +++ b/.github/workflows/builds.yml @@ -16,6 +16,7 @@ concurrency: env: MATE_DESKTOP_VERSION: 1.28.2 + MARCO_VERSION: 1.29.0 CACHE_PATH: /tmp/.cache jobs: @@ -90,5 +91,16 @@ jobs: run: .github/workflows/mate-desktop.sh ${{env.MATE_DESKTOP_VERSION}} ${{ env.CACHE_PATH }} # INFO: M-C-C depends mate-desktop 1.27.1+, install finished. + # INFO: M-C-C depends on marco 1.29.0+, so we should install it from source. + - name: Cache marco binary packages + uses: actions/cache@v5 + id: cache-marco + with: + path: ${{ env.CACHE_PATH }} + key: ${{ env.DISTRO }}-build-marco-${{env.MARCO_VERSION}} + - name: Built and install marco from source + run: .github/workflows/marco.sh ${{env.MARCO_VERSION}} ${{ env.CACHE_PATH }} + # INFO: M-C-C depends on marco 1.29.0+, install finished. + - name: Build the source code run: .github/workflows/builds.sh diff --git a/.github/workflows/marco.sh b/.github/workflows/marco.sh new file mode 100755 index 00000000..4d7917ea --- /dev/null +++ b/.github/workflows/marco.sh @@ -0,0 +1,187 @@ +#!/usr/bin/bash + +set -e +set -o pipefail + +NAME="marco" +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 marco +arch_requires=( + autoconf-archive + gcc + git + glib2 + gtk3 + intltool + libcanberra + libgtop + libxpresent + libxres + make + mate-common + mate-desktop + which + yelp-tools + zenity +) + +debian_requires=( + autoconf-archive + autopoint + gcc + git + intltool + libcanberra-gtk3-dev + libglib2.0-dev + libgtk-3-dev + libgtop2-dev + libice-dev + libmate-desktop-dev + libpango1.0-dev + libsm-dev + libstartup-notification0-dev + libx11-dev + libxcomposite-dev + libxcursor-dev + libxdamage-dev + libxext-dev + libxfixes-dev + libxinerama-dev + libxpresent-dev + libxrandr-dev + libxrender-dev + libxres-dev + libxt-dev + make + mate-common + x11proto-present-dev + yelp-tools + zenity +) + +fedora_requires=( + desktop-file-utils + gcc + gtk3-devel + libSM-devel + libXdamage-devel + libXpresent-devel + libXres-devel + libcanberra-devel + libgtop2-devel + libsoup-devel + make + mate-common + mate-desktop-devel + redhat-rpm-config + startup-notification-devel + yelp-tools + zenity +) + +ubuntu_requires=( + autoconf-archive + autopoint + gcc + git + intltool + libcanberra-gtk3-dev + libglib2.0-dev + libgtk-3-dev + libgtop2-dev + libice-dev + libmate-desktop-dev + libpango1.0-dev + libsm-dev + libstartup-notification0-dev + libx11-dev + libxcomposite-dev + libxcursor-dev + libxdamage-dev + libxext-dev + libxfixes-dev + libxinerama-dev + libxpresent-dev + libxrandr-dev + libxrender-dev + libxres-dev + libxt-dev + make + mate-common + x11proto-present-dev + yelp-tools + zenity +) + +requires=$(eval echo '${'"${OS}_requires[@]}") + +infobegin "Install Depends for marco" +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 index cb6b3660..b096a7fd 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,6 +6,7 @@ on: env: MATE_DESKTOP_VERSION: 1.28.2 + MARCO_VERSION: 1.29.0 CACHE_PATH: /tmp/.cache jobs: @@ -21,9 +22,12 @@ jobs: - name: Install dependency packages run: sudo .github/workflows/ubuntu.sh - - name: Install higher version Mate component packages + - name: Install higher version mate-desktop component packages run: sudo .github/workflows/mate-desktop.sh ${{env.MATE_DESKTOP_VERSION}} ${{ env.CACHE_PATH }} + - name: Install higher version marco component packages + run: sudo .github/workflows/marco.sh ${{env.MARCO_VERSION}} ${{ env.CACHE_PATH }} + - name: Build the source code run: .github/workflows/builds.sh |
