summaryrefslogtreecommitdiff
path: root/.github/workflows
diff options
context:
space:
mode:
authormbkma <[email protected]>2026-01-28 09:00:32 +0100
committermbkma <[email protected]>2026-01-29 21:41:02 +0100
commitae81d7f3bb82b6ef46238a7639ea6da1d3e216c6 (patch)
tree8c0cb30cf91bbeef25dc5d9cca6ba2b9229813b6 /.github/workflows
parent5660b20ee1a62bc7bf1360686150d7cac8f2e791 (diff)
downloadmate-calc-ae81d7f3bb82b6ef46238a7639ea6da1d3e216c6.tar.bz2
mate-calc-ae81d7f3bb82b6ef46238a7639ea6da1d3e216c6.tar.xz
ci: restructure github actions to use the same structure for all repos
configure m4 dir
Diffstat (limited to '.github/workflows')
-rwxr-xr-x.github/workflows/archlinux.sh41
-rw-r--r--.github/workflows/build.yml163
-rwxr-xr-x.github/workflows/builds.sh64
-rw-r--r--.github/workflows/builds.yml75
-rwxr-xr-x.github/workflows/debian.sh42
-rwxr-xr-x.github/workflows/fedora.sh42
-rw-r--r--.github/workflows/notify.yml44
-rw-r--r--.github/workflows/pages.yml139
-rw-r--r--.github/workflows/quality.yml134
-rw-r--r--.github/workflows/release.yml123
-rwxr-xr-x.github/workflows/ubuntu.sh43
11 files changed, 325 insertions, 585 deletions
diff --git a/.github/workflows/archlinux.sh b/.github/workflows/archlinux.sh
new file mode 100755
index 0000000..e7ba154
--- /dev/null
+++ b/.github/workflows/archlinux.sh
@@ -0,0 +1,41 @@
+#!/usr/bin/bash
+
+# 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
+ meson # Used for meson build
+)
+
+# https://gitlab.archlinux.org/archlinux/packaging/packages/mate-calc
+requires+=(
+ autoconf-archive
+ gcc
+ gettext
+ git
+ glib2-devel
+ gtk3
+ intltool
+ itstool
+ libmpc
+ make
+ mate-common
+ which
+ yelp-tools
+)
+
+infobegin "Update system"
+pacman --noconfirm -Syu
+infoend
+
+infobegin "Install dependency packages"
+pacman --noconfirm -S ${requires[@]}
+infoend
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
deleted file mode 100644
index dc7143a..0000000
--- a/.github/workflows/build.yml
+++ /dev/null
@@ -1,163 +0,0 @@
-name: Build and Test
-
-on:
- push:
- branches: [ master, main ]
- tags: [ 'v*' ]
- pull_request:
- branches: [ master, main ]
-
-jobs:
- build:
- runs-on: ubuntu-latest
- strategy:
- matrix:
- distro:
- - 'debian:testing'
- - 'fedora:latest'
- include:
- - distro: 'debian:testing'
- distro_name: 'debian'
- - distro: 'fedora:latest'
- distro_name: 'fedora'
-
- container:
- image: ${{ matrix.distro }}
-
- steps:
- - name: Checkout code
- uses: actions/checkout@v4
-
- - name: Install dependencies (Debian)
- if: matrix.distro_name == 'debian'
- run: |
- apt-get update
- apt-get install -y \
- autopoint \
- clang \
- clang-tools \
- cppcheck \
- gcc \
- git \
- libatk1.0-dev \
- libglib2.0-dev \
- libgmp-dev \
- libgtk-3-dev \
- libmpc-dev \
- libmpfr-dev \
- libxml2-dev \
- make \
- mate-common \
- yelp-tools \
- bison \
- flex \
- curl
-
- - name: Install dependencies (Fedora)
- if: matrix.distro_name == 'fedora'
- run: |
- dnf update -y
- dnf install -y \
- autoconf-archive \
- clang \
- clang-analyzer \
- cppcheck-htmlreport \
- bison \
- desktop-file-utils \
- flex \
- gcc \
- git \
- gmp-devel \
- gtk3 \
- libmpc-devel \
- libxml2-devel \
- make \
- mate-common \
- mate-desktop-devel \
- mpfr-devel \
- redhat-rpm-config \
- curl \
- which
-
- - name: Set up environment variables
- run: |
- export CPU_COUNT=$(nproc)
- echo "CPU_COUNT=$CPU_COUNT" >> $GITHUB_ENV
- echo "DISTRO_NAME=${{ matrix.distro_name }}" >> $GITHUB_ENV
- echo "REPO_NAME=mate-calc" >> $GITHUB_ENV
- echo "OWNER_NAME=mate-desktop" >> $GITHUB_ENV
- export CHECKERS="-enable-checker deadcode.DeadStores -enable-checker alpha.deadcode.UnreachableCode -enable-checker alpha.core.CastSize -enable-checker alpha.core.CastToStruct -enable-checker alpha.core.IdenticalExpr -enable-checker alpha.core.SizeofPtr -enable-checker alpha.security.ArrayBoundV2 -enable-checker alpha.security.MallocOverflow -enable-checker alpha.security.ReturnPtrRange -enable-checker alpha.unix.SimpleStream -enable-checker alpha.unix.cstring.BufferOverlap -enable-checker alpha.unix.cstring.NotNullTerminated -enable-checker alpha.unix.cstring.OutOfBounds -enable-checker alpha.core.FixedAddr -enable-checker security.insecureAPI.strcpy"
- echo "CHECKERS=$CHECKERS" >> $GITHUB_ENV
-
- - name: Run cppcheck (Debian only)
- if: matrix.distro_name == 'debian'
- shell: bash
- run: |
- export CFLAGS="${CFLAGS:-} -Wsign-compare"
- cppcheck --enable=warning,style,performance,portability,information,missingInclude .
-
- - name: Generate build system
- run: |
- NOCONFIGURE=1 ./autogen.sh
-
- - name: Configure with scan-build
- run: |
- scan-build $CHECKERS ./configure --enable-compile-warnings=maximum
-
- - name: Build with scan-build
- shell: bash
- run: |
- if [ $CPU_COUNT -gt 1 ]; then
- if [ "$DISTRO_NAME" == "debian" ]; then
- scan-build $CHECKERS --keep-cc --use-cc=clang --use-c++=clang++ -o html-report make -j $CPU_COUNT
- make clean
- fi
- scan-build $CHECKERS --keep-cc -o html-report make -j $CPU_COUNT
- else
- if [ "$DISTRO_NAME" == "debian" ]; then
- scan-build $CHECKERS --keep-cc --use-cc=clang --use-c++=clang++ -o html-report make
- make clean
- fi
- scan-build $CHECKERS --keep-cc -o html-report make
- fi
-
- - name: Run additional checks (Fedora only)
- if: matrix.distro_name == 'fedora'
- run: |
- cppcheck --xml --output-file=cppcheck.xml --enable=warning,style,performance,portability,information,missingInclude .
- cppcheck-htmlreport --title=$REPO_NAME --file=cppcheck.xml --report-dir=cppcheck-htmlreport
-
- - name: Generate index (Fedora only)
- if: matrix.distro_name == 'fedora'
- run: |
- curl -Ls -o gen-index https://github.com/mate-desktop/mate-dev-scripts/raw/master/travis/gen-index.sh
- chmod +x gen-index
- ./gen-index -l 20 -i https://github.com/${OWNER_NAME}/mate-icon-theme/raw/master/mate/16x16/apps/accessories-calculator.png
-
- - name: Run distcheck
- run: |
- make distcheck
-
- - name: Upload HTML reports (Fedora only)
- if: matrix.distro_name == 'fedora'
- uses: actions/upload-artifact@v4
- with:
- name: html-report-${{ matrix.distro_name }}
- path: html-report/
- retention-days: 30
-
- - name: Upload cppcheck reports (Fedora only)
- if: matrix.distro_name == 'fedora'
- uses: actions/upload-artifact@v4
- with:
- name: cppcheck-report-${{ matrix.distro_name }}
- path: cppcheck-htmlreport/
- retention-days: 30
-
- - name: Upload distribution archives
- if: matrix.distro_name == 'fedora'
- uses: actions/upload-artifact@v4
- with:
- name: distribution-archives
- path: mate-calc-*.tar.xz
- retention-days: 90 \ No newline at end of file
diff --git a/.github/workflows/builds.sh b/.github/workflows/builds.sh
new file mode 100755
index 0000000..20c1ad5
--- /dev/null
+++ b/.github/workflows/builds.sh
@@ -0,0 +1,64 @@
+#!/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::"
+}
+
+# Run meson first, then run autotools
+# Because meson dist requires a clean git workspace
+# Autotools will modify some files (such as po, etc.), making them dirty.
+if [ -f meson.build ]; then
+
+ infobegin "Configure (meson)"
+ meson setup _build --prefix=/usr
+ infoend
+
+ infobegin "Build (meson)"
+ meson compile -C _build
+ infoend
+
+ infobegin "Test (meson)"
+ ninja -C _build test
+ infoend
+
+ infobegin "Dist (meson)"
+ # Git safedirectory stop ninja dist
+ # https://github.com/git/git/commit/8959555cee7ec045958f9b6dd62e541affb7e7d9
+ # https://git-scm.com/docs/git-config/2.35.2#Documentation/git-config.txt-safedirectory
+ git config --global --add safe.directory ${PWD}
+ ninja -C _build dist
+ infoend
+fi
+
+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..b7d7864
--- /dev/null
+++ b/.github/workflows/builds.yml
@@ -0,0 +1,75 @@
+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
+ - 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..9f5b1bd
--- /dev/null
+++ b/.github/workflows/debian.sh
@@ -0,0 +1,42 @@
+#!/usr/bin/bash
+
+# Use grouped output messages
+infobegin() {
+ echo "::group::${1}"
+}
+infoend() {
+ echo "::endgroup::"
+}
+
+# Required packages on Debian
+requires=(
+ ccache # Use ccache to speed up build
+ meson # Used for meson build
+)
+
+# https://salsa.debian.org/debian-mate-team/mate-calc
+requires+=(
+ autopoint
+ bison
+ flex
+ libatk1.0-dev
+ libglib2.0-dev
+ libgmp-dev
+ libgtk-3-dev
+ libmpc-dev
+ libmpfr-dev
+ libxml2-dev
+ make
+ mate-common
+ yelp-tools
+)
+
+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..7dd4d6b
--- /dev/null
+++ b/.github/workflows/fedora.sh
@@ -0,0 +1,42 @@
+#!/usr/bin/bash
+
+# Use grouped output messages
+infobegin() {
+ echo "::group::${1}"
+}
+infoend() {
+ echo "::endgroup::"
+}
+
+# Required packages on Fedora
+requires=(
+ ccache # Use ccache to speed up build
+ meson # Used for meson build
+)
+
+# https://src.fedoraproject.org/cgit/rpms/mate-calc.git
+requires+=(
+ autoconf-archive
+ bison
+ desktop-file-utils
+ flex
+ gcc
+ git
+ gmp-devel
+ gtk3-devel
+ libmpc-devel
+ libxml2-devel
+ make
+ mate-common
+ mate-desktop-devel
+ mpfr-devel
+ redhat-rpm-config
+)
+
+infobegin "Update system"
+dnf update -y
+infoend
+
+infobegin "Install dependency packages"
+dnf install -y ${requires[@]}
+infoend
diff --git a/.github/workflows/notify.yml b/.github/workflows/notify.yml
deleted file mode 100644
index 12e39ee..0000000
--- a/.github/workflows/notify.yml
+++ /dev/null
@@ -1,44 +0,0 @@
-name: Notifications
-
-on:
- push:
- branches: [ master, main ]
- tags: [ 'v*' ]
- workflow_run:
- workflows: ["Build and Test"]
- types:
- - completed
-
-jobs:
- irc-notify:
- runs-on: ubuntu-latest
- if: >
- (github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/'))) ||
- (github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'failure')
-
- steps:
- - name: Send IRC notification on success
- if: >
- (github.event_name == 'push') ||
- (github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success')
- uses: Gottox/irc-message-action@v2
- continue-on-error: true
- with:
- server: irc.libera.chat
- channel: '#mate-dev'
- nickname: mate-github-bot
- message: |
- [mate-calc] ${{ github.actor }}: ${{ github.event.head_commit.message || 'Workflow completed successfully' }}
- [${{ github.ref_name }}] ${{ github.sha }} Success ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
-
- - name: Send IRC notification on failure
- if: github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'failure'
- uses: Gottox/irc-message-action@v2
- continue-on-error: true
- with:
- server: irc.libera.chat
- channel: '#mate-dev'
- nickname: mate-github-bot
- message: |
- [mate-calc] Build failed: ${{ github.event.workflow_run.head_commit.message }}
- [${{ github.event.workflow_run.head_branch }}] ${{ github.event.workflow_run.head_sha }} Failure ${{ github.event.workflow_run.html_url }} \ No newline at end of file
diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml
deleted file mode 100644
index c1c1af6..0000000
--- a/.github/workflows/pages.yml
+++ /dev/null
@@ -1,139 +0,0 @@
-name: Deploy to GitHub Pages
-
-on:
- push:
- branches: [ master, main ]
- pull_request:
- branches: [ master, main ]
-
-permissions:
- contents: read
- pages: write
- id-token: write
- pull-requests: write
-
-concurrency:
- group: "pages"
- cancel-in-progress: false
-
-jobs:
- build-docs:
- runs-on: ubuntu-latest
- container:
- image: 'fedora:latest'
-
- steps:
- - name: Checkout code
- uses: actions/checkout@v4
-
- - name: Install dependencies
- run: |
- dnf update -y
- dnf install -y \
- autoconf-archive \
- clang \
- clang-analyzer \
- cppcheck-htmlreport \
- bison \
- desktop-file-utils \
- flex \
- gcc \
- git \
- gmp-devel \
- gtk3 \
- libmpc-devel \
- libxml2-devel \
- make \
- mate-common \
- mate-desktop-devel \
- mpfr-devel \
- redhat-rpm-config \
- curl \
- which
-
- - name: Set up environment variables
- run: |
- export CPU_COUNT=$(nproc)
- echo "CPU_COUNT=$CPU_COUNT" >> $GITHUB_ENV
- echo "REPO_NAME=mate-calc" >> $GITHUB_ENV
- echo "OWNER_NAME=mate-desktop" >> $GITHUB_ENV
- export CHECKERS="-enable-checker deadcode.DeadStores -enable-checker alpha.deadcode.UnreachableCode -enable-checker alpha.core.CastSize -enable-checker alpha.core.CastToStruct -enable-checker alpha.core.IdenticalExpr -enable-checker alpha.core.SizeofPtr -enable-checker alpha.security.ArrayBoundV2 -enable-checker alpha.security.MallocOverflow -enable-checker alpha.security.ReturnPtrRange -enable-checker alpha.unix.SimpleStream -enable-checker alpha.unix.cstring.BufferOverlap -enable-checker alpha.unix.cstring.NotNullTerminated -enable-checker alpha.unix.cstring.OutOfBounds -enable-checker alpha.core.FixedAddr -enable-checker security.insecureAPI.strcpy"
- echo "CHECKERS=$CHECKERS" >> $GITHUB_ENV
-
- - name: Generate build system
- run: |
- NOCONFIGURE=1 ./autogen.sh
-
- - name: Configure with scan-build
- run: |
- scan-build $CHECKERS ./configure --enable-compile-warnings=maximum
-
- - name: Build with scan-build
- run: |
- scan-build $CHECKERS --keep-cc -o html-report make -j $CPU_COUNT
-
- - name: Run cppcheck
- run: |
- cppcheck --xml --output-file=cppcheck.xml --enable=warning,style,performance,portability,information,missingInclude .
- cppcheck-htmlreport --title=$REPO_NAME --file=cppcheck.xml --report-dir=cppcheck-htmlreport
-
- - name: Generate index page
- run: |
- curl -Ls -o gen-index https://github.com/mate-desktop/mate-dev-scripts/raw/master/travis/gen-index.sh
- chmod +x gen-index
- ./gen-index -l 20 -i https://github.com/${OWNER_NAME}/mate-icon-theme/raw/master/mate/16x16/apps/accessories-calculator.png
-
- - name: Setup Pages
- if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main'
- uses: actions/configure-pages@v5
-
- - name: Upload artifact
- if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main'
- uses: actions/upload-pages-artifact@v3
- with:
- path: html-report
-
- - name: Comment on PR with analysis results
- if: github.event_name == 'pull_request'
- uses: actions/github-script@v7
- with:
- script: |
- const fs = require('fs');
- const path = require('path');
-
- // Check if html-report exists and has content
- const reportDir = 'html-report';
- let reportCount = 0;
-
- if (fs.existsSync(reportDir)) {
- const files = fs.readdirSync(reportDir);
- reportCount = files.filter(f => f.endsWith('.html')).length;
- }
-
- const comment = `## 🔍 Static Analysis Results
-
- Code analysis completed for this pull request.
-
- - **Scan-build reports**: ${reportCount} files generated
- - **Status**: ${reportCount > 0 ? '⚠️ Issues found' : '✅ No issues found'}
-
- The detailed reports are available in the workflow artifacts.`;
-
- github.rest.issues.createComment({
- issue_number: context.issue.number,
- owner: context.repo.owner,
- repo: context.repo.repo,
- body: comment
- });
-
- deploy:
- if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main'
- environment:
- name: github-pages
- url: ${{ steps.deployment.outputs.page_url }}
- runs-on: ubuntu-latest
- needs: build-docs
- steps:
- - name: Deploy to GitHub Pages
- id: deployment
- uses: actions/deploy-pages@v4 \ No newline at end of file
diff --git a/.github/workflows/quality.yml b/.github/workflows/quality.yml
deleted file mode 100644
index a23e90b..0000000
--- a/.github/workflows/quality.yml
+++ /dev/null
@@ -1,134 +0,0 @@
-name: Code Quality
-
-on:
- push:
- branches: [ master, main ]
- pull_request:
- branches: [ master, main ]
-
-jobs:
- lint:
- runs-on: ubuntu-latest
-
- steps:
- - name: Checkout code
- uses: actions/checkout@v4
-
- - name: Install dependencies
- run: |
- sudo apt-get update
- sudo apt-get install -y \
- clang-format \
- cppcheck \
- shellcheck \
- libxml2-utils \
- desktop-file-utils
-
- - name: Check C/C++ code formatting
- run: |
- # Find all C/C++ files and check formatting
- echo "::warning::Code formatting check - this is informational only"
- find src/ -name "*.c" -o -name "*.h" | while read file; do
- echo "Checking format of $file"
- if ! clang-format --dry-run "$file" > /dev/null 2>&1; then
- echo "::warning file=$file::Code formatting issues found in $file"
- fi
- done || true
-
- - name: Run cppcheck
- run: |
- echo "::warning::Running cppcheck analysis - issues will be reported as warnings"
- cppcheck --enable=warning,style,performance,portability,information \
- --suppress=missingIncludeSystem \
- --suppress=unusedFunction \
- --inline-suppr \
- --template='{file}:{line}: {severity}: {message}' \
- src/ 2>&1 | while IFS= read -r line; do
- if [[ $line =~ ^(.+):([0-9]+):[[:space:]]*([^:]+):[[:space:]]*(.+)$ ]]; then
- file="${BASH_REMATCH[1]}"
- lineno="${BASH_REMATCH[2]}"
- severity="${BASH_REMATCH[3]}"
- message="${BASH_REMATCH[4]}"
- echo "::warning file=$file,line=$lineno::$severity: $message"
- else
- echo "$line"
- fi
- done || true
-
- - name: Check shell scripts
- run: |
- echo "::warning::Running shellcheck analysis - issues will be reported as warnings"
- find . -name "*.sh" -type f | while read -r file; do
- echo "Checking shell script: $file"
- if ! shellcheck "$file"; then
- echo "::warning file=$file::Shellcheck found issues in $file"
- fi
- done || true
-
- - name: Validate desktop files
- run: |
- echo "::warning::Validating desktop files - issues will be reported as warnings"
- find . -name "*.desktop.in" -type f | while read -r file; do
- echo "Validating $file"
- # Basic validation - desktop-file-validate would need the processed .desktop file
- if ! xmllint --noout --nonet --quiet "$file" 2>/dev/null; then
- echo "::warning file=$file::Desktop file validation issues found in $file"
- fi
- done || true
-
- - name: Check XML files
- run: |
- echo "::warning::Validating XML files - issues will be reported as warnings"
- find . -name "*.xml" -type f | while read -r file; do
- echo "Validating XML: $file"
- if ! xmllint --noout "$file" 2>/dev/null; then
- echo "::warning file=$file::XML validation issues found in $file"
- fi
- done || true
-
- - name: Check for common issues
- run: |
- echo "::warning::Checking for common code issues - issues will be reported as warnings"
-
- # Check for trailing whitespace
- if grep -r '[[:space:]]$' src/ --exclude-dir=.git; then
- echo "::warning::Found trailing whitespace in source files"
- fi
-
- # Check for tabs in source files (if project prefers spaces)
- if grep -r $'\t' src/ --include="*.c" --include="*.h" --exclude-dir=.git; then
- echo "::warning::Found tabs in source files - consider using spaces for consistency"
- fi
-
- # Always succeed
- true
-
- security:
- runs-on: ubuntu-latest
-
- steps:
- - name: Checkout code
- uses: actions/checkout@v4
-
- - name: Run security checks
- run: |
- echo "::warning::Running security analysis - issues will be reported as warnings"
- echo "Checking for potential security issues..."
-
- # Look for dangerous functions
- if grep -r '\(strcpy\|sprintf\|gets\|strcat\)(' src/ --include="*.c"; then
- echo "::warning::Found potentially unsafe functions - consider using safer alternatives"
- fi
-
- # Check for TODO/FIXME comments that might indicate security issues
- if grep -r 'TODO.*\(security\|vulner\|exploit\)' src/; then
- echo "::warning::Found security-related TODO comments"
- fi
-
- if grep -r 'FIXME.*\(security\|vulner\|exploit\)' src/; then
- echo "::warning::Found security-related FIXME comments"
- fi
-
- echo "Security check completed"
- # Always succeed
- true \ No newline at end of file
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index a6cfbb4..4cd24b4 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -1,117 +1,30 @@
-name: Release
-
+name: Release Version
on:
push:
tags:
- - 'v*'
+ - "v*.*.*"
jobs:
release:
+ name: Release New Version
runs-on: ubuntu-latest
- container:
- image: 'fedora:latest'
-
steps:
- - name: Checkout code
- uses: actions/checkout@v4
- with:
- fetch-depth: 0
-
- - name: Install dependencies
- run: |
- dnf update -y
- dnf install -y \
- autoconf-archive \
- clang \
- clang-analyzer \
- bison \
- desktop-file-utils \
- flex \
- gcc \
- git \
- gmp-devel \
- gtk3 \
- libmpc-devel \
- libxml2-devel \
- make \
- mate-common \
- mate-desktop-devel \
- mpfr-devel \
- redhat-rpm-config \
- curl \
- which \
- sha256sum
-
- - name: Set up environment variables
- run: |
- export CPU_COUNT=$(nproc)
- echo "CPU_COUNT=$CPU_COUNT" >> $GITHUB_ENV
- echo "REPO_NAME=mate-calc" >> $GITHUB_ENV
- echo "OWNER_NAME=mate-desktop" >> $GITHUB_ENV
-
- - name: Generate build system
- run: |
- NOCONFIGURE=1 ./autogen.sh
-
- - name: Configure
- run: |
- ./configure --enable-compile-warnings=maximum
-
- - name: Build
- run: |
- make -j $CPU_COUNT
+ - name: Repository checkout
+ uses: actions/checkout@v5
- - name: Create distribution archive
- run: |
- make distcheck
+ - name: Install dependency packages
+ run: sudo .github/workflows/ubuntu.sh
- - name: Generate checksums
- run: |
- for file in mate-calc-*.tar.xz; do
- if [ -f "$file" ]; then
- sha256sum "$file" > "$file.sha256"
- fi
- done
+ - name: Build the source code
+ run: .github/workflows/builds.sh autotools
- - name: Notify release servers
- run: |
- # Notify MATE release servers (if configured)
- if [ -n "${{ secrets.RELEASE_NOTIFY_TOKEN }}" ]; then
- curl -X POST -H "Authorization: token ${{ secrets.RELEASE_NOTIFY_TOKEN }}" \
- -d '{"tag":"${{ github.ref_name }}","repo":"mate-calc"}' \
- https://release.mate-desktop.org/release || echo "Release notification failed"
- fi
+ - name: Install GH CLI
+ uses: dev-hanz-ops/[email protected]
+ with:
+ gh-cli-version: 2.72.0
- - name: Create GitHub Release
- uses: softprops/action-gh-release@v2
- with:
- draft: false
- prerelease: false
- generate_release_notes: true
- files: |
- mate-calc-*.tar.xz
- mate-calc-*.tar.xz.sha256
- body: |
- Release ${{ github.ref_name }} of MATE Calculator
-
- This release includes the source distribution archive and checksums.
-
- ## Installation
-
- Download the `mate-calc-*.tar.xz` file and verify it with the corresponding `.sha256` checksum file:
-
- ```bash
- sha256sum -c mate-calc-*.tar.xz.sha256
- ```
-
- Then extract and build:
-
- ```bash
- tar -xf mate-calc-*.tar.xz
- cd mate-calc-*
- ./configure
- make
- sudo make install
- ```
- env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file
+ - name: Create github release
+ run: |
+ gh release create ${{ github.ref_name }} --title ${{ github.ref_name }} --generate-notes mate-calc-*.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..3792bd3
--- /dev/null
+++ b/.github/workflows/ubuntu.sh
@@ -0,0 +1,43 @@
+#!/usr/bin/bash
+
+# Use grouped output messages
+infobegin() {
+ echo "::group::${1}"
+}
+infoend() {
+ echo "::endgroup::"
+}
+
+# Required packages on Ubuntu
+requires=(
+ ccache # Use ccache to speed up build
+ meson # Used for meson build
+)
+
+# https://git.launchpad.net/ubuntu/+source/mate-calc/tree/debian/control
+requires+=(
+ autopoint
+ bison
+ flex
+ git
+ libatk1.0-dev
+ libglib2.0-dev
+ libgmp-dev
+ libgtk-3-dev
+ libmpc-dev
+ libmpfr-dev
+ libxml2-dev
+ make
+ mate-common
+ yelp-tools
+)
+
+infobegin "Update system"
+apt-get update -y
+infoend
+
+infobegin "Install dependency packages"
+env DEBIAN_FRONTEND=noninteractive \
+ apt-get install --assume-yes \
+ ${requires[@]}
+infoend