Browse Source

Fix drone git@next plugin Gitea version display when building tag (#4380)

tags/v1.6.0-dev
Lauris BH 5 years ago
parent
commit
a7f90905df
No account linked to committer's email address
1 changed files with 13 additions and 11 deletions
  1. 13
    11
      Makefile

+ 13
- 11
Makefile View File

GOFLAGS := -i -v GOFLAGS := -i -v
EXTRA_GOFLAGS ?= EXTRA_GOFLAGS ?=


LDFLAGS := -X "main.Version=$(shell git describe --tags --always | sed 's/-/+/' | sed 's/^v//')" -X "main.Tags=$(TAGS)"
ifneq ($(DRONE_TAG),)
VERSION ?= $(subst v,,$(DRONE_TAG))
GITEA_VERSION := $(VERSION)
else
ifneq ($(DRONE_BRANCH),)
VERSION ?= $(subst release/v,,$(DRONE_BRANCH))
else
VERSION ?= master
endif
GITEA_VERSION := $(shell git describe --tags --always | sed 's/-/+/' | sed 's/^v//')
endif

LDFLAGS := -X "main.Version=$(GITEA_VERSION)" -X "main.Tags=$(TAGS)"


PACKAGES ?= $(filter-out code.gitea.io/gitea/integrations,$(shell $(GO) list ./... | grep -v /vendor/)) PACKAGES ?= $(filter-out code.gitea.io/gitea/integrations,$(shell $(GO) list ./... | grep -v /vendor/))
SOURCES ?= $(shell find . -name "*.go" -type f) SOURCES ?= $(shell find . -name "*.go" -type f)
EXECUTABLE := gitea EXECUTABLE := gitea
endif endif


ifneq ($(DRONE_TAG),)
VERSION ?= $(subst v,,$(DRONE_TAG))
else
ifneq ($(DRONE_BRANCH),)
VERSION ?= $(subst release/v,,$(DRONE_BRANCH))
else
VERSION ?= master
endif
endif

# $(call strip-suffix,filename) # $(call strip-suffix,filename)
strip-suffix = $(firstword $(subst ., ,$(1))) strip-suffix = $(firstword $(subst ., ,$(1)))



Loading…
Cancel
Save