Skip to content

Commit

Permalink
Merge pull request #45 from kazeburo/gorelease-by-github-actions
Browse files Browse the repository at this point in the history
goreleaser by github actions
  • Loading branch information
kazeburo committed Nov 27, 2020
2 parents f25e24d + de1fbfb commit c687e1f
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
go: [ '1.14.x' ]
go: [ '1.15.x']
steps:

- name: Set up Go
Expand Down
26 changes: 26 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: release
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: 1.15

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
12 changes: 7 additions & 5 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@ builds:
- linux
goarch:
- amd64
ldflags:
- -X main.Version={{.Version}}
archive:
format: zip
name_template: "{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}"
- arm64
ignore:
- goos: darwin
goarch: arm64
archives:
- format: zip
name_template: "{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}"
release:
github:
owner: kazeburo
Expand Down
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
VERSION=0.12.1
LDFLAGS=-ldflags "-X main.Version=${VERSION}"
LDFLAGS=-ldflags "-w -s -X main.version=${VERSION}"

all: chocon

Expand All @@ -22,4 +22,3 @@ tag:
git tag v${VERSION}
git push origin v${VERSION}
git push origin master
goreleaser --rm-dist
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@

# Installation

```
go get -u github.com/kazeburo/chocon
```
download from release page or build from source

## build from source

# Build
git clone this repository and

```
make
$ make
$ cp chocon /path/to/bin
```

# Run
Expand Down
8 changes: 4 additions & 4 deletions chocon.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ import (
)

var (
// Version chocon version
Version string
// version chocon version
version string
)

type cmdOpts struct {
Expand Down Expand Up @@ -101,7 +101,7 @@ func printVersion() {
fmt.Printf(`chocon %s
Compiler: %s %s
`,
Version,
version,
runtime.Compiler,
runtime.Version())
}
Expand Down Expand Up @@ -137,7 +137,7 @@ func _main() int {
}

transport := makeTransport(opts.KeepaliveConns, opts.MaxConnsPerHost, opts.ProxyReadTimeout)
var handler http.Handler = proxy.New(&transport, Version, upstream, logger)
var handler http.Handler = proxy.New(&transport, version, upstream, logger)

statsChocon, err := statsHTTP.NewCapa(opts.StatsBufsize, opts.StatsSpfactor)
if err != nil {
Expand Down

0 comments on commit c687e1f

Please sign in to comment.