From 25a424596793a94290a824a17a65881f2996d9e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bir=C3=B3=2C=20Csaba=20Attila?= Date: Thu, 16 Apr 2026 15:39:52 +0200 Subject: [PATCH] hotfix: fix COPR and Snap publish workflows - copr: rewrite spec to use pre-built binaries from GitHub Releases instead of building from source (Go 1.26 unavailable in Fedora repos) - snap: use go/latest/stable channel (go/1.26/stable doesn't exist) Closes #203 --- .github/workflows/copr.yml | 9 ++++++--- rpmbuild/copia-cli.spec | 13 +++++++------ snap/snapcraft.yaml | 2 +- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/.github/workflows/copr.yml b/.github/workflows/copr.yml index 1779526..fa217d8 100644 --- a/.github/workflows/copr.yml +++ b/.github/workflows/copr.yml @@ -31,11 +31,14 @@ jobs: run: | VERSION=${{ steps.version.outputs.version }} sed -i "s/^Version:.*$/Version: ${VERSION}/" rpmbuild/copia-cli.spec - curl -sL "https://github.com/${{ github.repository }}/archive/v${VERSION}/copia-cli-${VERSION}.tar.gz" \ - -o rpmbuild/copia-cli-${VERSION}.tar.gz + gh release download "v${VERSION}" --pattern "copia-cli_${VERSION}_linux_amd64.tar.gz" --output rpmbuild/copia-cli_${VERSION}_linux_amd64.tar.gz + gh release download "v${VERSION}" --pattern "copia-cli_${VERSION}_linux_arm64.tar.gz" --output rpmbuild/copia-cli_${VERSION}_linux_arm64.tar.gz rpmbuild -bs rpmbuild/copia-cli.spec \ --define "_sourcedir $(pwd)/rpmbuild" \ - --define "_srcrpmdir $(pwd)/rpmbuild" + --define "_srcrpmdir $(pwd)/rpmbuild" \ + --target x86_64 + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Submit to COPR run: | diff --git a/rpmbuild/copia-cli.spec b/rpmbuild/copia-cli.spec index ad18053..5b2f897 100644 --- a/rpmbuild/copia-cli.spec +++ b/rpmbuild/copia-cli.spec @@ -7,9 +7,13 @@ Summary: CLI for Copia — source control for industrial automation License: AGPL-3.0-only URL: https://%{goipath} -Source0: https://%{goipath}/archive/v%{version}/%{name}-%{version}.tar.gz -BuildRequires: golang >= 1.26 +%ifarch x86_64 +Source0: https://%{goipath}/releases/download/v%{version}/%{name}_%{version}_linux_amd64.tar.gz +%endif +%ifarch aarch64 +Source0: https://%{goipath}/releases/download/v%{version}/%{name}_%{version}_linux_arm64.tar.gz +%endif %description copia-cli brings Copia repositories, issues, pull requests, and other @@ -17,10 +21,7 @@ concepts to the terminal next to where you are already working with git and your code. %prep -%autosetup -n %{name}-%{version} - -%build -go build -ldflags "-s -w -X %{goipath}/internal/build.Version=%{version} -X %{goipath}/internal/build.Date=$(date -u +%%Y-%%m-%%d)" -o %{name} ./cmd/copia-cli +%setup -c %install install -Dpm 0755 %{name} %{buildroot}%{_bindir}/%{name} diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index 5d4886a..fdd7ad5 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -21,7 +21,7 @@ parts: source: . source-type: local build-snaps: - - go/1.26/stable + - go/latest/stable go-buildtags: [] go-generate: [] override-build: |