Skip to content

Release Workflow

The .github/workflows/release.yml workflow builds cross-compiled static binaries for linux/amd64 and linux/arm64, generates a combined SHA-256 checksums file, and publishes them as a GitHub Release when a version tag is pushed.

Trigger Events

EventFilterDescription
pushtags: ['v*']Runs when a tag matching v* is pushed

The workflow does not trigger on branch pushes, pull requests, or tags that do not match the v* pattern.

Permissions

The workflow declares a minimal permissions block:

ScopeAccessReason
contentswriteRequired for creating releases and uploading assets

No other permission scopes are granted. The workflow uses GITHUB_TOKEN (not personal access tokens).

Jobs

The workflow has two jobs: build runs once per architecture via a matrix strategy, and release runs after all matrix builds complete.

build

Cross-compiles a static binary for each target architecture and uploads it with its checksum as a GitHub Actions artifact.

StepCommand / ActionPurpose
Checkoutactions/checkout@v4Clone repository at the tagged commit
Setup Goactions/setup-go@v5 (go-version: '1.24')Install Go with module caching
Build binarygo build -ldflags "..." -o plexd-linux-$GOARCH ./cmd/plexdCross-compile static binary
Generate checksumsha256sum plexd-linux-$GOARCH > plexd-linux-$GOARCH.sha256Create per-artifact checksum file
Upload artifactactions/upload-artifact@v4Upload binary and checksum for release job

The build step sets CGO_ENABLED=0, GOOS=linux, and GOARCH from the matrix, producing a fully static binary with no shared library dependencies.

Matrix strategy:

ParameterValues
goarchamd64, arm64

Each matrix entry produces one artifact named plexd-linux-{arch} containing both the binary and its .sha256 checksum file.

release

Downloads all build artifacts and creates a GitHub Release with auto-generated notes.

StepCommand / ActionPurpose
Download artifactsactions/download-artifact@v4 (merge-multiple: true)Download all matrix artifacts into one directory
Generate combined checksumscat plexd-linux-*.sha256 > checksums.sha256Combine per-binary checksums into single file
Create GitHub Releasesoftprops/action-gh-release@v2 (generate_release_notes: true)Create release and upload assets

The release job has needs: build, ensuring it only runs after all matrix builds succeed. The merge-multiple: true option on download-artifact merges all artifacts into a single flat directory.

Build Arguments and Ldflags

The build step injects version metadata via Go linker flags matching the pattern used in the Dockerfile:

-s -w -X main.version=${VERSION} -X main.commit=${COMMIT} -X main.date=${DATE}
FlagSourceExample Value
-s -w(static flags)Strips debug info and DWARF symbols
-X main.version=...GITHUB_REF_NAMEv1.2.3
-X main.commit=...GITHUB_SHA (first 8 chars)a1b2c3d4
-X main.date=...date -u +%Y-%m-%dT%H:%M:%SZ2025-01-15T12:00:00Z

Release Assets

FileDescription
plexd-linux-amd64Static binary for x86_64
plexd-linux-arm64Static binary for ARM64
checksums.sha256Combined SHA-256 checksums for all binaries

Binary names follow the plexd-linux-{arch} convention expected by install.sh.

Checksum Format

The checksums.sha256 file contains one line per binary in standard sha256sum output format:

<64-char hex hash>  plexd-linux-amd64
<64-char hex hash>  plexd-linux-arm64

Two spaces separate the hash from the filename. This format is compatible with sha256sum --check for verification and with install.sh, which downloads checksums.sha256 and greps for the target binary name.

Action Versions

All actions are pinned to full SHA hashes for supply-chain hardening. The checkout and setup-go pins match those in ci.yml.

ActionVersionSHAPurpose
actions/checkoutv4.3.134e114876b0b11c390a56381ad16ebd13914f8d5Repository checkout
actions/setup-gov5.6.040f1582b2485089dde7abd97c1529aa768e1baffGo installation and module cache
actions/upload-artifactv4.6.2ea165f8d65b6e75b540449e92b4886f43607fa02Upload build artifacts
actions/download-artifactv4.3.0d3f86a106a0bac45b974a628896c90dbdf5c8093Download artifacts in release job
softprops/action-gh-releasev2.5.0a06a81a03ee405af7f2048a818ed3f03bbf83c7bCreate GitHub Release with assets

Creating a Release

To publish a new release:

bash
git tag v1.2.3
git push origin v1.2.3

The workflow builds binaries for both architectures, generates a combined checksums.sha256 file, and creates a GitHub Release with auto-generated release notes from the commit history since the previous tag. Three files (two binaries and checksums.sha256) are attached as release assets.