mirror of
https://github.com/restic/rest-server.git
synced 2025-10-19 15:43:21 +00:00
Write version into main.go
This commit is contained in:
parent
fa516da2c4
commit
4171164a39
2 changed files with 11 additions and 2 deletions
|
@ -12,6 +12,8 @@ before:
|
||||||
- test -n "{{ .Env.VERSION }}"
|
- test -n "{{ .Env.VERSION }}"
|
||||||
# make sure the file VERSION contains the latest version (used for build.go)
|
# make sure the file VERSION contains the latest version (used for build.go)
|
||||||
- bash -c 'echo "{{ .Env.VERSION }}" > VERSION'
|
- 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
|
# make sure the file CHANGELOG.md is up to date
|
||||||
- calens --output CHANGELOG.md
|
- calens --output CHANGELOG.md
|
||||||
|
|
||||||
|
|
11
Release.md
11
Release.md
|
@ -2,9 +2,11 @@
|
||||||
|
|
||||||
export VERSION=0.10.0
|
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`:
|
3. Move changelog files for `calens`:
|
||||||
|
|
||||||
|
@ -30,3 +32,8 @@
|
||||||
release \
|
release \
|
||||||
--config ../.goreleaser.yml \
|
--config ../.goreleaser.yml \
|
||||||
--release-notes <(calens --template changelog/CHANGELOG-GitHub.tmpl --version "${VERSION}")
|
--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
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue