From 2183e1e9f563f926666afc9b243c16683e7b2443 Mon Sep 17 00:00:00 2001 From: Andrey Nering Date: Sun, 11 Mar 2018 15:31:27 -0300 Subject: [PATCH] Improve release process and testing automatic release on new tag using Travis --- .goreleaser.yml | 25 ++++++++++++++++++++++++- .travis.yml | 15 +++++++++++++++ RELEASING_TASK.md | 26 ++++++++++++++++++++++++++ Taskfile.yml | 8 +------- 4 files changed, 66 insertions(+), 8 deletions(-) create mode 100644 RELEASING_TASK.md diff --git a/.goreleaser.yml b/.goreleaser.yml index d96a7a02..336b470a 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -22,12 +22,35 @@ archive: release: draft: true -fpm: +snapshot: + name_template: "{{.Tag}}" + +nfpm: vendor: Task homepage: https://github.com/go-task/task maintainer: Andrey Nering description: Simple task runner written in Go license: MIT + conflicts: + - taskwarrior formats: - deb - rpm + +brew: + name: go-task + github: + owner: go-task + name: homebrew-tap + commit_author: + name: Andrey Nering + email: andrey.nering@gmail.com + folder: Formula + homepage: https://github.com/go-task/task + description: Task runner / simpler Make alternative written in Go + conflicts: + - taskwarrior + install: | + bin.install "task" + test: | + system "#{bin}/task", "--help" diff --git a/.travis.yml b/.travis.yml index e78cae6f..f94223cb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,25 @@ language: go + go: - '1.8' - '1.9' - '1.10' + +addons: + apt: + packages: + - rpm + script: - go install github.com/go-task/task/cmd/task - task dl-deps - task lint - task test + +deploy: + - provider: script + skip_cleanup: true + script: curl -sL http://git.io/goreleaser | bash + on: + tags: true + condition: $TRAVIS_OS_NAME = linux diff --git a/RELEASING_TASK.md b/RELEASING_TASK.md new file mode 100644 index 00000000..9d1083fd --- /dev/null +++ b/RELEASING_TASK.md @@ -0,0 +1,26 @@ +# Releasing Task + +The release process of Task is done is done with the help of +[GoReleaser][goreleaser]. You can test the release process locally by calling +the `test-release` task of the Taskfile. + +The Travis CI should release automatically when a new +Git tag is pushed to master, either for the artifact uploading (raw executables +and DEB and RPM packages) and publishing of a new version in the +[Homebrew tap][homebrewtap]. + +# Snapcraft + +The exception is the publishing of a new version of the +[snap package][snappackage]. This current require two steps after publishing +the binaries: + +* Updating the current version on [snapcraft.yaml][snapcraftyaml]; +* Moving either the `i386` and `amd64` new artifacts to the stable channel on +the [Snapscraft dashboard][snapcraftdashboard] + +[goreleaser]: https://goreleaser.com/#continuous_integration +[homebrewtap]: https://github.com/go-task/homebrew-tap +[snappackage]: https://github.com/go-task/snap +[snapcraftyaml]: https://github.com/go-task/snap/blob/master/snap/snapcraft.yaml#L2 +[snapcraftdashboard]: https://dashboard.snapcraft.io/ diff --git a/Taskfile.yml b/Taskfile.yml index 03adc289..3939c5e6 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -39,16 +39,10 @@ tasks: cmds: - go test {{.GO_PACKAGES}} - # https://github.com/goreleaser/goreleaser - release: - desc: Release Task - cmds: - - goreleaser - test-release: desc: Tests release process without publishing cmds: - - goreleaser --snapshot + - goreleaser --snapshot --rm-dist todo: desc: Prints TODO comments present in the code