🐛 fix: add GNU tar to build cache image for cache compatibility\n\n- Add tar package to Dockerfile.build for --posix support\n- Revert to proper actions/cache@v5 implementation\n- This fixes the 'tar: unrecognized option: posix' error in Gitea runner
This commit is contained in:
@@ -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 ./...
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user