From 1d3d482794a8187ca3dee076818f9ff4a6a61a33 Mon Sep 17 00:00:00 2001 From: Gabriel Radureau Date: Wed, 8 Apr 2026 23:21:25 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix:=20add=20GNU=20tar=20to=20bu?= =?UTF-8?q?ild=20cache=20image=20for=20cache=20compatibility\n\n-=20Add=20?= =?UTF-8?q?tar=20package=20to=20Dockerfile.build=20for=20--posix=20support?= =?UTF-8?q?\n-=20Revert=20to=20proper=20actions/cache@v5=20implementation\?= =?UTF-8?q?n-=20This=20fixes=20the=20'tar:=20unrecognized=20option:=20posi?= =?UTF-8?q?x'=20error=20in=20Gitea=20runner?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/ci-cd.yaml | 27 ++++++++++----------------- docker/Dockerfile.build | 3 ++- 2 files changed, 12 insertions(+), 18 deletions(-) diff --git a/.gitea/workflows/ci-cd.yaml b/.gitea/workflows/ci-cd.yaml index 3dd80e4..c95f9a8 100644 --- a/.gitea/workflows/ci-cd.yaml +++ b/.gitea/workflows/ci-cd.yaml @@ -160,7 +160,7 @@ jobs: - name: Restore Swagger Docs Cache id: cache-swagger-restore - uses: actions/cache/restore@v3 # Use v3 for better compatibility + uses: actions/cache/restore@v5 with: path: | pkg/server/docs/docs.go @@ -174,22 +174,15 @@ jobs: if: steps.cache-swagger-restore.outputs.cache-hit != 'true' run: go generate ./pkg/server - - name: Save Swagger Docs Cache (Compatible) - if: steps.cache-swagger-restore.outputs.cache-hit != 'true' - run: | - # Create cache manually for compatibility with older tar versions - mkdir -p /tmp/swagger_cache - cp -f pkg/server/docs/docs.go /tmp/swagger_cache/ - cp -f pkg/server/docs/swagger.json /tmp/swagger_cache/ - cp -f pkg/server/docs/swagger.yaml /tmp/swagger_cache/ - - # Create tarball without --posix flag - tar -czf /tmp/swagger_cache.tgz -C /tmp/swagger_cache . - - # Move to expected cache location - mkdir -p ${{ runner.temp }}/cache - mv /tmp/swagger_cache.tgz ${{ runner.temp }}/cache/ - shell: bash + - name: Save Swagger Docs Cache + id: cache-swagger-save + uses: actions/cache/save@v5 + with: + path: | + pkg/server/docs/docs.go + pkg/server/docs/swagger.json + pkg/server/docs/swagger.yaml + key: ${{ steps.cache-swagger-restore.outputs.cache-primary-key }} - name: Build all packages run: go build ./... diff --git a/docker/Dockerfile.build b/docker/Dockerfile.build index 14e6182..1d3ce86 100644 --- a/docker/Dockerfile.build +++ b/docker/Dockerfile.build @@ -19,7 +19,8 @@ RUN apk add --no-cache \ ca-certificates \ nodejs \ npm \ - postgresql-client + postgresql-client \ + tar # Add GNU tar for cache compatibility # Set up Go environment ENV GOPATH=/go