GitHub Action

rmqa comes with a GitHub Action, so a workflow can check a release without downloading anything by hand. The action fetches the rmqa binary for the runner, runs rmqa check --format github, and fails the step when the release isn’t ready. Each problem shows up as an annotation on the run, and a summary table goes to the job summary.

The Short Version

- uses: softdevstudio/[email protected]
  with:
    dir: dist

Put it after the steps that build the release files and before the step that publishes them. If rmqa finds a problem, the publish step never runs.

Inputs

Input Default Meaning
dir dist Folder with the release files.
manifest rmqa.toml Path to the manifest.
version empty The version the release must carry. Empty means the manifest decides. A leading v is dropped, so ${{ github.ref_name }} works.
github empty Check a release on GitHub instead of a folder: owner/repo or owner/repo@tag.
strict false Fail on warnings too.
rmqa-version empty The rmqa release to use, such as 0.1.2. Empty means the latest.

The action runs on Linux and macOS runners, x86-64 and ARM64, and on Windows runners. Windows on ARM uses the x86-64 build. rmqa’s own CI runs the action on each kind of runner.

A Full Release Workflow

This workflow builds a Go command for five platforms when a tag is pushed, checks the result, and only then publishes:

name: Release
on:
  push:
    tags: ["v*"]

permissions:
  contents: write

jobs:
  release:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-go@v5
        with:
          go-version: stable

      - name: Build
        run: |
          for p in linux/amd64 linux/arm64 darwin/arm64 darwin/amd64 windows/amd64; do
            os=${p%/*}; arch=${p#*/}; exe=""; [ "$os" = windows ] && exe=".exe"
            mkdir -p stage/$os-$arch dist
            CGO_ENABLED=0 GOOS=$os GOARCH=$arch go build -o stage/$os-$arch/tidy$exe ./cmd/tidy
            cp LICENSE README.md stage/$os-$arch/
            if [ "$os" = windows ]; then
              (cd stage/$os-$arch && zip -q ../../dist/tidy_${os}_${arch}.zip *)
            else
              tar -czf dist/tidy_${os}_${arch}.tar.gz -C stage/$os-$arch .
            fi
          done
          (cd dist && sha256sum * > SHA256SUMS)

      - name: Check the release
        uses: softdevstudio/[email protected]
        with:
          dir: dist
          version: ${{ github.ref_name }}

      - name: Publish
        env:
          GH_TOKEN: ${{ github.token }}
        run: gh release create "$GITHUB_REF_NAME" dist/* --title "tidy $GITHUB_REF_NAME"

Checking a Draft Release

Some projects let a tool such as GoReleaser create a draft release, look it over, then publish it by hand. rmqa can check the draft on GitHub directly. Drafts are visible only with a token, which the action passes along:

- uses: softdevstudio/[email protected]
  with:
    github: ${{ github.repository }}@${{ github.ref_name }}

The draft release use case walks through it.

Without the Action

Any CI system can run the binary. The exit status is 0 when the release is ready, 1 when it isn’t and 2 when rmqa couldn’t run:

curl -sSfL https://github.com/softdevstudio/rmqa/releases/latest/download/rmqa_linux_amd64.tar.gz | tar -xz ./rmqa
./rmqa check dist --version "$VERSION"

--format json gives the full result for your own scripts, and --format markdown a table for a merge request comment.