From 5c1bec2b318a27a48d01fe3bfd31768dc18f49b1 Mon Sep 17 00:00:00 2001 From: Nikolay Edigaryev Date: Tue, 14 Jul 2020 15:44:03 +0300 Subject: [PATCH] Prepare for release (#2) * README.md: add installation and usage instructions * Publish artifacts to a corresponding GitHub release * Create releases with GoReleaser * CI: use only_if check and goreleaser:latest image * README.md: clarify WIP status --- .cirrus.yml | 10 +++++----- .goreleaser.yml | 17 +++++++++++++++++ README.md | 31 +++++++++++++++++++++++++++++-- 3 files changed, 51 insertions(+), 7 deletions(-) create mode 100644 .goreleaser.yml diff --git a/.cirrus.yml b/.cirrus.yml index ed7a0006..d8d248bd 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -17,8 +17,8 @@ task: script: go test -v ./... task: - name: Build - depends_on: - - Lint - - Test - script: go build -v ./... + name: Release + only_if: $CIRRUS_TAG != '' + container: + image: goreleaser/goreleaser:latest + release_script: gorelease diff --git a/.goreleaser.yml b/.goreleaser.yml new file mode 100644 index 00000000..36e99952 --- /dev/null +++ b/.goreleaser.yml @@ -0,0 +1,17 @@ +project_name: cirrus + +before: + hooks: + - go mod download + +builds: + - main: cmd/cirrus/main.go + env: + - CGO_ENABLED=0 + goos: + - linux + goarch: + - amd64 + +archives: + - format: zip diff --git a/README.md b/README.md index 66e83100..f863bfee 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,29 @@ -# cirrus-cli -CLI for executing Cirrus tasks locally +# Cirrus CLI + +WIP CLI for executing Cirrus tasks locally. Currently can only validate Cirrus CI configuration file. + +## Installation + +### Releases + +Check the [releases page](https://github.com/cirruslabs/cirrus-cli/releases) for a pre-built `cirrus` binary for your platform. + +### Go + +If you have Go 1.14 installed, you can run: + +``` +go install github.com/cirruslabs/cirrus-cli/... +``` + +This will build and place the `cirrus` binary in `$GOPATH/bin`. + +To be able to run `cirrus` command from anywhere, make sure that the `$GOPATH/bin` directory is added to your `PATH` environment variable (see [article in the Go wiki](https://github.com/golang/go/wiki/SettingGOPATH) for more details). + +## Usage + +To validate a Cirrus CI configuration, simply switch to a directory where the `.cirrus.yml` is located and run: + +``` +cirrus validate +```