Skip to content

Commit 8f4eab8

Browse files
committed
Add support for circleci and build via goreleaser
1 parent 16ef40d commit 8f4eab8

File tree

3 files changed

+60
-0
lines changed

3 files changed

+60
-0
lines changed

.circleci/config.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
version: 2
2+
jobs:
3+
build:
4+
docker:
5+
- image: bepsays/ci-goreleaser:0.34.2-10
6+
working_directory: /go/src/github.com/bharat-p/mongo-sync-go
7+
steps:
8+
- checkout
9+
- run:
10+
command: |
11+
goreleaser
12+
workflows:
13+
version: 2
14+
release:
15+
jobs:
16+
- build:
17+
filters:
18+
tags:
19+
only: /v[0-9]+(\.[0-9]+)*(-.*)*/
20+
branches:
21+
ignore: /.*/

.goreleaser.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# .goreleaser.yml
2+
# Build customization
3+
# go run -ldflags "-X github.com/bharat-p/docker-utils/cmd.versionString=0.1.0 -X github.com/bharat-p/docker-utils/cmd.buildDate=$BUILD" main.go version
4+
git:
5+
short_hash: true
6+
builds:
7+
- env:
8+
- CGO_ENABLED=0
9+
binary: docker-utils
10+
goos:
11+
- linux
12+
- darwin
13+
goarch:
14+
- 386
15+
- amd64
16+
# Default is `-s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{.Date}}`.
17+
#ldflags: -s -w -X main.build={{.Version}}
18+
brew:
19+
commit_author:
20+
name: releasebot
21+
email: 13206972+bharat-p@users.noreply.github.com
22+
github:
23+
owner: bharat-p
24+
name: homebrew-tap
25+
folder: Formula
26+
homepage: https://github.com/bharat-p/docker-utils/blob/master/README.md
27+
description: Docker utilities

main.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,18 @@ package main
1616

1717
import "github.com/bharat-p/docker-utils/cmd"
1818

19+
var (
20+
version = "dev"
21+
commit = "none"
22+
date = "unknown"
23+
)
24+
25+
func init() {
26+
cmd.VersionString = version
27+
cmd.Commit = commit
28+
cmd.BuildDate = date
29+
}
30+
1931
func main() {
2032
cmd.Execute()
2133
}

0 commit comments

Comments
 (0)