Skip to content

fix(ci): pin GOMODCACHE for goreleaser-cross module cache mount - #701

Merged
pcfreak30 merged 1 commit into
developfrom
fix/ci-crossbuild-modcache
Sep 13, 2026
Merged

pcfreak30 merged 1 commit into
developfrom
fix/ci-crossbuild-modcache

Conversation

@pcfreak30

@pcfreak30 pcfreak30 commented Sep 13, 2026 •

Copy link
Copy Markdown
Member

Pins GOMODCACHE=/go/pkg/mod in the goreleaser-cross container invocations so the bind-mounted host module cache (with the staged canvasassets embed inputs) is the one Go resolves. The image defaults to GOPATH=$HOME/go, so the mount to /go/pkg/mod was ignored and every container build re-downloaded modules fresh, failing with pattern appsassets: no matching files found.

Also adds a ci-logs artifact upload (if: always()) to the snapshot job so goreleaser/mcpb failures keep their tee'd logs.


Description

Fixes the goreleaser-cross CI runs so the staged canvasassets embed inputs are actually used during cross-compilation.

Problem:
The ghcr.io/goreleaser/goreleaser-cross Docker image uses GOPATH=$HOME/go by default, which makes its GOMODCACHE resolve to /root/go/pkg/mod — not the /go/pkg/mod path where the host module cache is bind-mounted. As a result the mount was silently ignored, the container re‑downloaded every module fresh, and the //go:embed appsassets inputs (staged on the host) were absent, failing the build with pattern appsassets: no matching files found.

Changes made:

  • In both .github/workflows/go.yml and .github/workflows/release.yml, explicitly set the environment variable GOMODCACHE=/go/pkg/mod in the docker run command. This aligns the container’s module cache target with the mounted host cache, so the pre‑staged embedded assets are visible to the cross‑build.
  • In .github/workflows/go.yml, added an “Upload ci logs” step (using if: always()) that uploads the ci-logs/ directory even on failure, retaining artifacts for 7 days. This ensures diagnostic logs from goreleaser or .mcpb runs are preserved even when the build fails.

The goreleaser-cross image resolves GOPATH=$HOME/go, so its module cache is
/root/go/pkg/mod, not /go/pkg/mod. Bind-mounting the host module cache at
/go/pkg/mod without also setting GOMODCACHE was therefore ignored: the
container re-downloaded every module fresh and the staged (gitignored)
canvasassets embed inputs were absent, failing the snapshot build with
'pattern appsassets: no matching files found'.

Pass -e GOMODCACHE=/go/pkg/mod in both the go.yml snapshot run and the
release.yml release run, and upload ci-logs/ as an artifact when the
snapshot job fails so goreleaser/mcpb failures keep their raw logs.
@kody-ai

kody-ai Bot commented Sep 13, 2026 •

Copy link
Copy Markdown

Kody Review Complete

Great news! 🎉
No issues were found that match your current review configurations.

Keep up the excellent work! 🚀

Kody Guide: Usage and Configuration
Interacting with Kody
  • Request a Review: Ask Kody to review your PR manually by adding a comment with the @kody start-review command at the root of your PR.

  • Validate Business Logic: Ask Kody to validate your code against business rules by adding a comment with the @kody -v business-logic command.

  • Provide Feedback: Help Kody learn and improve by reacting to its comments with a 👍 for helpful suggestions or a 👎 if improvements are needed.

Current Kody Configuration
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ✅

Access your configuration settings here.

​

@github-actions

Copy link
Copy Markdown

Code Coverage Report

Total Coverage: 55.3%

Generated from commit: ebd6921
Repository: LumeWeb/pinner-cli

@pcfreak30
pcfreak30 merged commit 6dae2a0 into develop Sep 13, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant