Skip to content

Commit

Permalink
Adding version info for convenience
Browse files Browse the repository at this point in the history
  • Loading branch information
merschformann committed Aug 28, 2024
1 parent 5abf036 commit 3edae8f
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,14 @@ jobs:
exit 1
fi
fi
- name: ensure version is not already released
run: |
if git ls-remote --tags origin | grep -q "refs/tags/$VERSION"; then
echo "Version $VERSION already exists"
exit 1
fi
- name: configure git with the bot credentials
run: |
mkdir -p ~/.ssh
Expand All @@ -58,6 +66,18 @@ jobs:
git rev-parse --short HEAD
- name: bump version in version file
run: |
echo $VERSION > VERSION
working-directory: ./go-mip

- name: commit version bump
run: |
git add VERSION
git commit -m "Bumping version to $VERSION"
git push origin ${{ github.ref_name }}
working-directory: ./go-mip

- name: push release tag
run: |
git tag $VERSION
Expand Down
1 change: 1 addition & 0 deletions VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v1.6.0
16 changes: 16 additions & 0 deletions version.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// © 2019-present nextmv.io inc

package mip

import (
_ "embed"
"strings"
)

//go:embed VERSION
var version string

// Version returns the version of the nextroute module.
func Version() string {
return strings.TrimSpace(version)
}

0 comments on commit 3edae8f

Please sign in to comment.