From 354c270d987adc58765619fc886992c5c26858d3 Mon Sep 17 00:00:00 2001 From: jolheiser Date: Tue, 28 Feb 2023 10:37:57 -0600 Subject: [PATCH 1/6] fix: pin gitea-vet Signed-off-by: jolheiser --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 7d5b47f..df68534 100644 --- a/Makefile +++ b/Makefile @@ -62,7 +62,7 @@ vet: # Default vet cd gitea && $(GO) vet $(PACKAGE) # Custom vet - cd gitea && $(GO) get code.gitea.io/gitea-vet + cd gitea && $(GO) get code.gitea.io/gitea-vet@v0.2.1 cd gitea && $(GO) build code.gitea.io/gitea-vet cd gitea && $(GO) vet -vettool=gitea-vet $(PACKAGE) -- 2.40.1 From bfbc2c9d6acb52ad07f9f9206715079b33b38732 Mon Sep 17 00:00:00 2001 From: jolheiser Date: Tue, 28 Feb 2023 11:35:45 -0600 Subject: [PATCH 2/6] chore: use go run for more targets Signed-off-by: jolheiser --- Makefile | 32 ++++++++------------------------ 1 file changed, 8 insertions(+), 24 deletions(-) diff --git a/Makefile b/Makefile index df68534..b2cf1a1 100644 --- a/Makefile +++ b/Makefile @@ -8,6 +8,9 @@ GITEA_SDK_TEST_PASSWORD ?= test01 PACKAGE := code.gitea.io/sdk/gitea +GOFUMPT_PACKAGE ?= mvdan.cc/gofumpt@v0.4.0 +GOLANGCI_LINT_PACKAGE ?= github.com/golangci/golangci-lint/cmd/golangci-lint@v1.51.0 + GITEA_DL := https://dl.gitea.io/gitea/main/gitea-main- UNAME_S := $(shell uname -s) ifeq ($(UNAME_S),Linux) @@ -55,7 +58,7 @@ clean: .PHONY: fmt fmt: find . -name "*.go" -type f | xargs gofmt -s -w; \ - $(GO) run mvdan.cc/gofumpt@latest -extra -w ./gitea + $(GO) run $(GOFUMPT_PACKAGE) -extra -w ./gitea .PHONY: vet vet: @@ -67,19 +70,14 @@ vet: cd gitea && $(GO) vet -vettool=gitea-vet $(PACKAGE) .PHONY: ci-lint -ci-lint: tool-golangci tool-gofumpt tool-revive - @cd gitea/; echo -n "revive ..."; \ - revive -config ../.revive.toml .; \ - if [ $$? -eq 1 ]; then \ - echo; echo "Doesn't pass revive"; \ - exit 1; \ - fi; echo " done"; echo -n "gofumpt ...";\ - diff=$$(gofumpt -extra -l .); \ +ci-lint: + @cd gitea/; echo -n "gofumpt ...";\ + diff=$$($(GO) run $(GOFUMPT_PACKAGE) -extra -l .); \ if [ -n "$$diff" ]; then \ echo; echo "Not gofumpt-ed"; \ exit 1; \ fi; echo " done"; echo -n "golangci-lint ...";\ - golangci-lint run --timeout 5m; \ + $(GO) run $(GOLANGCI_LINT_PACKAGE) run --timeout 5m; \ if [ $$? -eq 1 ]; then \ echo; echo "Doesn't pass golangci-lint"; \ exit 1; \ @@ -122,17 +120,3 @@ bench: build: cd gitea && $(GO) build -tool-golangci: - @hash golangci-lint > /dev/null 2>&1; if [ $$? -ne 0 ]; then \ - $(GO) install github.com/golangci/golangci-lint/cmd/golangci-lint@latest; \ - fi - -tool-gofumpt: - @hash gofumpt > /dev/null 2>&1; if [ $$? -ne 0 ]; then \ - $(GO) install mvdan.cc/gofumpt@latest; \ - fi - -tool-revive: - @hash revive > /dev/null 2>&1; if [ $$? -ne 0 ]; then \ - $(GO) install github.com/mgechev/revive@latest; \ - fi -- 2.40.1 From d9e71d152155adf3eb67c7fcd352f5e90b6a2f36 Mon Sep 17 00:00:00 2001 From: jolheiser Date: Tue, 28 Feb 2023 12:04:10 -0600 Subject: [PATCH 3/6] chore: pin gitea version to test against Signed-off-by: jolheiser --- .drone.yml | 2 +- Makefile | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.drone.yml b/.drone.yml index 335714f..edbf2f0 100644 --- a/.drone.yml +++ b/.drone.yml @@ -12,7 +12,7 @@ workspace: steps: - name: gitea - image: gitea/gitea:dev + image: gitea/gitea:1.16 pull: always detach: true commands: diff --git a/Makefile b/Makefile index b2cf1a1..60abd36 100644 --- a/Makefile +++ b/Makefile @@ -11,7 +11,8 @@ PACKAGE := code.gitea.io/sdk/gitea GOFUMPT_PACKAGE ?= mvdan.cc/gofumpt@v0.4.0 GOLANGCI_LINT_PACKAGE ?= github.com/golangci/golangci-lint/cmd/golangci-lint@v1.51.0 -GITEA_DL := https://dl.gitea.io/gitea/main/gitea-main- +GITEA_VERSION := 1.16 +GITEA_DL := https://dl.gitea.io/gitea/$(GITEA_VERSION)/gitea-$(GITEA_VERSION)- UNAME_S := $(shell uname -s) ifeq ($(UNAME_S),Linux) GITEA_DL := $(GITEA_DL)linux- -- 2.40.1 From f48a2a12c3206b395799119662ad9ff57963d407 Mon Sep 17 00:00:00 2001 From: jolheiser Date: Tue, 28 Feb 2023 12:25:43 -0600 Subject: [PATCH 4/6] chore: pin to 1.18 Signed-off-by: jolheiser --- .drone.yml | 2 +- Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.drone.yml b/.drone.yml index edbf2f0..b78700c 100644 --- a/.drone.yml +++ b/.drone.yml @@ -12,7 +12,7 @@ workspace: steps: - name: gitea - image: gitea/gitea:1.16 + image: gitea/gitea:1.18 pull: always detach: true commands: diff --git a/Makefile b/Makefile index 60abd36..f0d47fc 100644 --- a/Makefile +++ b/Makefile @@ -11,7 +11,7 @@ PACKAGE := code.gitea.io/sdk/gitea GOFUMPT_PACKAGE ?= mvdan.cc/gofumpt@v0.4.0 GOLANGCI_LINT_PACKAGE ?= github.com/golangci/golangci-lint/cmd/golangci-lint@v1.51.0 -GITEA_VERSION := 1.16 +GITEA_VERSION := 1.18 GITEA_DL := https://dl.gitea.io/gitea/$(GITEA_VERSION)/gitea-$(GITEA_VERSION)- UNAME_S := $(shell uname -s) ifeq ($(UNAME_S),Linux) -- 2.40.1 From 67e1123ade3ce65a6b0d9254981886203fb77de4 Mon Sep 17 00:00:00 2001 From: jolheiser Date: Tue, 28 Feb 2023 12:41:59 -0600 Subject: [PATCH 5/6] chore: move vet package to makefile var Signed-off-by: jolheiser --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index f0d47fc..325828e 100644 --- a/Makefile +++ b/Makefile @@ -10,6 +10,7 @@ PACKAGE := code.gitea.io/sdk/gitea GOFUMPT_PACKAGE ?= mvdan.cc/gofumpt@v0.4.0 GOLANGCI_LINT_PACKAGE ?= github.com/golangci/golangci-lint/cmd/golangci-lint@v1.51.0 +GITEA_VET_PACKAGE ?= code.gitea.io/gitea-vet@v0.2.1 GITEA_VERSION := 1.18 GITEA_DL := https://dl.gitea.io/gitea/$(GITEA_VERSION)/gitea-$(GITEA_VERSION)- @@ -66,7 +67,7 @@ vet: # Default vet cd gitea && $(GO) vet $(PACKAGE) # Custom vet - cd gitea && $(GO) get code.gitea.io/gitea-vet@v0.2.1 + cd gitea && $(GO) get $(GITEA_VET_PACKAGE) cd gitea && $(GO) build code.gitea.io/gitea-vet cd gitea && $(GO) vet -vettool=gitea-vet $(PACKAGE) -- 2.40.1 From 8297cae0221c0472fbc669ff63053d89f114f805 Mon Sep 17 00:00:00 2001 From: techknowlogick Date: Wed, 1 Mar 2023 06:16:38 +0800 Subject: [PATCH 6/6] update to new CDN --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 325828e..15cbf82 100644 --- a/Makefile +++ b/Makefile @@ -13,7 +13,7 @@ GOLANGCI_LINT_PACKAGE ?= github.com/golangci/golangci-lint/cmd/golangci-lint@v1. GITEA_VET_PACKAGE ?= code.gitea.io/gitea-vet@v0.2.1 GITEA_VERSION := 1.18 -GITEA_DL := https://dl.gitea.io/gitea/$(GITEA_VERSION)/gitea-$(GITEA_VERSION)- +GITEA_DL := https://dl.gitea.com/gitea/$(GITEA_VERSION)/gitea-$(GITEA_VERSION)- UNAME_S := $(shell uname -s) ifeq ($(UNAME_S),Linux) GITEA_DL := $(GITEA_DL)linux- -- 2.40.1