From 5a3bca5668ce00ff494d968e14bbb0c2c5ac8d4a Mon Sep 17 00:00:00 2001 From: jasonBirchall Date: Mon, 4 Jan 2021 20:11:18 +0000 Subject: [PATCH 1/3] Change version in Go tests GH action The CLI is written using Go 1.15 so the tests should be executed with 1.15. --- .github/workflows/test.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index f76ab2d..4750784 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -11,10 +11,10 @@ jobs: runs-on: ${{ matrix.os }} steps: - - name: Set up Go 1.14 + - name: Set up Go 1.15 uses: actions/setup-go@v2 with: - go-version: 1.14 + go-version: 1.15 - name: Check out code uses: actions/checkout@v2 From 6185a0b1cf46ef3deb7801765403b009f46e4a97 Mon Sep 17 00:00:00 2001 From: jasonBirchall Date: Mon, 4 Jan 2021 20:11:54 +0000 Subject: [PATCH 2/3] Add new summary and install options in README --- README.md | 16 +++++++++++++++- makefile | 2 +- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 007fca3..82899e1 100644 --- a/README.md +++ b/README.md @@ -6,10 +6,24 @@ [![GitHub release](https://img.shields.io/github/release/jasonbirchall/crypto-tracker.svg)](https://GitHub.com/jasonbirchall/crypto-tracker/releases/) [![GitHub issues](https://img.shields.io/github/issues/jasonbirchall/crypto-tracker.svg)](https://GitHub.com/jasonbirchall/crypto-tracker/issues/) -The intention of this project is to provide a simple, robust application to display the price of popular crypto currency written in Go. +Crypto-tracker is a command-line tool to provide a simple, robust application to display the price of popular crypto currency written in Go. ## Install +These installation instructions are written for a Linux system. If you have a different kind of +computer, please amend the steps appropriately. + +Please substitute the latest release number. You can see the latest release +number in the badge near the top of this page, and all available releases on +[this page][github ui]. + +``` +RELEASE=0.1.0 +wget https://github.com/jasonbirchall/crypto-tracker/releases/download/${RELEASE}/crypto-tracker-${RELEASE}.zip +tar xzvf crypto-tracker-${RELEASE}.zip +mv crypto /usr/local/bin/ +``` + ## Usage ## Develop diff --git a/makefile b/makefile index bb9e418..f5b2aa9 100644 --- a/makefile +++ b/makefile @@ -12,7 +12,7 @@ crypto-tracker: $(SOURCE_FILES) GIT_COMMIT=$$(git rev-list -1 HEAD) && CGO_ENABLED=0 go build -ldflags "-s -w -X github.com/jasonbirchall/crypto-tracker/pkg/version.REVISION=$(GIT_COMMIT)" -a -o ./crypto ./main.go run-tracker: - go run main.go track + go run main.go track --coin btc,eth test: go test -v ./... From 3d54f264316ff14bfc6f6b8bb2a9bf8de854bcdd Mon Sep 17 00:00:00 2001 From: jasonBirchall Date: Mon, 4 Jan 2021 20:12:35 +0000 Subject: [PATCH 3/3] Add GoReleaser build GitHub Action --- .github/workflows/release.yaml | 46 ++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/workflows/release.yaml diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..38f83b8 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,46 @@ +name: Build and push a new release + +on: + push: + tags: + - "*" + +jobs: + build: + name: GoReleaser build + runs-on: ubuntu-latest + + steps: + - name: Check out code into the Go module directory + uses: actions/checkout@v2 + with: + fetch-depth: 0 # See: https://goreleaser.com/ci/actions/ + + - name: Set up Go 1.15 + uses: actions/setup-go@v2 + with: + go-version: 1.15 + id: go + + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v1 + with: + version: latest + args: release --rm-dist + workdir: ./ + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + # push_to_registry: + # name: Push image to docker hub + # runs-on: ubuntu-latest + # steps: + # - name: checkout + # uses: actions/checkout@v2 + # - name: Build and push to docker hub + # uses: docker/build-push-action@v1 + # with: + # username: ${{ secrets.DOCKER_USERNAME }} + # password: ${{ secrets.DOCKER_PASSWORD }} + # repository: ministryofjustice/cloud-platform-cli + # tag_with_ref: true