mirror of
https://gitea.com/gitea/act_runner
synced 2026-09-21 19:37:07 +02:00
This PR contains the following updates: | Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) | Type | Update | |---|---|---|---|---|---| | [connectrpc.com/connect](https://github.com/connectrpc/connect-go) | `v1.20.0` → `v1.21.0` |  |  | require | minor | | [github.com/docker/cli](https://github.com/docker/cli) | `v29.7.2+incompatible` → `v29.8.0+incompatible` |  |  | require | minor | | [github.com/moby/moby/api](https://github.com/moby/moby) | `v1.55.0` → `v1.56.0` |  |  | require | minor | | [github.com/moby/moby/client](https://github.com/moby/moby) | `v0.5.1` → `v0.6.0` |  |  | require | minor | | [golang.org/x/net](https://pkg.go.dev/golang.org/x/net) | [`v0.58.0` → `v0.59.0`](https://cs.opensource.google/go/x/net/+/refs/tags/v0.58.0...refs/tags/v0.59.0) |  |  | require | minor | | [golang.org/x/sync](https://pkg.go.dev/golang.org/x/sync) | [`v0.22.0` → `v0.23.0`](https://cs.opensource.google/go/x/sync/+/refs/tags/v0.22.0...refs/tags/v0.23.0) |  |  | require | minor | | [golang.org/x/sys](https://pkg.go.dev/golang.org/x/sys) | [`v0.47.0` → `v0.48.0`](https://cs.opensource.google/go/x/sys/+/refs/tags/v0.47.0...refs/tags/v0.48.0) |  |  | require | minor | | [golang.org/x/term](https://pkg.go.dev/golang.org/x/term) | [`v0.45.0` → `v0.46.0`](https://cs.opensource.google/go/x/term/+/refs/tags/v0.45.0...refs/tags/v0.46.0) |  |  | require | minor | | [golang.org/x/text](https://pkg.go.dev/golang.org/x/text) | [`v0.41.0` → `v0.42.0`](https://cs.opensource.google/go/x/text/+/refs/tags/v0.41.0...refs/tags/v0.42.0) |  |  | require | minor | | golang.org/x/vuln | `v1.7.0` → `v1.8.0` |  |  | | minor | | [node](https://github.com/nodejs/node) | `be23f54` → `6dac556` | | | | digest | | [node](https://github.com/nodejs/node) | `ba849c6` → `2fe369e` | | | | digest | | [tags.cncf.io/container-device-interface](https://github.com/cncf-tags/container-device-interface) | `v1.1.0` → `v1.1.1` |  |  | require | patch | --- ### Release Notes <details> <summary>connectrpc/connect-go (connectrpc.com/connect)</summary> ### [`v1.21.0`](https://github.com/connectrpc/connect-go/releases/tag/v1.21.0) [Compare Source](https://github.com/connectrpc/connect-go/compare/v1.20.0...v1.21.0) #### What's Changed > \[!IMPORTANT] > > This release adds a security-related feature for servers. The new handler option [`WithRequestGate`](https://pkg.go.dev/connectrpc.com/connect#WithRequestGate) runs after the request headers are available and before any message is received. Use this new option to register checks (e.g. authentication) that should happen before the request is decompressed or unmarshaled, and before any interceptors are run. See the [documentation for details](https://connectrpc.com/docs/go/interceptors/#authentication). ##### Governance - Add pkwarren as a maintainer by [@​bufdev](https://github.com/bufdev) in [#​929](https://github.com/connectrpc/connect-go/pull/929) 🎉 ##### Enhancements - Add WithRequestGate handler option by [@​emcfarlane](https://github.com/emcfarlane) in [#​962](https://github.com/connectrpc/connect-go/pull/962) - Create release binary for protoc-gen-connect-go by [@​emcfarlane](https://github.com/emcfarlane) in [#​966](https://github.com/connectrpc/connect-go/pull/966) ##### Bugfixes - Fix issue with user-agent getting inappropriately injected into request headers by [@​jhump](https://github.com/jhump) in [#​934](https://github.com/connectrpc/connect-go/pull/934) - Fix client streaming operations blocking indefinitely after context cancellation by [@​haru0017](https://github.com/haru0017) in [#​937](https://github.com/connectrpc/connect-go/pull/937) - Fix flaky HTTP2 testcase assertion by [@​emcfarlane](https://github.com/emcfarlane) in [#​940](https://github.com/connectrpc/connect-go/pull/940) - Fix data race and connection leak in duplexHTTPCall by [@​emcfarlane](https://github.com/emcfarlane) in [#​938](https://github.com/connectrpc/connect-go/pull/938) - Fix off-by-one in WithHTTPGetMaxURLSize URL length check by [@​fchimpan](https://github.com/fchimpan) in [#​955](https://github.com/connectrpc/connect-go/pull/955) - Fix connect.WithGRPC typo in the missing client option error by [@​NotAFlightRisk](https://github.com/NotAFlightRisk) in [#​956](https://github.com/connectrpc/connect-go/pull/956) - Only send a 304 when the request was a GET by [@​NotAFlightRisk](https://github.com/NotAFlightRisk) in [#​957](https://github.com/connectrpc/connect-go/pull/957) - Fix panic in stream Spec and Peer when client construction failed by [@​NotAFlightRisk](https://github.com/NotAFlightRisk) in [#​959](https://github.com/connectrpc/connect-go/pull/959) - Fix dropped headers on errStreamingClientConn by [@​mohit-bhandari45](https://github.com/mohit-bhandari45) in [#​964](https://github.com/connectrpc/connect-go/pull/964) #### New Contributors - [@​haru0017](https://github.com/haru0017) made their first contribution in [#​937](https://github.com/connectrpc/connect-go/pull/937) - [@​dongjiang1989](https://github.com/dongjiang1989) made their first contribution in [#​945](https://github.com/connectrpc/connect-go/pull/945) - [@​fchimpan](https://github.com/fchimpan) made their first contribution in [#​955](https://github.com/connectrpc/connect-go/pull/955) - [@​NotAFlightRisk](https://github.com/NotAFlightRisk) made their first contribution in [#​956](https://github.com/connectrpc/connect-go/pull/956) - [@​mohit-bhandari45](https://github.com/mohit-bhandari45) made their first contribution in [#​964](https://github.com/connectrpc/connect-go/pull/964) **Full Changelog**: <https://github.com/connectrpc/connect-go/compare/v1.20.0...v1.21.0> </details> <details> <summary>docker/cli (github.com/docker/cli)</summary> ### [`v29.8.0+incompatible`](https://github.com/docker/cli/compare/v29.7.2...v29.8.0) [Compare Source](https://github.com/docker/cli/compare/v29.7.2...v29.8.0) </details> <details> <summary>moby/moby (github.com/moby/moby/client)</summary> ### [`v0.6.0`](https://github.com/moby/moby/compare/v0.5.1...v0.6.0) [Compare Source](https://github.com/moby/moby/compare/v0.5.1...v0.6.0) </details> <details> <summary>cncf-tags/container-device-interface (tags.cncf.io/container-device-interface)</summary> ### [`v1.1.1`](https://github.com/cncf-tags/container-device-interface/releases/tag/v1.1.1) [Compare Source](https://github.com/cncf-tags/container-device-interface/compare/v1.1.0...v1.1.1) #### What's Changed - spec: Fix comment to reference containerEdits field by [@​zrezke](https://github.com/zrezke) in [#​303](https://github.com/cncf-tags/container-device-interface/pull/303) - cdi: inject mount UID/GID mappings if user NS is in use. by [@​klihub](https://github.com/klihub) in [#​288](https://github.com/cncf-tags/container-device-interface/pull/288) - cdi,SPECS.md: allow empty cgroup permissions. by [@​klihub](https://github.com/klihub) in [#​301](https://github.com/cncf-tags/container-device-interface/pull/301) - .github: bump golangci-lint to v2.9.0. by [@​klihub](https://github.com/klihub) in [#​307](https://github.com/cncf-tags/container-device-interface/pull/307) - add local build and install procedure in README.md. by [@​fujitatomoya](https://github.com/fujitatomoya) in [#​305](https://github.com/cncf-tags/container-device-interface/pull/305) - Revert to default spec dirs if none are specified by [@​elezar](https://github.com/elezar) in [#​310](https://github.com/cncf-tags/container-device-interface/pull/310) - SPEC.md: fix a few typos/clarify a sentence. by [@​klihub](https://github.com/klihub) in [#​312](https://github.com/cncf-tags/container-device-interface/pull/312) - add beginner's tutorial to see how CDI works. by [@​fujitatomoya](https://github.com/fujitatomoya) in [#​311](https://github.com/cncf-tags/container-device-interface/pull/311) - Makefile: add GO\_EXTRAFLAGS to go build call by [@​koenkooi](https://github.com/koenkooi) in [#​313](https://github.com/cncf-tags/container-device-interface/pull/313) - Remove runtime-tools dependency by [@​elezar](https://github.com/elezar) in [#​317](https://github.com/cncf-tags/container-device-interface/pull/317) - schema: add validation for top-level container edits by [@​marquiz](https://github.com/marquiz) in [#​323](https://github.com/cncf-tags/container-device-interface/pull/323) - parser: guard single-character vendor and class names against a slice-bounds panic by [@​thc1006](https://github.com/thc1006) in [#​321](https://github.com/cncf-tags/container-device-interface/pull/321) - chore(deps): replace deprecated gopkg.in/yaml.v3 for go.yaml.in/yaml/v3 by [@​thaJeztah](https://github.com/thaJeztah) in [#​328](https://github.com/cncf-tags/container-device-interface/pull/328) - schema: make validation error private by [@​thaJeztah](https://github.com/thaJeztah) in [#​329](https://github.com/cncf-tags/container-device-interface/pull/329) - pkg/cdi: stop embedding Cache mutex by [@​thaJeztah](https://github.com/thaJeztah) in [#​335](https://github.com/cncf-tags/container-device-interface/pull/335) - build(deps): bump actions/stale from 10 to 11 by [@​dependabot](https://github.com/dependabot)\[bot] in [#​327](https://github.com/cncf-tags/container-device-interface/pull/327) - specs-go: add test coverage by [@​thaJeztah](https://github.com/thaJeztah) in [#​332](https://github.com/cncf-tags/container-device-interface/pull/332) - replace strings.Split for strings.Cut by [@​thaJeztah](https://github.com/thaJeztah) in [#​336](https://github.com/cncf-tags/container-device-interface/pull/336) - schema, validation: minor fixes and modernization by [@​thaJeztah](https://github.com/thaJeztah) in [#​330](https://github.com/cncf-tags/container-device-interface/pull/330) - pkg/cdi: deprecate ErrStopScan and use os.ReadDir for scanning Spec directories by [@​thaJeztah](https://github.com/thaJeztah) in [#​339](https://github.com/cncf-tags/container-device-interface/pull/339) - Bump actions/checkout from 6 to 7 by [@​dependabot](https://github.com/dependabot)\[bot] in [#​318](https://github.com/cncf-tags/container-device-interface/pull/318) - pkg/cdi: synchronize access to specDirs by [@​thaJeztah](https://github.com/thaJeztah) in [#​337](https://github.com/cncf-tags/container-device-interface/pull/337) - schema: migrate to github.com/santhosh-tekuri/jsonschema/v6 by [@​thaJeztah](https://github.com/thaJeztah) in [#​331](https://github.com/cncf-tags/container-device-interface/pull/331) - pkg/cdi: fix deprecations, add doc-links and "go fix" by [@​thaJeztah](https://github.com/thaJeztah) in [#​338](https://github.com/cncf-tags/container-device-interface/pull/338) - internal/validation/k8s: remove unused validation helpers by [@​thaJeztah](https://github.com/thaJeztah) in [#​334](https://github.com/cncf-tags/container-device-interface/pull/334) - specs-go: remove x/mod semver dependency by [@​thaJeztah](https://github.com/thaJeztah) in [#​333](https://github.com/cncf-tags/container-device-interface/pull/333) - chore(deps): github.com/stretchr/testify v1.12.1 by [@​thaJeztah](https://github.com/thaJeztah) in [#​342](https://github.com/cncf-tags/container-device-interface/pull/342) - ci: update golangci-lint to v2.13, and fix linting by [@​thaJeztah](https://github.com/thaJeztah) in [#​352](https://github.com/cncf-tags/container-device-interface/pull/352) - ci: apply zizmor hardening fixes by [@​thaJeztah](https://github.com/thaJeztah) in [#​350](https://github.com/cncf-tags/container-device-interface/pull/350) - specs-go: fix benchmark compatibility with go1.19 by [@​thaJeztah](https://github.com/thaJeztah) in [#​353](https://github.com/cncf-tags/container-device-interface/pull/353) - pkg/cdi: fix flaky TestRefreshCache by [@​thaJeztah](https://github.com/thaJeztah) in [#​355](https://github.com/cncf-tags/container-device-interface/pull/355) - ci: test against oldest supported, oldstable, and stable Go versions by [@​thaJeztah](https://github.com/thaJeztah) in [#​351](https://github.com/cncf-tags/container-device-interface/pull/351) - pkg/cdi: TestRefreshCache: consolidate cache state checks by [@​thaJeztah](https://github.com/thaJeztah) in [#​357](https://github.com/cncf-tags/container-device-interface/pull/357) - build(deps): bump actions/checkout from 7.0.0 to 7.0.1 by [@​dependabot](https://github.com/dependabot)\[bot] in [#​349](https://github.com/cncf-tags/container-device-interface/pull/349) - remove "sigs.k8s.io/yaml" dependency by [@​thaJeztah](https://github.com/thaJeztah) in [#​340](https://github.com/cncf-tags/container-device-interface/pull/340) - build(deps): bump actions/setup-go from 6.4.0 to 7.0.0 by [@​dependabot](https://github.com/dependabot)\[bot] in [#​348](https://github.com/cncf-tags/container-device-interface/pull/348) - build(deps): bump golangci/golangci-lint-action from 9.2.1 to 9.3.0 by [@​dependabot](https://github.com/dependabot)\[bot] in [#​346](https://github.com/cncf-tags/container-device-interface/pull/346) - build(deps): bump codespell-project/actions-codespell from 2.1 to 2.2 by [@​dependabot](https://github.com/dependabot)\[bot] in [#​347](https://github.com/cncf-tags/container-device-interface/pull/347) - pkg/cdi: fix, and cleanup some locks, and use RWMutex by [@​thaJeztah](https://github.com/thaJeztah) in [#​345](https://github.com/cncf-tags/container-device-interface/pull/345) - update minimum go version to go1.23 and modernize some code by [@​thaJeztah](https://github.com/thaJeztah) in [#​354](https://github.com/cncf-tags/container-device-interface/pull/354) - chore(deps): github.com/fsnotify/fsnotify v1.7.0 by [@​thaJeztah](https://github.com/thaJeztah) in [#​359](https://github.com/cncf-tags/container-device-interface/pull/359) - pkg/cdi: clean up watcher lifecycle handling and simplify refresh logic by [@​thaJeztah](https://github.com/thaJeztah) in [#​358](https://github.com/cncf-tags/container-device-interface/pull/358) - pkg/cdi: fix cache refresh handling for filesystem events by [@​thaJeztah](https://github.com/thaJeztah) in [#​344](https://github.com/cncf-tags/container-device-interface/pull/344) - Bump version to v1.1.1 by [@​elezar](https://github.com/elezar) in [#​361](https://github.com/cncf-tags/container-device-interface/pull/361) #### New Contributors - [@​zrezke](https://github.com/zrezke) made their first contribution in [#​303](https://github.com/cncf-tags/container-device-interface/pull/303) - [@​fujitatomoya](https://github.com/fujitatomoya) made their first contribution in [#​305](https://github.com/cncf-tags/container-device-interface/pull/305) - [@​koenkooi](https://github.com/koenkooi) made their first contribution in [#​313](https://github.com/cncf-tags/container-device-interface/pull/313) - [@​thc1006](https://github.com/thc1006) made their first contribution in [#​321](https://github.com/cncf-tags/container-device-interface/pull/321) **Full Changelog**: <https://github.com/cncf-tags/container-device-interface/compare/v1.1.0...v1.1.1> </details> --- ### Configuration 📅 **Schedule**: (UTC) - Branch creation - Between 12:00 AM and 03:59 AM, only on Monday (`* 0-3 * * 1`) - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 👻 **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://github.com/renovatebot/renovate/discussions) if that's undesired. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4xOTEuMiIsInVwZGF0ZWRJblZlciI6IjQzLjE5MS4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119--> Reviewed-on: https://gitea.com/gitea/runner/pulls/1223 Reviewed-by: bircni <bircni@icloud.com> Co-authored-by: Renovate Bot <renovate-bot@gitea.com>
241 lines
8.3 KiB
Makefile
241 lines
8.3 KiB
Makefile
DIST := dist
|
|
EXECUTABLE := gitea-runner
|
|
DIST_DIRS := $(DIST)/binaries $(DIST)/release
|
|
GO ?= go
|
|
SHASUM ?= shasum -a 256
|
|
HAS_GO = $(shell hash $(GO) > /dev/null 2>&1 && echo "GO" || echo "NOGO" )
|
|
XGO_PACKAGE ?= src.techknowlogick.com/xgo@v1.9.0 # renovate: datasource=go
|
|
XGO_VERSION := go-1.27.x
|
|
GXZ_PACKAGE ?= github.com/ulikunitz/xz/cmd/gxz@v0.5.16 # renovate: datasource=go
|
|
|
|
LINUX_ARCHS ?= linux/amd64,linux/arm64
|
|
DARWIN_ARCHS ?= darwin-12/amd64,darwin-12/arm64
|
|
WINDOWS_ARCHS ?= windows/amd64
|
|
GOFILES := $(shell find . -type f -name "*.go" -o -name "go.mod" ! -name "generated.*")
|
|
|
|
DOCKER_IMAGE ?= gitea/runner
|
|
DOCKER_TAG ?= nightly
|
|
DOCKER_REF := $(DOCKER_IMAGE):$(DOCKER_TAG)
|
|
DOCKER_ROOTLESS_REF := $(DOCKER_IMAGE):$(DOCKER_TAG)-dind-rootless
|
|
|
|
GOLANGCI_LINT_PACKAGE ?= github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.13.2 # renovate: datasource=go
|
|
GOVULNCHECK_PACKAGE ?= golang.org/x/vuln/cmd/govulncheck@v1.8.0 # renovate: datasource=go
|
|
|
|
GOTEST_FLAGS ?= -race -timeout 20m -parallel 8
|
|
|
|
STATIC ?=
|
|
EXTLDFLAGS ?=
|
|
ifneq ($(STATIC),)
|
|
EXTLDFLAGS = -extldflags "-static"
|
|
endif
|
|
|
|
ifeq ($(HAS_GO), GO)
|
|
GOPATH ?= $(shell $(GO) env GOPATH)
|
|
export PATH := $(GOPATH)/bin:$(PATH)
|
|
|
|
CGO_EXTRA_CFLAGS := -DSQLITE_MAX_VARIABLE_NUMBER=32766
|
|
CGO_CFLAGS ?= $(shell $(GO) env CGO_CFLAGS) $(CGO_EXTRA_CFLAGS)
|
|
endif
|
|
|
|
ifeq ($(OS), Windows_NT)
|
|
GOFLAGS := -v -buildmode=exe
|
|
EXECUTABLE ?= $(EXECUTABLE).exe
|
|
GO_ENV_WINDOWS := set GOOS=windows&&
|
|
else ifeq ($(OS), Windows)
|
|
GOFLAGS := -v -buildmode=exe
|
|
EXECUTABLE ?= $(EXECUTABLE).exe
|
|
GO_ENV_WINDOWS := set GOOS=windows&&
|
|
else
|
|
GOFLAGS := -v
|
|
EXECUTABLE ?= $(EXECUTABLE)
|
|
GO_ENV_WINDOWS := GOOS=windows
|
|
endif
|
|
|
|
STORED_VERSION_FILE := VERSION
|
|
|
|
ifneq ($(DRONE_TAG),)
|
|
VERSION ?= $(subst v,,$(DRONE_TAG))
|
|
RELASE_VERSION ?= $(VERSION)
|
|
else
|
|
ifneq ($(DRONE_BRANCH),)
|
|
VERSION ?= $(subst release/v,,$(DRONE_BRANCH))
|
|
else
|
|
VERSION ?= main
|
|
endif
|
|
|
|
STORED_VERSION=$(shell cat $(STORED_VERSION_FILE) 2>/dev/null)
|
|
ifneq ($(STORED_VERSION),)
|
|
RELASE_VERSION ?= $(STORED_VERSION)
|
|
else
|
|
RELASE_VERSION ?= $(shell git describe --tags --always | sed 's/-/+/' | sed 's/^v//')
|
|
endif
|
|
endif
|
|
|
|
TAGS ?=
|
|
LDFLAGS ?= -X "gitea.com/gitea/runner/internal/pkg/ver.version=v$(RELASE_VERSION)"
|
|
|
|
.PHONY: all
|
|
all: build
|
|
|
|
.PHONY: help
|
|
help: Makefile ## print Makefile help information.
|
|
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m[TARGETS] default target: build\033[0m\n\n\033[35mTargets:\033[0m\n"} /^[0-9A-Za-z._-]+:.*?##/ { printf " \033[36m%-45s\033[0m %s\n", $$1, $$2 }' Makefile
|
|
|
|
.PHONY: fmt
|
|
fmt: ## format the Go code
|
|
$(GO) run $(GOLANGCI_LINT_PACKAGE) fmt
|
|
|
|
.PHONY: go-check
|
|
go-check:
|
|
$(eval MIN_GO_VERSION_STR := $(shell grep -Eo '^go\s+[0-9]+\.[0-9]+' go.mod | cut -d' ' -f2))
|
|
$(eval MIN_GO_VERSION := $(shell printf "%03d%03d" $(shell echo '$(MIN_GO_VERSION_STR)' | tr '.' ' ')))
|
|
$(eval GO_VERSION := $(shell printf "%03d%03d" $(shell $(GO) version | grep -Eo '[0-9]+\.[0-9]+' | tr '.' ' ');))
|
|
@if [ "$(GO_VERSION)" -lt "$(MIN_GO_VERSION)" ]; then \
|
|
echo "Gitea Runner requires Go $(MIN_GO_VERSION_STR) or greater to build. You can get it at https://go.dev/dl/"; \
|
|
exit 1; \
|
|
fi
|
|
|
|
.PHONY: fmt-check
|
|
fmt-check: ## check the Go code formatting
|
|
$(GO) run $(GOLANGCI_LINT_PACKAGE) fmt --diff-colored
|
|
|
|
.PHONY: deps-tools
|
|
deps-tools: ## install tool dependencies
|
|
$(GO) install $(GOLANGCI_LINT_PACKAGE) & \
|
|
$(GO) install $(GXZ_PACKAGE) & \
|
|
$(GO) install $(XGO_PACKAGE) & \
|
|
$(GO) install $(GOVULNCHECK_PACKAGE) & \
|
|
wait
|
|
|
|
.PHONY: checks
|
|
checks: tidy-check fmt-check security-check ## run the non-lint source checks
|
|
|
|
.PHONY: lint
|
|
lint: lint-go lint-go-windows ## lint everything
|
|
|
|
.PHONY: lint-go
|
|
lint-go: ## lint go files
|
|
$(GO) run $(GOLANGCI_LINT_PACKAGE) run
|
|
|
|
.PHONY: lint-go-windows
|
|
lint-go-windows: ## lint Windows go files
|
|
$(GO) install $(GOLANGCI_LINT_PACKAGE)
|
|
$(GO_ENV_WINDOWS) golangci-lint run
|
|
|
|
.PHONY: lint-go-fix
|
|
lint-go-fix: ## lint go files and fix issues
|
|
$(GO) run $(GOLANGCI_LINT_PACKAGE) run --fix
|
|
|
|
.PHONY: lint-pr-title
|
|
lint-pr-title: ## lint PR title against Conventional Commits (set PR_TITLE=...)
|
|
@node ./tools/lint-pr-title.ts
|
|
|
|
.PHONY: security-check
|
|
security-check:
|
|
$(GO) run $(GOVULNCHECK_PACKAGE) -show color ./... || true
|
|
|
|
.PHONY: tidy
|
|
tidy: ## run go mod tidy
|
|
$(eval GO_TOOLCHAIN := $(shell grep -Eo '^toolchain\s+go[0-9.]+' go.mod | cut -d' ' -f2))
|
|
$(GO) mod tidy
|
|
@# workaround https://github.com/golang/go/issues/75331: restore toolchain if tidy dropped it
|
|
@if [ -n "$(GO_TOOLCHAIN)" ] && ! grep -qE '^toolchain\s' go.mod; then \
|
|
$(GO) mod edit -toolchain=$(GO_TOOLCHAIN); \
|
|
fi
|
|
|
|
.PHONY: tidy-check
|
|
tidy-check: ## check that go.mod and go.sum are tidy
|
|
$(GO) mod tidy -diff
|
|
|
|
.PHONY: test
|
|
test: ## test everything (integration tests self-skip without docker/network)
|
|
@$(GO) test $(GOTEST_FLAGS) -cover -coverprofile coverage.txt ./... && echo "\n==>\033[32m Ok\033[m\n" || exit 1
|
|
|
|
.PHONY: coverage-report
|
|
coverage-report: ## turn coverage.txt from `make test` into .tmp/coverage.md
|
|
@mkdir -p .tmp
|
|
@node ./tools/coverage-report.ts -i coverage.txt -o .tmp/coverage.md
|
|
@echo "Wrote .tmp/coverage.md"
|
|
|
|
.PHONY: test-dind
|
|
test-dind: ## run the daemon-facing tests against the built dind image (TARGET=dind|dind-rootless)
|
|
@./scripts/test-dind.sh $(TARGET)
|
|
|
|
E2E_JOB_IMAGE ?= node:24-bookworm@sha256:6dac556d980b7f0e5498d08f08cee0ca67798b4ad6c23964a9214920e67758d0 # renovate: datasource=docker
|
|
SERVICE_IMAGE ?= nginx:1.31.4-alpine@sha256:db35bfc6b2951e7f8a72db5db120288c127ffaeeb4a6d4b95a26fead017d5913 # renovate: datasource=docker
|
|
E2E_GITEA_IMAGE ?= gitea/gitea:main-nightly
|
|
E2E_CONCURRENCY ?= 8
|
|
|
|
.PHONY: test-e2e
|
|
test-e2e: ## run Gitea compatibility tests against E2E_GITEA_IMAGE
|
|
@E2E_CONCURRENCY=$(E2E_CONCURRENCY) E2E_GITEA_IMAGE=$(E2E_GITEA_IMAGE) E2E_JOB_IMAGE=$(E2E_JOB_IMAGE) GO=$(GO) SERVICE_IMAGE=$(SERVICE_IMAGE) ./tools/test-e2e.sh
|
|
|
|
.PHONY: install
|
|
install: $(GOFILES) ## install the runner binary via `go install`
|
|
$(GO) install -v -tags '$(TAGS)' -ldflags '-s -w $(EXTLDFLAGS) $(LDFLAGS)'
|
|
|
|
.PHONY: build
|
|
build: go-check $(EXECUTABLE) ## build the runner binary
|
|
|
|
$(EXECUTABLE): $(GOFILES)
|
|
$(GO) build -v -tags '$(TAGS)' -ldflags '-s -w $(EXTLDFLAGS) $(LDFLAGS)' -o $@
|
|
|
|
.PHONY: deps-backend
|
|
deps-backend: ## install backend dependencies
|
|
$(GO) mod download
|
|
|
|
.PHONY: release
|
|
release: release-windows release-linux release-darwin release-copy release-compress release-check ## build release artifacts
|
|
|
|
$(DIST_DIRS):
|
|
mkdir -p $(DIST_DIRS)
|
|
|
|
.PHONY: release-windows
|
|
release-windows: | $(DIST_DIRS)
|
|
CGO_CFLAGS="$(CGO_CFLAGS)" $(GO) run $(XGO_PACKAGE) -go $(XGO_VERSION) -buildmode exe -dest $(DIST)/binaries -tags 'netgo osusergo $(TAGS)' -ldflags '-s -w -linkmode external -extldflags "-static" $(LDFLAGS)' -targets '$(WINDOWS_ARCHS)' -out $(EXECUTABLE)-$(VERSION) .
|
|
ifeq ($(CI),true)
|
|
cp -r /build/* $(DIST)/binaries/
|
|
endif
|
|
|
|
.PHONY: release-linux
|
|
release-linux: | $(DIST_DIRS)
|
|
CGO_CFLAGS="$(CGO_CFLAGS)" $(GO) run $(XGO_PACKAGE) -go $(XGO_VERSION) -dest $(DIST)/binaries -tags 'netgo osusergo $(TAGS)' -ldflags '-s -w -linkmode external -extldflags "-static" $(LDFLAGS)' -targets '$(LINUX_ARCHS)' -out $(EXECUTABLE)-$(VERSION) .
|
|
ifeq ($(CI),true)
|
|
cp -r /build/* $(DIST)/binaries/
|
|
endif
|
|
|
|
.PHONY: release-darwin
|
|
release-darwin: | $(DIST_DIRS)
|
|
CGO_CFLAGS="$(CGO_CFLAGS)" $(GO) run $(XGO_PACKAGE) -go $(XGO_VERSION) -dest $(DIST)/binaries -tags 'netgo osusergo $(TAGS)' -ldflags '-s -w $(LDFLAGS)' -targets '$(DARWIN_ARCHS)' -out $(EXECUTABLE)-$(VERSION) .
|
|
ifeq ($(CI),true)
|
|
cp -r /build/* $(DIST)/binaries/
|
|
endif
|
|
|
|
.PHONY: release-copy
|
|
release-copy: | $(DIST_DIRS)
|
|
cd $(DIST); for file in `find . -type f -name "*"`; do cp $${file} ./release/; done;
|
|
|
|
.PHONY: release-check
|
|
release-check: | $(DIST_DIRS)
|
|
cd $(DIST)/release/; for file in `find . -type f -name "*"`; do echo "checksumming $${file}" && $(SHASUM) `echo $${file} | sed 's/^..//'` > $${file}.sha256; done;
|
|
|
|
.PHONY: release-compress
|
|
release-compress: | $(DIST_DIRS)
|
|
cd $(DIST)/release/; for file in `find . -type f -name "*"`; do echo "compressing $${file}" && $(GO) run $(GXZ_PACKAGE) -k -9 $${file}; done;
|
|
|
|
.PHONY: docker
|
|
docker: ## build the docker image
|
|
if ! docker buildx version >/dev/null 2>&1; then \
|
|
ARG_DISABLE_CONTENT_TRUST=--disable-content-trust=false; \
|
|
fi; \
|
|
docker build $${ARG_DISABLE_CONTENT_TRUST} -t $(DOCKER_REF) .
|
|
|
|
.PHONY: clean
|
|
clean: ## delete binary and coverage files
|
|
$(GO) clean -x -i ./...
|
|
rm -rf coverage.txt .tmp $(EXECUTABLE) $(DIST)
|
|
|
|
.PHONY: version
|
|
version: ## print the version
|
|
@echo $(VERSION)
|