Skip to content

Commit bdd1b6a

Browse files
committed
Added release workflow
1 parent 7f2dc47 commit bdd1b6a

4 files changed

Lines changed: 44 additions & 38 deletions

File tree

.github/workflows/build.yml

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,21 @@ jobs:
1414
platform: [ubuntu-latest, macos-latest, windows-latest]
1515
runs-on: ${{ matrix.platform }}
1616
steps:
17-
- name: Install Go
18-
uses: actions/setup-go@v2
19-
with:
20-
go-version: ${{ matrix.go-version }}
21-
- name: Checkout code
22-
uses: actions/checkout@v2
23-
- name: Go Version
24-
run: go version
25-
- name: Build with desired version
26-
run: go build -v -ldflags="-X 'axon-server-cli/cmd.version=v1.0.0'"
17+
- name: Install Go ${{ matrix.go-version }}
18+
uses: actions/setup-go@v2
19+
with:
20+
go-version: ${{ matrix.go-version }}
21+
- uses: actions/cache@v2
22+
with:
23+
path: ~/go/pkg/mod
24+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
25+
restore-keys: |
26+
${{ runner.os }}-go-
27+
- name: Checkout code
28+
uses: actions/checkout@v2
29+
- name: Go Version
30+
run: go version
31+
- name: Test
32+
run: go test -v
33+
- name: Build with desired version
34+
run: go build -v

.github/workflows/release.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
8+
jobs:
9+
goreleaser:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v2
14+
with:
15+
fetch-depth: 0
16+
- name: Set up Go
17+
uses: actions/setup-go@v2
18+
with:
19+
go-version: 1.14
20+
- name: Run GoReleaser
21+
uses: goreleaser/goreleaser-action@v2
22+
with:
23+
version: latest
24+
args: release --rm-dist
25+
env:
26+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/test.yml

Lines changed: 0 additions & 26 deletions
This file was deleted.

cmd/root.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,6 @@ func init() {
5454
viper.BindPFlag("server", rootCmd.PersistentFlags().Lookup("server"))
5555
rootCmd.PersistentFlags().StringVarP(&token, "access-token", "t", "", "[Optional] Access token to authenticate at server")
5656
viper.BindPFlag("token", rootCmd.PersistentFlags().Lookup("token"))
57-
58-
rootCmd.Version = "1.0"
5957
}
6058

6159
// initConfig reads in config file and ENV variables if set.

0 commit comments

Comments
 (0)