Tools, configurations and documentation for Slackware CI workflows
Find a file
2026-05-15 13:13:36 +02:00
.forgejo/workflows Tools, configurations and documentation for Slackware CI workflows 2026-05-15 13:13:36 +02:00
LICENSE Initial commit 2026-05-15 13:08:14 +02:00
README.md Tools, configurations and documentation for Slackware CI workflows 2026-05-15 13:13:36 +02:00
slk-ci.sh Tools, configurations and documentation for Slackware CI workflows 2026-05-15 13:13:36 +02:00

Slackware CI Tools

This repository provides the CI helper script and workflow templates for building and testing SlackBuild packages on the Slackware Community Forge.

Your package repository can live anywhere on the forge under your own username - you do not need to be a member of the slackware organisation to use these tools.


Prerequisites

Before setting up CI for your package repository you need:

No special permissions, no organisation membership, nothing to install locally beyond git itself.


Quickstart: reusable workflow

The fastest way to add CI to your SlackBuild repository is to reference the reusable workflow from this repository. Create a single file in your repository:

your-package/
  your-package.SlackBuild
  your-package.info
  slack-desc
  .forgejo/
    workflows/
      build.yml          <- create this

Minimal build.yml:

on: [push, pull_request]

jobs:
  build:
    uses: slackware/ci-tools/.forgejo/workflows/reusable-build.yml@main
    with:
      package_name: your-package
      version: "1.2.3"

Push the file. The workflow triggers on every push and pull request, pulls a Slackware -current x86_64 builder container, and builds your SlackBuild inside it.

That is all that is needed for a package with no unusual dependencies.

With extra build dependencies

If your SlackBuild requires libraries or tools beyond the standard compiler toolchain, list them in build_deps:

jobs:
  build:
    uses: slackware/ci-tools/.forgejo/workflows/reusable-build.yml@main
    with:
      package_name: your-package
      version: "1.2.3"
      build_deps: "cmake libfoo libevent python3-requests"

These are installed from the Slackware package mirror inside the container before the build runs. Each CI job starts from a clean container, so installed packages do not carry over between runs.

Full list of inputs

Input Required Default Description
package_name yes - Base name matching the .SlackBuild filename
version yes - Version string to build and verify
build_deps no "" Space-separated extra packages to install
slackware_version no current current or 15.0
arch no x86_64 x86_64 or i586
slackbuild_dir no . Path to the SlackBuild, relative to repo root
upload_artifact no true Upload the built .txz as a workflow artifact

What the builder image contains

Workflows run inside a pre-built Slackware container image. The builder image (slackware-builder) includes the following on top of the minimal base system:

Package(s) Purpose
gcc, gcc-g++, binutils C and C++ compiler toolchain
make GNU Make
cmake, meson, ninja Modern build systems
m4, autoconf, automake, libtool GNU Autotools
patch, git Patching and version control
python3 Required by meson, cmake helpers, many configure scripts
pkgconf Library discovery (pkg-config compatible)
kernel-headers Linux kernel API headers

The base system additionally provides bash, wget, perl, xz, bzip2, gzip, ca-certificates, slackpkg, and the full Slackware a series.

If a dependency your SlackBuild needs is not listed above, add it to build_deps. A build failure due to a missing library is easier to diagnose than a mis-configured CI setup, so do not hesitate to be explicit.

Four image variants are available:

Tag Slackware Architecture
slackware-builder:current -current x86_64
slackware-builder:current-i586 -current i586
slackware-builder:15.0 15.0 x86_64
slackware-builder:15.0-i586 15.0 i586

Testing all four variants

To verify your package builds on both Slackware 15.0 and -current, in both 32-bit and 64-bit, use the matrix form. All four jobs run in parallel:

on: [push, pull_request]

jobs:
  build:
    strategy:
      fail-fast: false
      matrix:
        slackware_version: [current, "15.0"]
        arch: [x86_64, i586]
    uses: slackware/ci-tools/.forgejo/workflows/reusable-build.yml@main
    with:
      package_name: your-package
      version: "1.2.3"
      build_deps: "cmake libfoo"
      slackware_version: ${{ matrix.slackware_version }}
      arch: ${{ matrix.arch }}

fail-fast: false means a failure on one variant does not cancel the remaining three, so you see the full picture in one run.


Triggering a release build

To automatically attach the built .txz to a Forgejo release when you tag a commit:

on:
  push:
    tags:
      - "v*"

jobs:
  build:
    uses: slackware/ci-tools/.forgejo/workflows/reusable-build.yml@main
    with:
      package_name: your-package
      version: ${{ github.ref_name }}   # strips the leading "v"

  release:
    needs: build
    runs-on: slackware
    steps:
      - name: Create release
        uses: actions/forgejo-release@v2
        with:
          direction: upload
          release-dir: artifacts/
          token: ${{ secrets.GITHUB_TOKEN }}

Using slk-ci.sh directly

If you prefer full control over each workflow step rather than using the reusable workflow, you can source slk-ci.sh directly. Download it into your workspace in a workflow step:

- name: Fetch CI helper
  run: |
    curl -sf \
      https://forge.slackware.nl/slackware/ci-tools/raw/branch/main/slk-ci.sh \
      -o slk-ci.sh

Or commit it to your repository alongside your SlackBuild so the version is pinned to a specific commit and your builds are fully reproducible:

your-package/
  your-package.SlackBuild
  slk-ci.sh                  <- committed copy
  .forgejo/workflows/build.yml

Either way, source it at the start of each build step:

- name: Build
  run: |
    source slk-ci.sh
    slk_install_deps cmake libfoo
    slk_build .
    slk_install your-package
    slk_check_version your-package 1.2.3

Function reference

Function Arguments Description
slk_info - Prints Slackware version, arch, and date. Called automatically on source.
slk_install_deps PKG [PKG ...] Installs packages from the Slackware mirror via slackpkg.
slk_build BUILDDIR Runs the .SlackBuild in BUILDDIR with OUTPUT set to a CI staging directory.
slk_install PKG Installs a built .txz package via installpkg --terse.
slk_check_version NAME VERSION Fails the step if NAME is not installed at VERSION.

A full workflow using slk-ci.sh directly:

on: [push, pull_request]

jobs:
  build:
    runs-on: slackware
    container:
      image: registry.slackware.nl/slackware/slackware-builder:current
    steps:
      - uses: actions/checkout@v4

      - name: Fetch CI helper
        run: |
          curl -sf \
            https://forge.slackware.nl/slackware/ci-tools/raw/branch/main/slk-ci.sh \
            -o slk-ci.sh

      - name: Install dependencies
        run: source slk-ci.sh && slk_install_deps cmake libfoo

      - name: Build
        run: source slk-ci.sh && slk_build .

      - name: Verify
        run: |
          source slk-ci.sh
          slk_install your-package
          slk_check_version your-package 1.2.3

      - name: Upload artifact
        uses: actions/upload-artifact@v4
        with:
          name: your-package-current-x86_64
          path: /tmp/ci-packages/*.t?z

Learning more about Forgejo Actions

The Forgejo Actions syntax is nearly identical to GitHub Actions. The GitHub documentation is the most comprehensive reference and transfers directly; the Forgejo-specific page documents the differences.

Key differences from GitHub Actions to keep in mind:

  • Workflow files go in .forgejo/workflows/ not .github/workflows/
  • runs-on: slackware selects the forge runner; GitHub-hosted runner names such as ubuntu-latest will not work here
  • The automatic repository token is available as GITEA_TOKEN (also exposed as GITHUB_TOKEN for compatibility with actions that expect it under that name)
  • Most actions/* actions from GitHub work; actions that depend on GitHub-specific infrastructure do not

Getting help

Open an issue in this repository or post on the Slackware Linux Forum if you run into trouble with the CI setup.