Skip to content

GitHub Actions

Rlsr ships a composite GitHub Action so you can run releases as a single step alongside other steps (like installing Rust or running tests). It installs a pinned rlsr release, runs your rlsr.yml, and optionally publishes artifacts.

Release on tags:

name: Release
on:
push:
tags:
- "v*"
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Release
uses: iamd3vil/rlsr/.github/actions/rlsr@v0.11.0
with:
config: rlsr.yml
publish: true
rm_dist: true
github_token: ${{ secrets.GITHUB_TOKEN }}

Build only (no publish), for example on pull requests. Untagged commits need --snapshot (rlsr v0.11.0 or later):

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: iamd3vil/rlsr/.github/actions/rlsr@v0.11.0
with:
publish: false
args: --snapshot
NameTypeDefaultDescription
configstringrlsr.ymlPath to the rlsr config file.
publishstringfalsePublish artifacts (false passes --skip-publish).
rm_diststringfalseRemove the dist directory before building.
rlsr_versionstringlatestVersion tag to install (example: v0.11.0).
argsstring""Extra args for rlsr (space-separated).
working_directorystring.Working directory to run rlsr in.
github_tokenstring""Token for GitHub API operations. Falls back to GITHUB_TOKEN.
  • Publishing needs a tag and a clean repo; otherwise rlsr skips publish.
  • Use actions/checkout with fetch-depth: 0 so tags are available for changelogs.
  • Supported runners: Linux x86_64, Linux arm64 (rlsr v0.11.0 or later) and macOS arm64.
  • Use rlsr_version to pin a known version instead of latest.

Monorepo working directory:

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: iamd3vil/rlsr/.github/actions/rlsr@v0.11.0
with:
working_directory: ./crates/my-tool
config: rlsr.yml
publish: true

Custom runner:

jobs:
release:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: iamd3vil/rlsr/.github/actions/rlsr@v0.11.0
with:
publish: false

Publish HEAD of the default branch every night as the rolling nightly prerelease. rlsr skips the run when the nightly tag already points at HEAD.

on:
schedule:
- cron: "0 3 * * *"
workflow_dispatch:
jobs:
nightly:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
- uses: iamd3vil/rlsr/.github/actions/rlsr@v0.11.0
with:
publish: true
args: --nightly
github_token: ${{ secrets.GITHUB_TOKEN }}

fetch-tags is needed so rlsr can see where the nightly tag points. --nightly needs rlsr v0.11.0 or later.

By default rlsr runs every build on one runner. To give each target its own runner, run rlsr with --split --targets <target> in a build matrix. Each runner builds and packages its targets and writes a manifest to dist/. A final job downloads every runner’s dist/ and runs rlsr --merge, which checksums and publishes all the archives together. rlsr.yml stays the same as for local releases.

--targets matches each build’s target: the triple for type: rust builds, os/arch for type: go builds, or the target field you set on a custom build.

permissions:
contents: read
jobs:
build:
strategy:
matrix:
include:
- name: linux
target: x86_64-unknown-linux-musl
- name: windows
target: x86_64-pc-windows-gnu
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
# Install toolchains here (Rust, zig and cargo-zigbuild for type: rust).
- uses: iamd3vil/rlsr/.github/actions/rlsr@v0.11.0
with:
args: --split --targets ${{ matrix.target }}
- uses: actions/upload-artifact@v4
with:
name: dist-${{ matrix.name }}
path: dist/
if-no-files-found: error
release:
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/download-artifact@v4
with:
pattern: dist-*
path: dist/
merge-multiple: true
- uses: iamd3vil/rlsr/.github/actions/rlsr@v0.11.0
with:
publish: true
args: --merge
github_token: ${{ secrets.GITHUB_TOKEN }}

--split and --merge need rlsr v0.10.0 or later. The action installs the latest release by default.

Don’t pass rm_dist: true to the merge job, because it would delete the downloaded archives. rlsr refuses --merge together with --rm-dist.

If you build binaries outside rlsr, you can still put them at each build’s artifact path and run rlsr with --skip-build in a single final job instead.

Use your normal workflow file and run it with:

Terminal window
act workflow_dispatch -W .github/workflows/your-workflow.yml -s GITHUB_TOKEN=dummy