Write version into main.go

This commit is contained in:
Alexander Neumann 2020-05-22 17:41:47 +02:00
parent fa516da2c4
commit 4171164a39
2 changed files with 11 additions and 2 deletions

View file

@ -12,6 +12,8 @@ before:
- test -n "{{ .Env.VERSION }}"
# make sure the file VERSION contains the latest version (used for build.go)
- bash -c 'echo "{{ .Env.VERSION }}" > VERSION'
# make sure that mani.go contains the latest version
- sed -i 's/var version = "[^"]*"/var version = "${VERSION}"/' cmd/rest-server/main.go
# make sure the file CHANGELOG.md is up to date
- calens --output CHANGELOG.md

View file

@ -2,9 +2,11 @@
export VERSION=0.10.0
2. Add new version to file VERSION:
2. Add new version to file `VERSION` and `main.go` and commit the result:
echo "${VERSION}" | tee VERSION && git commit -m "Update VERSION file for ${VERSION}" VERSION
echo "${VERSION}" | tee VERSION
sed -i "s/var version = \"[^\"]*\"/var version = \"${VERSION}\"/" cmd/rest-server/main.go
git commit -m "Update VERSION files for ${VERSION}" VERSION cmd/rest-server/main.go
3. Move changelog files for `calens`:
@ -30,3 +32,8 @@
release \
--config ../.goreleaser.yml \
--release-notes <(calens --template changelog/CHANGELOG-GitHub.tmpl --version "${VERSION}")
7. Set a new version in `main.go` and commit the result:
sed -i "s/var version = \"[^\"]*\"/var version = \"${VERSION}-dev\"/" cmd/rest-server/main.go
git commit -m "Update version for development" cmd/rest-server/main.go