Skip to content
This repository was archived by the owner on Aug 12, 2025. It is now read-only.

Commit 214a024

Browse files
authored
Merge pull request #92 from packethost/simpler-release
simplified release versioning process
2 parents f785a15 + 2430451 commit 214a024

File tree

2 files changed

+6
-26
lines changed

2 files changed

+6
-26
lines changed

Makefile

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,19 @@
33
GIT_VERSION ?= $(shell git log -1 --format="%h")
44
RELEASE_TAG := $(shell git describe --abbrev=0 --tags ${TAG_COMMIT} 2>/dev/null || true)
55
RELEASE_VERSION ?= $(shell cat VERSION)
6-
IS_NEW_RELEASE ?= true
76

87
# are there uncommitted files?
98
ifneq ($(shell git status --porcelain),)
109
# next is used by GoReleaser as well when --spanshot is set
1110
RELEASE_TAG := $(RELEASE_TAG)-next
1211
RELEASE_VERSION := $(RELEASE_VERSION)-dirty
13-
IS_NEW_RELEASE := false
1412
endif
1513

16-
# do we consider this to be a valid new release? Or are we working going forward?
17-
ifneq ($(shell git branch --show-current),master)
18-
RELEASE_VERSION := $(RELEASE_VERSION)-next
19-
IS_NEW_RELEASE := false
20-
else
21-
ifeq ($(shell git diff HEAD~1 VERSION),)
22-
RELEASE_VERSION := $(RELEASE_VERSION)-next
23-
IS_NEW_RELEASE := false
24-
endif
25-
endif
14+
# this is being kept, as in the future, we may check the diff of VERSION from the previous to determine
15+
# whether or not to cut a release, rather than relying on git tags
16+
#ifeq ($(shell git diff HEAD~1 VERSION),)
17+
# RELEASE_VERSION := $(RELEASE_VERSION)-next
18+
#endif
2619

2720
VERSION ?= $(RELEASE_VERSION)
2821

@@ -310,9 +303,6 @@ $(MANAGERLESS_DIR) $(MANAGERLESS_BASE):
310303

311304
.PHONY: semver release-clusterctl release-manifests release $(RELEASE_CLUSTERCTLYAML) $(RELEASE_MANIFEST) $(RELEASE_METADATA) $(RELEASE_CLUSTER_TEMPLATE) $(FULL_RELEASE_CLUSTERCTLYAML)
312305

313-
check-release:
314-
@echo $(IS_NEW_RELEASE)
315-
316306
semver:
317307
ifeq (,$(VERSION))
318308
$(error could not determine version to use from file, will not create artifacts)

docs/RELEASE.md

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,8 @@ When building the manifests via `make manifests`, `make managerless`, or `make r
3030

3131
* Take the version from the contents of [VERSION](./VERSION)
3232
* If there are any uncommitted files, append `-dirty`
33-
* If not on `master` branch, or if on `master` branch but the [VERSION](./VERSION) file is unchanged from the last commit on `master` branch, append `-next`
3433

35-
The net of the above, is that the version will be treated as "clean" only when all of the following are true:
36-
37-
* there are no "dirty" uncommitted files
38-
* the current commit is on `master` branch
39-
* the `VERSION` is different from the previous commit
40-
41-
Thie encourages - requires - changes to a version, and therefore a release, to consist entirely of a single commit or merge to master,
42-
whose entire change is the `VERSION` file and, optionally, in the same commit, the `APIVERSION` file.
43-
44-
To see what version you would get, run `make semver`. To see if this is a new release, run `make check-release`.
34+
To see what version you would get, run `make semver`.
4535

4636
We are aware that this is a somewhat duplicative process, but there is no other way, as multiple stages
4737
depend on having the versions in checked-in files and do not support environment variable or command-line

0 commit comments

Comments
 (0)