From e500224213f8e4fb001ea4dd23b1236ed6aa13fe Mon Sep 17 00:00:00 2001 From: apoorvam Date: Thu, 16 May 2019 16:42:21 -0400 Subject: [PATCH] Integrate with goreleaser to release dunner as binary, tar, deb, rpm, snap for all os/arch --- .gitignore | 3 +++ .goreleaser.yml | 63 +++++++++++++++++++++++++++++++++++++++++++++++++ .travis.yml | 24 ++++++++++++++++++- Makefile | 2 ++ 4 files changed, 91 insertions(+), 1 deletion(-) create mode 100644 .goreleaser.yml diff --git a/.gitignore b/.gitignore index 540eee7..765097a 100644 --- a/.gitignore +++ b/.gitignore @@ -24,3 +24,6 @@ # Environment file .env + +# Packages +dist/* diff --git a/.goreleaser.yml b/.goreleaser.yml new file mode 100644 index 0000000..a476d3e --- /dev/null +++ b/.goreleaser.yml @@ -0,0 +1,63 @@ +# Goreleaser documentation at http://goreleaser.com +project_name: dunner +builds: +- env: + - CGO_ENABLED=0 + goos: + - linux + - darwin + - windows + goarch: + - 386 + - amd64 + - arm + - arm64 +archives: +- replacements: + 386: i386 + amd64: x86_64 +checksum: + name_template: '{{ .ProjectName }}_checksums.txt' +changelog: + sort: asc + filters: + exclude: + - '^docs:' + - '^test:' + - Merge pull request + - Merge branch + - Update readme +snapshot: + name_template: "{{.ProjectName}}_{{.Tag}}" + +brew: + github: + owner: leopardslab + name: homebrew-dunner + folder: Formula + homepage: https://github.com/leopardslab/Dunner + description: A Docker based task runner tool + test: | + system "#{bin}/dunner version" + +nfpm: + name_template: '{{ .ProjectName }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}' + homepage: https://github.com/leopardslab/Dunner + description: A Docker based task runner tool + license: MIT + formats: + - deb + - rpm + dependencies: + - git + recommends: + - rpm +snapcraft: + name_template: '{{ .ProjectName }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}' + summary: A Docker based task runner tool + description: | + Dunner is a task runner tool like Grunt but used Docker images like CircleCI do. | + You can define tasks and steps of the tasks in your `.dunner.yaml` file and then run these steps with `Dunner do taskname` + grade: stable + confinement: devmode + publish: false \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index a5a610a..e0b100d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,6 +9,13 @@ env: services: - docker +addons: + apt: + packages: + - rpm + - snapd +env: + - PATH=/snap/bin:$PATH before_install: - curl -L -s https://github.com/golang/dep/releases/download/v${DEP_VERSION}/dep-linux-amd64 -o $GOPATH/bin/dep @@ -16,5 +23,20 @@ before_install: install: - dep ensure -v + - sudo snap install snapcraft --classic + +script: + - make ci + +after_success: + - test -n "$TRAVIS_TAG" && snapcraft login --with snap.login -script: go test -v ./... \ No newline at end of file +deploy: +- provider: script + skip_cleanup: true + script: curl -sL https://git.io/goreleaser | bash + verbose: true + on: + tags: true + condition: $TRAVIS_OS_NAME = linux + master: true \ No newline at end of file diff --git a/Makefile b/Makefile index 041a287..16c563e 100644 --- a/Makefile +++ b/Makefile @@ -28,3 +28,5 @@ build: install clean: rm -rf * + +ci: build test \ No newline at end of file