Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds version info for convenience #13

Merged
merged 2 commits into from
Aug 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 mip module.
func Version() string {
return strings.TrimSpace(version)
}
Loading