%global _build_id_links none %global debug_package %{nil} %undefine source_date_epoch_from_changelog %global upstream_version 1.7.12 %global software_name actionlint Name: %{software_name} Version: %{upstream_version} Release: 1%{?dist} Summary: Static checker for GitHub/Gitea Actions workflow files License: MIT URL: https://github.com/rhysd/actionlint # Source0 unpacks to actionlint-%%{upstream_version}/ (archive prefix set by # the vendoring workflow). Same filename/layout as the Debian orig tarball. Source0: %{software_name}_%{upstream_version}.orig.tar.gz # Vendored Go modules (Debian orig-vendor component: contents of vendor/ only). Source1: %{software_name}_%{upstream_version}.orig-vendor.tar.gz BuildRequires: tar, golang # actionlint shells out to shellcheck for the run: blocks when present. Recommends: shellcheck %description Static checker for GitHub Actions workflow files. Checks workflow syntax, expressions, contexts, matrix/needs wiring and (with shellcheck installed) embedded run scripts. The expression grammar is the same engine the Gitea runner uses to evaluate workflow expressions. %prep %autosetup -p1 -n %{software_name}-%{upstream_version} # Use vendored modules to avoid network access during build. # Source1 is a Debian-style orig-vendor component (contents of vendor/ only). mkdir -p vendor tar -xf %{SOURCE1} -C vendor if [ ! -f vendor/modules.txt ]; then echo "ERROR: vendor/modules.txt not found. Provide a vendored modules tarball via Source1." >&2 exit 1 fi %build export GOTOOLCHAIN=local export GOPROXY=off export GOSUMDB=off export GOMODCACHE="$PWD/.gomodcache" export CGO_ENABLED=0 go build -mod=vendor -trimpath -buildvcs=false \ -ldflags "-s -w" \ -o actionlint ./cmd/actionlint %install install -Dsm755 actionlint %{buildroot}%{_bindir}/%{software_name} %check %files %license LICENSE.txt %doc README.md %{_bindir}/%{software_name} %changelog