Skip to content

Commit

Permalink
Migrate from goxc to goreleaser
Browse files Browse the repository at this point in the history
  • Loading branch information
s1061123 committed Nov 1, 2018
1 parent b583b70 commit 92610fa
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 20 deletions.
42 changes: 42 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# This is an example goreleaser.yaml file with some sane defaults.
# Make sure to check the documentation at http://goreleaser.com
project_name: koko
release:
github:
owner: redhat-nfvpe
name: koko
name_template: '{{.Tag}}'
builds:
- goos:
- linux
goarch:
- amd64
- "386"
- arm
- arm64
goarm:
- "6"
ignore:
- goos: darwin
main: ./koko.go
env:
- CGO_ENABLED=0
ldflags:
- -s -w -X "main.Version={{ .Version }}" -X "main.GitHash={{ .ShortCommit }}"
archive:
name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
replacements:
#linux: Linux
386: i386
amd64: x86_64
format: tar.gz
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "{{ .Tag }}-next"
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
8 changes: 0 additions & 8 deletions .goxc.json

This file was deleted.

13 changes: 4 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,12 @@ script:
- bats tests/acceptanceIPv6.bats
- bats tests/acceptanceIPv4v6.bats

before_deploy:
- go get -u github.com/laher/goxc
- mkdir -p $TRAVIS_BUILD_DIR/dist
- goxc -d=$TRAVIS_BUILD_DIR/dist -pv=$TRAVIS_TAG -bc=linux -tasks=clean-destination,xc,archive,rmbin

deploy:
provider: releases
provider: script
api_key:
secure: "$DEPLOY_SECURE"
file_glob: true
file: "$TRAVIS_BUILD_DIR/dist/**/*.gz"
secure: "$GITHUB_TOKEN"
skip_cleanup: true
script: curl -sL http://git.io/goreleaser | bash
on:
tags: true
all_branches: true
Expand Down
8 changes: 5 additions & 3 deletions koko.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ import (
"github.com/vishvananda/netlink"
)

// VERSION indicates koko's version.
var VERSION = "master@git"
// Version indicates koko's version.
var Version = "master"
// GitHash indicates koko's github hash.
var GitHash = "HEAD"

// parseLinkIPOption parses '<linkname>(:<ip>/<prefix>)' syntax and put it in
// veth object
Expand Down Expand Up @@ -503,7 +505,7 @@ func main() {
}

case 'v': // version
fmt.Printf("koko version: %s\n", VERSION)
fmt.Printf("koko version: %s (%s)\n", Version, GitHash)
os.Exit(0)

case 'h': // help
Expand Down

0 comments on commit 92610fa

Please sign in to comment.