Skip to content

Commit

Permalink
fixed previous tag and commit id (#36)
Browse files Browse the repository at this point in the history
Signed-off-by: burakberkkeskin <[email protected]>
  • Loading branch information
burakberkkeskin authored Sep 7, 2024
1 parent 3ed41a2 commit cf90980
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ jobs:
git config user.name "GitHub Actions"
git config user.email "[email protected]"
git fetch --tags --force
previousTag=$(git tag --sort=-v:refname | grep -v '\-beta' | grep -v '\-alpha' | head -n 1 | tail -n 1)
previousTag=$(git tag --sort=-v:refname | grep -v '\-beta' | grep -v '\-alpha' | head -n 2 | tail -n 1)
version=$(git describe --tags --abbrev=0)
commitId=$(git rev-parse --short $version)
commitId=$(git --no-pager log -1 --oneline | awk '{print $1}')
releaseBinary=true
if [[ "${version}" == *"beta"* || "${version}" == *"alpha"* ]]; then
echo "Tag contains beta or alpha, skipping release."
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ You can build the `gomtp` locally, on your own machine.

```bash
version=$(git describe --tags --abbrev=0) && \
commitId=$(git rev-parse --short $version) && \
commitId=$(git --no-pager log -1 --oneline | awk '{print $1}') && \
go build -ldflags "-X gomtp/cmd.version=$version -X gomtp/cmd.commitId=$commitId" -o gomtp -v .
```

Expand Down

0 comments on commit cf90980

Please sign in to comment.