mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-11-25 11:21:02 +00:00
Fix make release-server-xgo
in CI and localy (#3072)
fix regressions of: - #3010 - #3065 and make `make release-server-xgo` work on a manual exec (not run by ci)
This commit is contained in:
parent
a37af3eeac
commit
567e83350c
2 changed files with 11 additions and 4 deletions
|
@ -159,6 +159,7 @@ steps:
|
||||||
depends_on:
|
depends_on:
|
||||||
- vendor
|
- vendor
|
||||||
- build-web
|
- build-web
|
||||||
|
- cross-compile-server-preview
|
||||||
image: *buildx_plugin
|
image: *buildx_plugin
|
||||||
settings:
|
settings:
|
||||||
dry_run: true
|
dry_run: true
|
||||||
|
@ -175,6 +176,7 @@ steps:
|
||||||
depends_on:
|
depends_on:
|
||||||
- vendor
|
- vendor
|
||||||
- build-web
|
- build-web
|
||||||
|
- cross-compile-server-preview
|
||||||
image: *buildx_plugin
|
image: *buildx_plugin
|
||||||
settings:
|
settings:
|
||||||
dry_run: true
|
dry_run: true
|
||||||
|
|
13
Makefile
13
Makefile
|
@ -211,10 +211,15 @@ release-server-xgo: check-xgo ## Create server binaries for release using xgo
|
||||||
@echo "arch (xgo):$(TARGETARCH_XGO)"
|
@echo "arch (xgo):$(TARGETARCH_XGO)"
|
||||||
@echo "arch (buildx):$(TARGETARCH_BUILDX)"
|
@echo "arch (buildx):$(TARGETARCH_BUILDX)"
|
||||||
|
|
||||||
CGO_CFLAGS="$(CGO_CFLAGS)" xgo -go $(XGO_VERSION) -dest ./dist/server/$(TARGETOS)-$(TARGETARCH_XGO) -tags 'netgo osusergo $(TAGS)' -ldflags '-linkmode external $(LDFLAGS)' -targets '$(TARGETOS)/$(TARGETARCH_XGO)' -out woodpecker-server -pkg cmd/server .
|
CGO_CFLAGS="$(CGO_CFLAGS)" xgo -go $(XGO_VERSION) -dest ./dist/server/$(TARGETOS)_$(TARGETARCH_BUILDX) -tags 'netgo osusergo $(TAGS)' -ldflags '-linkmode external $(LDFLAGS)' -targets '$(TARGETOS)/$(TARGETARCH_XGO)' -out woodpecker-server -pkg cmd/server .
|
||||||
mkdir -p ./dist/server/$(TARGETOS)_$(TARGETARCH_BUILDX)
|
@if [ "$${XGO_IN_XGO:-0}" -eq "1" ]; then echo "inside xgo image"; \
|
||||||
mv /build/woodpecker-server-$(TARGETOS)*-$(TARGETARCH_XGO)$(BIN_SUFFIX) ./dist/server/$(TARGETOS)_$(TARGETARCH_BUILDX)/woodpecker-server$(BIN_SUFFIX)
|
mkdir -p ./dist/server/$(TARGETOS)_$(TARGETARCH_BUILDX); \
|
||||||
[ "${TARGZ}" -eq "1" ] && tar -cvzf dist/woodpecker-server_$(TARGETOS)_$(TARGETARCH_BUILDX).tar.gz -C dist/server/$(TARGETOS)_$(TARGETARCH_BUILDX) woodpecker-server$(BIN_SUFFIX) || echo "skip tar.gz binary"
|
mv -vf /build/woodpecker-server* ./dist/server/$(TARGETOS)_$(TARGETARCH_BUILDX)/woodpecker-server$(BIN_SUFFIX); \
|
||||||
|
else echo "outside xgo image"; \
|
||||||
|
[ -f "./dist/server/$(TARGETOS)_$(TARGETARCH_BUILDX)/woodpecker-server$(BIN_SUFFIX)" ] && rm -v ./dist/server/$(TARGETOS)_$(TARGETARCH_BUILDX)/woodpecker-server$(BIN_SUFFIX); \
|
||||||
|
mv -v ./dist/server/$(TARGETOS)_$(TARGETARCH_XGO)/woodpecker-server* ./dist/server/$(TARGETOS)_$(TARGETARCH_BUILDX)/woodpecker-server$(BIN_SUFFIX); \
|
||||||
|
fi
|
||||||
|
@[ "$${TARGZ:-0}" -eq "1" ] && tar -cvzf dist/woodpecker-server_$(TARGETOS)_$(TARGETARCH_BUILDX).tar.gz -C dist/server/$(TARGETOS)_$(TARGETARCH_BUILDX) woodpecker-server$(BIN_SUFFIX) || echo "skip creating 'dist/woodpecker-server_$(TARGETOS)_$(TARGETARCH_BUILDX).tar.gz'"
|
||||||
|
|
||||||
release-server: ## Create server binaries for release
|
release-server: ## Create server binaries for release
|
||||||
# compile
|
# compile
|
||||||
|
|
Loading…
Reference in a new issue