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¶
- Checks out your repository and installs Rust (stable).
- Installs OS packages needed for Debian builds (
dpkg-dev,debhelper,build-essential). Other backends may need extra setup on the runner. - Builds PMSM from source with
cargo build --release. - Sets
VERSIONfrom the Git tag (onrelease) or from workflow inputs (onworkflow_dispatch). - Patches
version:inpmsm.yamlviasedso it matches the release. - Runs
pmsm validate,pmsm generate,pmsm build, andpmsm publish. - 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:
- Upstream reference:
pmsm-action.ymlin the PMSM repository.
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:
release—published: When you publish a GitHub Release,VERSIONis taken from the tag (v1.2.3→1.2.3).workflow_dispatch: Manual run with inputs:- version (required): value written into
pmsm.yamlviased. - managers (optional): comma-separated list (
apt,aur) orall(default). Controlspmsm build/pmsm publishloops.
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.
Related¶
- Read the Docs setup — host this documentation site on Read the Docs.
- Quick start — local workflow before automating.