mirror of
https://github.com/lukaszraczylo/semver-generator.git
synced 2026-06-18 01:41:19 +00:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
77616d4cdb
|
|||
|
4451f4b9b5
|
|||
| 74b11f30c9 | |||
|
3a33815ea0
|
|||
|
5878e650f7
|
@@ -0,0 +1,20 @@
|
|||||||
|
---
|
||||||
|
name: Bug report
|
||||||
|
about: Create a report to help us improve
|
||||||
|
title: ''
|
||||||
|
labels: bug, to be confirmed
|
||||||
|
assignees: lukaszraczylo
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**Describe the bug**
|
||||||
|
A clear and concise description of what the bug is.
|
||||||
|
|
||||||
|
**Output with debug**
|
||||||
|
[ paste output of the command with `-d` flag here ]
|
||||||
|
|
||||||
|
**Expected behavior**
|
||||||
|
A clear and concise description of what you expected to happen.
|
||||||
|
|
||||||
|
**Additional context**
|
||||||
|
Add any other context about the problem here.
|
||||||
@@ -201,14 +201,15 @@ jobs:
|
|||||||
# body_path: .release_notes
|
# body_path: .release_notes
|
||||||
# draft: false
|
# draft: false
|
||||||
prerelease: ${{ github.ref != 'refs/heads/master' && github.ref != 'refs/heads/main' }}
|
prerelease: ${{ github.ref != 'refs/heads/master' && github.ref != 'refs/heads/main' }}
|
||||||
# - name: Delete previous v1 release asset
|
- name: Delete previous v1 release asset
|
||||||
# uses: mknejp/delete-release-assets@v1
|
uses: mknejp/delete-release-assets@v1
|
||||||
# with:
|
if: ${{ github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' }}
|
||||||
# token: ${{ github.token }}
|
with:
|
||||||
# fail-if-no-assets: false
|
token: ${{ github.token }}
|
||||||
# fail-if-no-release: false
|
fail-if-no-assets: false
|
||||||
# tag: v1
|
fail-if-no-release: false
|
||||||
# assets: 'semver-gen-*'
|
tag: v1
|
||||||
|
assets: 'semver-gen-*'
|
||||||
- name: Create Release V1
|
- name: Create Release V1
|
||||||
id: create_release_global
|
id: create_release_global
|
||||||
uses: marvinpinto/action-automatic-releases@latest
|
uses: marvinpinto/action-automatic-releases@latest
|
||||||
|
|||||||
+1
-1
@@ -6,7 +6,7 @@ RUN apk add make
|
|||||||
WORKDIR /go/src/app
|
WORKDIR /go/src/app
|
||||||
ENV GO111MODULE=on CGO_ENABLED=1 GOOS=linux
|
ENV GO111MODULE=on CGO_ENABLED=1 GOOS=linux
|
||||||
COPY . /go/src/app/
|
COPY . /go/src/app/
|
||||||
RUN make
|
RUN make build
|
||||||
|
|
||||||
FROM alpine:latest
|
FROM alpine:latest
|
||||||
RUN apk add --no-cache ca-certificates
|
RUN apk add --no-cache ca-certificates
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
LOCAL_VERSION?=$(shell semver-gen generate -l -c config-release.yaml | sed -e 's|SEMVER ||g')
|
LOCAL_VERSION?=""
|
||||||
CI_RUN?=false
|
CI_RUN?=false
|
||||||
ADDITIONAL_BUILD_FLAGS=""
|
ADDITIONAL_BUILD_FLAGS=""
|
||||||
|
|
||||||
@@ -6,16 +6,31 @@ ifeq ($(CI_RUN), true)
|
|||||||
ADDITIONAL_BUILD_FLAGS="-test.short"
|
ADDITIONAL_BUILD_FLAGS="-test.short"
|
||||||
endif
|
endif
|
||||||
|
|
||||||
all: build
|
ifneq ($(shell which semver-gen), "")
|
||||||
|
LOCAL_VERSION="0.0.0-dev"
|
||||||
|
else
|
||||||
|
LOCAL_VERSION=$(shell semver-gen generate -l -c config-release.yaml | sed -e 's|SEMVER ||g')
|
||||||
|
endif
|
||||||
|
|
||||||
build:
|
.PHONY: help
|
||||||
|
help: ## display this help
|
||||||
|
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n\nTargets:\n"} /^[a-zA-Z0-9_-]+:.*?##/ { printf " \033[36m%-20s\033[0m %s\n", $$1, $$2 }' $(MAKEFILE_LIST)
|
||||||
|
|
||||||
|
.PHONY: all
|
||||||
|
all: build ## Build all targets
|
||||||
|
|
||||||
|
.PHONY: build
|
||||||
|
build: ## Build binary
|
||||||
go build -o semver-gen -ldflags="-s -w -X main.PKG_VERSION=${LOCAL_VERSION}" *.go
|
go build -o semver-gen -ldflags="-s -w -X main.PKG_VERSION=${LOCAL_VERSION}" *.go
|
||||||
|
|
||||||
run: build
|
# .PHONY: run
|
||||||
@./semver-gen
|
# run: build ## Build binary and execute it
|
||||||
|
# @./semver-gen
|
||||||
|
|
||||||
test:
|
.PHONY: test
|
||||||
|
test: ## Run whole test suite
|
||||||
@go test ./... $(ADDITIONAL_BUILD_FLAGS) -v -race -cover -coverprofile=coverage.out
|
@go test ./... $(ADDITIONAL_BUILD_FLAGS) -v -race -cover -coverprofile=coverage.out
|
||||||
|
|
||||||
update:
|
.PHONY: update
|
||||||
|
update: ## Update all dependencies and sub-packages
|
||||||
@go get -u ./...
|
@go get -u ./...
|
||||||
|
|||||||
+2
-3
@@ -146,7 +146,7 @@ func (s *Setup) CalculateSemver() SemVer {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if !params.varStrict {
|
if !params.varStrict && !s.Force.Strict {
|
||||||
s.Semver.Patch++
|
s.Semver.Patch++
|
||||||
debugPrint(fmt.Sprintln("Incrementing patch (DEFAULT) on ", strings.TrimSuffix(commit.Message, "\n"), "| Semver:", s.getSemver()))
|
debugPrint(fmt.Sprintln("Incrementing patch (DEFAULT) on ", strings.TrimSuffix(commit.Message, "\n"), "| Semver:", s.getSemver()))
|
||||||
}
|
}
|
||||||
@@ -327,8 +327,7 @@ func main() {
|
|||||||
if repo.Generate || params.varGenerateInTest {
|
if repo.Generate || params.varGenerateInTest {
|
||||||
err := repo.ReadConfig(repo.LocalConfigFile)
|
err := repo.ReadConfig(repo.LocalConfigFile)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println("Unable to find config file", repo.LocalConfigFile)
|
fmt.Println("Unable to find config file semver.yaml. Using defaults and flags.", repo.LocalConfigFile)
|
||||||
os.Exit(1)
|
|
||||||
}
|
}
|
||||||
err = repo.Prepare()
|
err = repo.Prepare()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ force:
|
|||||||
major: 1
|
major: 1
|
||||||
minor: 4
|
minor: 4
|
||||||
existing: true
|
existing: true
|
||||||
|
strict: false
|
||||||
commit: 960207e4677476ad31a9f389f74eaf9f33d49613
|
commit: 960207e4677476ad31a9f389f74eaf9f33d49613
|
||||||
wording:
|
wording:
|
||||||
patch:
|
patch:
|
||||||
|
|||||||
Reference in New Issue
Block a user