🐛 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
|
- name: Restore Swagger Docs Cache
|
||||||
id: cache-swagger-restore
|
id: cache-swagger-restore
|
||||||
uses: actions/cache/restore@v3 # Use v3 for better compatibility
|
uses: actions/cache/restore@v5
|
||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
pkg/server/docs/docs.go
|
pkg/server/docs/docs.go
|
||||||
@@ -174,22 +174,15 @@ jobs:
|
|||||||
if: steps.cache-swagger-restore.outputs.cache-hit != 'true'
|
if: steps.cache-swagger-restore.outputs.cache-hit != 'true'
|
||||||
run: go generate ./pkg/server
|
run: go generate ./pkg/server
|
||||||
|
|
||||||
- name: Save Swagger Docs Cache (Compatible)
|
- name: Save Swagger Docs Cache
|
||||||
if: steps.cache-swagger-restore.outputs.cache-hit != 'true'
|
id: cache-swagger-save
|
||||||
run: |
|
uses: actions/cache/save@v5
|
||||||
# Create cache manually for compatibility with older tar versions
|
with:
|
||||||
mkdir -p /tmp/swagger_cache
|
path: |
|
||||||
cp -f pkg/server/docs/docs.go /tmp/swagger_cache/
|
pkg/server/docs/docs.go
|
||||||
cp -f pkg/server/docs/swagger.json /tmp/swagger_cache/
|
pkg/server/docs/swagger.json
|
||||||
cp -f pkg/server/docs/swagger.yaml /tmp/swagger_cache/
|
pkg/server/docs/swagger.yaml
|
||||||
|
key: ${{ steps.cache-swagger-restore.outputs.cache-primary-key }}
|
||||||
# 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: Build all packages
|
- name: Build all packages
|
||||||
run: go build ./...
|
run: go build ./...
|
||||||
|
|||||||
@@ -19,7 +19,8 @@ RUN apk add --no-cache \
|
|||||||
ca-certificates \
|
ca-certificates \
|
||||||
nodejs \
|
nodejs \
|
||||||
npm \
|
npm \
|
||||||
postgresql-client
|
postgresql-client \
|
||||||
|
tar # Add GNU tar for cache compatibility
|
||||||
|
|
||||||
# Set up Go environment
|
# Set up Go environment
|
||||||
ENV GOPATH=/go
|
ENV GOPATH=/go
|
||||||
|
|||||||
Reference in New Issue
Block a user