Skip to content

GitHub Actions

This tutorial shows how to run PMSM in GitHub Actions so tagged releases (and manual runs) generate, build, and publish packages. It matches the reference workflow in this repository.

What the workflow does

  1. Checks out your repository and installs Rust (stable).
  2. Installs OS packages needed for Debian builds (dpkg-dev, debhelper, build-essential). Other backends may need extra setup on the runner.
  3. Builds PMSM from source with cargo build --release.
  4. Sets VERSION from the Git tag (on release) or from workflow inputs (on workflow_dispatch).
  5. Patches version: in pmsm.yaml via sed so it matches the release.
  6. Runs pmsm validate, pmsm generate, pmsm build, and pmsm publish.
  7. Uploads build artifacts (.deb, .apk, .pkg.tar.xz, result) as a workflow artifact.

Add the workflow to your project

1. Copy the workflow file

Add a file at .github/workflows/pmsm.yml (or any name ending in .yml under .github/workflows/).

You can copy the contents from:

Rename or keep the filename; GitHub discovers all YAML files in that directory.

2. Commit pmsm.yaml

The workflow expects pmsm.yaml at the repository root (or adjust the sed and pmsm commands to your path). Ensure package.version can be updated by the workflow’s sed line, or replace that step with your own versioning strategy.

3. Configure secrets

Publishing steps read these environment variables from GitHub encrypted secrets:

Secret Used for
LAUNCHPAD_USERNAME Debian / Launchpad (dput) publishing
AUR_USERNAME AUR (combined with SSH key setup as required by your account)
CACHIX_AUTH_TOKEN Pushing to Cachix for Nix

Create secrets under Settings → Secrets and variables → Actions in your repository (or organization). Names must match the workflow exactly.

First-time pmsm setup

Interactive pmsm setup does not run inside CI. Run it locally once, then store resulting credentials or tokens as secrets / SSH keys as appropriate for each ecosystem.

4. Triggers

The reference workflow runs on:

  • releasepublished: When you publish a GitHub Release, VERSION is taken from the tag (v1.2.31.2.3).
  • workflow_dispatch: Manual run with inputs:
  • version (required): value written into pmsm.yaml via sed.
  • managers (optional): comma-separated list (apt,aur) or all (default). Controls pmsm build / pmsm publish loops.

5. Optional: select package managers only

For manual runs, set managers to e.g. apt,nix to avoid building every backend. Release events use the same logic when the input is empty or all.

6. Artifacts

The Upload artifacts step saves packages for download from the Actions run (retention 30 days in the reference file). Adjust paths or retention as needed.

Minimal example (simplified)

The README in PMSM shows a shorter snippet without version patching, inputs, or artifact upload. For production use, prefer the full pmsm-action.yml so behavior matches what this page describes.