Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions .github/workflows/publish-copr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,16 @@ jobs:
run: |
# Set up the rpmbuild tree.
mkdir -p "$HOME/rpmbuild"/{SOURCES,SPECS,SRPMS}
cp packaging/qn-bin.spec "$HOME/rpmbuild/SPECS/qn-bin.spec"

# sed the version literally into the spec rather than passing
# --define qn_version=... to rpmbuild. COPR's older chroots
# (EPEL 9, Fedora 42-44) re-parse the SRPM's spec during the
# binary-build phase without inheriting the source build's
# --define, leaving "%{qn_version}" unexpanded and breaking
# the build. Burning the version in at SRPM-build time means
# every downstream parse sees the same literal.
sed "s/@@QN_VERSION@@/$QN_VERSION/g" packaging/qn-bin.spec \
> "$HOME/rpmbuild/SPECS/qn-bin.spec"

# Pre-download both arch tarballs into SOURCES/ — rpmbuild -bs
# needs the actual files present locally to embed them in the
Expand All @@ -74,7 +83,6 @@ jobs:
# the runner; COPR's mock chroot handles that for the real build.
rpmbuild -bs "$HOME/rpmbuild/SPECS/qn-bin.spec" \
--define "_topdir $HOME/rpmbuild" \
--define "qn_version $QN_VERSION" \
--nodeps
ls -la "$HOME/rpmbuild/SRPMS/"

Expand Down
21 changes: 17 additions & 4 deletions packaging/qn-bin.spec
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,26 @@
# the parser state and causes downstream "Name field must be present"
# errors that look unrelated.
#
# The version is substituted by .github/workflows/publish-copr.yml via
# sed before rpmbuild -bs: every @@QN_VERSION@@ becomes the actual
# release version (0.1.4 etc.). We don't use a spec macro because COPR's
# older chroots (EPEL 9, Fedora 42-44) re-parse the spec during the
# binary-build phase without inheriting our --define from the source
# build, leading to a literal unexpanded macro in error messages.
#
# Built by .github/workflows/publish-copr.yml on each release. That
# workflow pre-downloads both arch tarballs into ~/rpmbuild/SOURCES/
# before invoking `rpmbuild -bs`, so the resulting SRPM carries the
# sources and COPR's mock can build with --enable-net=off if desired.
# before invoking rpmbuild -bs, so the resulting SRPM carries the
# sources and COPR's mock can build without network access.

# Skip the auto-generated debuginfo subpackage. Our binary is already
# stripped by cargo-dist upstream, and we don't claim the resulting
# /usr/lib/debug/... file in the files section, so without this Fedora's
# strict "unpackaged files found" check fails the build.
%global debug_package %{nil}

Name: qn
Version: %{qn_version}
Version: @@QN_VERSION@@
Release: 1%{?dist}
Summary: Command-line interface for the Quicknode SDK
License: MIT
Expand Down Expand Up @@ -63,5 +76,5 @@ install -Dm644 README.md %{buildroot}%{_docdir}/%{name}/README.md
%doc README.md

%changelog
* Thu Jun 11 2026 Quicknode <support@quicknode.com> - %{version}-1
* Thu Jun 11 2026 Quicknode <support@quicknode.com> - @@QN_VERSION@@-1
- Automated build from the GitHub Release upstream.
Loading