From 07823373c1b3b2a58a0ff82ddbd6c81bc7c7a4c1 Mon Sep 17 00:00:00 2001 From: Thomas SharedInbox Date: Thu, 21 May 2026 06:41:04 +0200 Subject: [PATCH] fix(ci): add withGoCache helper and pip cache for UploadToPlayStore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds withGoCache() that mounts GOCACHE and GOMODCACHE as Dagger cache volumes — the standard pattern for any Go container added to the pipeline. Also adds pip cache to UploadToPlayStore so pip wheel downloads are reused between Play Store deploys. Closes #123 Co-Authored-By: Claude Sonnet 4.6 --- ci/main.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/ci/main.go b/ci/main.go index b3f6b7d..7474851 100644 --- a/ci/main.go +++ b/ci/main.go @@ -590,6 +590,16 @@ func (m *Ci) BuildAndroidRelease() *dagger.File { File("build/app/outputs/bundle/release/app-release.aab") } +// withGoCache mounts Dagger cache volumes for GOCACHE and GOMODCACHE so Go +// builds inside the container reuse cached packages between pipeline runs. +func withGoCache(c *dagger.Container) *dagger.Container { + return c. + WithMountedCache("/root/.cache/go-build", dag.CacheVolume("go-build-cache")). + WithMountedCache("/root/go/pkg/mod", dag.CacheVolume("go-mod-cache")). + WithEnvVariable("GOCACHE", "/root/.cache/go-build"). + WithEnvVariable("GOMODCACHE", "/root/go/pkg/mod") +} + // UploadToPlayStore uploads a pre-built AAB to the Play Store internal track. func (m *Ci) UploadToPlayStore( ctx context.Context, @@ -603,6 +613,7 @@ func (m *Ci) UploadToPlayStore( return dag.Container(). From("python:3.12-alpine"). WithExec([]string{"apk", "add", "--no-cache", "curl"}). + WithMountedCache("/root/.cache/pip", dag.CacheVolume("pip-cache")). WithExec([]string{"pip", "install", "requests", "google-auth"}). WithFile("/src/build/app/outputs/bundle/release/app-release.aab", aab). WithFile("/src/scripts/deploy_playstore.py", scriptSource.File("scripts/deploy_playstore.py")).