aboutsummaryrefslogtreecommitdiff
path: root/justfile
blob: 2e7b7ff0e16b763b589ea9c889fec5e03895b0db (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
TEMPDIR := `mktemp -d`

build: test
	CGO=0 go build -o bumpver

install:
    install bumpver $HOME/.local/bin

test:
    golangci-lint run
    go test -v -coverprofile={{ TEMPDIR }}/testcover.out ./...
    go tool cover -func={{ TEMPDIR }}/testcover.out

release part: build
    #!/usr/bin/env bash
    set -euxo pipefail
    current_ver=$(git describe --abbrev=0)
    new_ver=$(bumpver {{part}} <(git tag -l))
    # temp tag for release notes
    git tag $new_ver
    echo "v${new_ver} release" > {{ TEMPDIR }}/chglog
    git-chglog $current_ver..$new_ver >> {{ TEMPDIR }}/chglog
    echo "## Coverage" >> {{ TEMPDIR }}/chglog
    echo "" >> {{ TEMPDIR }}/chglog
    go tool cover -func={{ TEMPDIR }}/testcover.out >> {{ TEMPDIR }}/chglog
    # end temp tag
    git tag -d $new_ver
    git tag --annotate --sign --cleanup=whitespace --file {{ TEMPDIR }}/chglog ${new_ver}
    git push origin ${ver}