Build .opm in CI/CD with opmbuild

Automate building and testing OTOBO and Znuny packages without a full ticketing system installed — using the CPAN tool OPM::Maker (opmbuild) in GitHub Actions.

Build .opm in CI/CD with opmbuild

OPM::Maker is a standalone Perl CPAN module that provides the .opm tools without requiring a full OTOBO or Znuny installation. This makes it ideal for CI/CD pipelines.

Installation

bash
cpanm OPM::Maker

This makes the opmbuild command available.

Commands

CommandPurpose
opmbuild sopmtest MyPackage.sopmValidate manifest XML and structure
opmbuild filetest MyPackage.sopmVerify file list against files on disk
opmbuild dependencies MyPackage.sopmList dependencies
opmbuild build --output dist/ MyPackage.sopmGenerate .opm file
opmbuild index repo/Create repository index XML for a directory containing .opm files

GitHub Actions Example

yaml
name: Build OPM package

on:
  push:
    tags: ['v*']

jobs:
  build:
    runs-on: ubuntu-latest
    container: perl:5.40
    steps:
      - uses: actions/checkout@v4

      - name: Install OPM::Maker
        run: cpanm --notest OPM::Maker

      - name: Validate manifest
        run: |
          opmbuild sopmtest MyPackage.sopm
          opmbuild filetest MyPackage.sopm

      - name: Build .opm
        run: opmbuild build --output dist/ MyPackage.sopm

      - name: Upload artifact
        uses: actions/upload-artifact@v4
        with:
          name: opm-package
          path: dist/*.opm

Without a Dedicated Pipeline: The Hub Build Service

Open ITSM Hub optionally provides a stateless service that wraps opmbuild behind an HTTP API (see backend/opmbuild-service). When enabled, the .sopm Validator and generators perform actual Perl validation on the server side—completely without a local Perl installation.

Tip: Multi-Framework Builds

Since a .sopm file can contain multiple <Framework> lines, a single build generates an .opm package that can be installed on all declared forks. Check your compatibility beforehand using the Compatibility Checker.