File tree Expand file tree Collapse file tree 8 files changed +80
-71
lines changed Expand file tree Collapse file tree 8 files changed +80
-71
lines changed Original file line number Diff line number Diff line change 16
16
- name : Setup Go
17
17
uses : actions/setup-go@v1
18
18
with :
19
- go-version : 1.14 .x
19
+ go-version : 1.16 .x
20
20
21
21
- name : Checkout code
22
22
uses : actions/checkout@v2
@@ -55,10 +55,12 @@ jobs:
55
55
- name : Setup Go
56
56
uses : actions/setup-go@v1
57
57
with :
58
- go-version : 1.14 .x
58
+ go-version : 1.16 .x
59
59
60
60
- name : Checkout code
61
61
uses : actions/checkout@v2
62
+ with :
63
+ fetch-depth : 0
62
64
63
65
- name : Load cached dependencies
64
66
uses : actions/cache@v1
68
70
restore-keys : |
69
71
${{ runner.os }}-go-
70
72
73
+ - name : Prepare release
74
+ run : |
75
+ set -eou pipefail
76
+ VERSION=${{ github.ref }}
77
+ VERSION="${VERSION#refs/tags/}"
78
+ echo "VERSION=$VERSION" >> $GITHUB_ENV
79
+ echo "Releasing $VERSION"
80
+ echo "Release notes:"
81
+ echo "----"
82
+ go run ./scripts/extract_changelog.go "$VERSION" | tee changes.$VERSION.txt
83
+ echo "----"
84
+
71
85
- name : Release
86
+ uses : goreleaser/goreleaser-action@v2
87
+ with :
88
+ distribution : goreleaser
89
+ version : latest
90
+ args : release --rm-dist --release-notes changes.${{ env.VERSION }}.txt
72
91
env :
73
92
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
74
- run : |
75
- GOBIN="$(pwd)/bin" go install github.com/tcnksm/ghr
76
- PATH="$(pwd)/bin:$PATH" ./scripts/release.sh ${{ github.ref }}
93
+ GORELEASER_CURRENT_TAG : ${{ env.VERSION }}
Original file line number Diff line number Diff line change 1
1
vendor
2
2
/.tmp
3
3
/bin
4
+ /dist
5
+ /changes. * .txt
Original file line number Diff line number Diff line change
1
+ # This is an example .goreleaser.yml file with some sane defaults.
2
+ # Make sure to check the documentation at http://goreleaser.com
3
+ before :
4
+ hooks :
5
+ - ./scripts/check-version.sh {{.Version}}
6
+ builds :
7
+ - main : ./cmd/restack
8
+ binary : restack
9
+ env :
10
+ - CGO_ENABLED=0
11
+ goos :
12
+ - linux
13
+ - windows
14
+ - darwin
15
+ archives :
16
+ - replacements :
17
+ darwin : Darwin
18
+ linux : Linux
19
+ windows : Windows
20
+ 386 : i386
21
+ amd64 : x86_64
22
+ checksum :
23
+ name_template : ' checksums.txt'
24
+ snapshot :
25
+ name_template : " {{ incminor .Tag }}-dev"
26
+ changelog :
27
+ # A commit log is not a changelog.
28
+ skip : true
Original file line number Diff line number Diff line change 1
1
Releases
2
2
========
3
3
4
- v0.4.0 (unreleased )
4
+ v0.4.0 (2021-08-15 )
5
5
-------------------
6
6
7
7
- Simplify command line argument parsing.
Original file line number Diff line number Diff line change @@ -19,19 +19,19 @@ archive and put the binaries somewhere on your `$PATH`.
19
19
20
20
For example, if you have ` $HOME/bin ` on your ` $PATH ` ,
21
21
22
- OS=$(go env GOOS )
23
- ARCH=$(go env GOARCH )
24
- VERSION=v0.3.1
25
- URL="https://github.com/abhinav/restack/releases/download/$VERSION/restack.$ VERSION.$OS.$ ARCH.tar.gz"
26
- curl -L "$URL" | tar xzv -C ~/bin
22
+ OS=$(uname -s )
23
+ ARCH=$(uname -m )
24
+ VERSION=v0.4.0
25
+ URL="https://github.com/abhinav/restack/releases/download/$VERSION/restack_${ VERSION}_${OS}_${ ARCH} .tar.gz"
26
+ curl -L "$URL" | tar xzv -C ~/bin restack
27
27
28
28
Build From Source
29
29
-----------------
30
30
31
31
If you have Go installed, you can install ` restack ` using the following
32
32
command.
33
33
34
- $ go get -u github.com/abhinav/restack/cmd/restack
34
+ $ go install github.com/abhinav/restack/cmd/restack@latest
35
35
36
36
Setup
37
37
=====
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$' \n\t '
4
+
5
+ version=" ${1:- } "
6
+ if [[ -z " $version " ]]; then
7
+ echo >&2 " usage: $0 VERSION"
8
+ exit 1
9
+ fi
10
+
11
+ got=$( grep ' ^const Version = ".*"' version.go | cut -d' "' -f2)
12
+
13
+ if [[ " $got " == " $version " ]]; then
14
+ exit 0
15
+ fi
16
+
17
+ echo >&2 " version.go mismatch:"
18
+ echo >&2 " want: $version "
19
+ echo >&2 " got: $got "
20
+ exit 1
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -5,4 +5,4 @@ package restack
5
5
// Note that semantic versioning in this repository applies to the `restack`
6
6
// executable, not to its library components. These APIs may break at any
7
7
// time without warning.
8
- const Version = "0.3.1 "
8
+ const Version = "0.4.0 "
You can’t perform that action at this time.
0 commit comments