From e76423f0eaf6c0fbee71799f5341ad842c2b6220 Mon Sep 17 00:00:00 2001 From: Aditya Mahendrakar Date: Sat, 18 Apr 2020 16:29:54 -0700 Subject: [PATCH 1/6] use gh actions --- .github/workflows/linux.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/workflows/linux.yml diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml new file mode 100644 index 00000000..6957cfd2 --- /dev/null +++ b/.github/workflows/linux.yml @@ -0,0 +1,32 @@ +name: Linux + +on: + push: + branches: + - master + pull_request: + branches: + - '*' + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + go: [ '1.14.2', '1.13' ] + name: Go ${{ matrix.go }} sample + steps: + - uses: actions/checkout@v2 + - name: Setup go + uses: actions/setup-go@v1 + with: + go-version: ${{ matrix.go }} + + - name: Basic build + run: go build ./cmd/... + + - name: Run tests on linux + run: go test ./... + + - name: Run tests with race detector + run: go test -v -race ./... From 66d889374b30e5674056d198484f69e992679bfa Mon Sep 17 00:00:00 2001 From: Aditya Mahendrakar Date: Sat, 18 Apr 2020 16:31:17 -0700 Subject: [PATCH 2/6] fix --- .github/workflows/linux.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 6957cfd2..c2e04c07 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -14,7 +14,7 @@ jobs: strategy: matrix: go: [ '1.14.2', '1.13' ] - name: Go ${{ matrix.go }} sample + name: Go ${{ matrix.go }} build steps: - uses: actions/checkout@v2 - name: Setup go From 799216849d61aa0cd25480a0a35c1f9e8f5ad331 Mon Sep 17 00:00:00 2001 From: Aditya Mahendrakar Date: Sun, 19 Apr 2020 07:58:59 -0700 Subject: [PATCH 3/6] add coverage step --- .github/workflows/linux.yml | 10 +++++++++- README.md | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index c2e04c07..460fbc79 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -22,6 +22,9 @@ jobs: with: go-version: ${{ matrix.go }} + - name: go vet + run: go vet -v ./... + - name: Basic build run: go build ./cmd/... @@ -29,4 +32,9 @@ jobs: run: go test ./... - name: Run tests with race detector - run: go test -v -race ./... + run: go test -race -coverprofile=coverage.txt -covermode=atomic ./... + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v1 + with: + file: ./coverage.txt diff --git a/README.md b/README.md index 21756fbf..ef54acfa 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ [![Build Status][travis-ci-badge]][travis-ci] [![GoDoc][godoc-badge]][godoc] [![Go Report Card][goreport-card-badge]][goreport-card] [![Go Coverage][codecov-card-badge]][codecov-card] +![Linux](https://github.com/yahoo/crypki/workflows/Linux/badge.svg) # crypki > _A simple service for interacting with an HSM or other PKCS#11 device._ From 492dd58913edda5c03aedc079af099e740736bab Mon Sep 17 00:00:00 2001 From: Aditya Mahendrakar Date: Sun, 19 Apr 2020 08:01:39 -0700 Subject: [PATCH 4/6] fix --- .github/workflows/linux.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 460fbc79..c75bb209 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -14,7 +14,7 @@ jobs: strategy: matrix: go: [ '1.14.2', '1.13' ] - name: Go ${{ matrix.go }} build + name: Go ${{ matrix.go }} build steps: - uses: actions/checkout@v2 - name: Setup go From b6379d7f6763f0172e6eb697f8f839d6655d96fd Mon Sep 17 00:00:00 2001 From: Aditya Mahendrakar Date: Sun, 19 Apr 2020 08:55:12 -0700 Subject: [PATCH 5/6] add release action --- .github/workflows/linux.yml | 2 +- .github/workflows/release.yml | 48 +++++++++++++++++++++++++++++++++++ .travis.yml | 26 ------------------- README.md | 7 +++-- 4 files changed, 52 insertions(+), 31 deletions(-) create mode 100644 .github/workflows/release.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index c75bb209..3545ed2e 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -32,7 +32,7 @@ jobs: run: go test ./... - name: Run tests with race detector - run: go test -race -coverprofile=coverage.txt -covermode=atomic ./... + run: go test -v -race -coverprofile=coverage.txt -covermode=atomic ./... - name: Upload coverage to Codecov uses: codecov/codecov-action@v1 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..9f926bed --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,48 @@ +name: create release and upload binary + +on: + push: + tags: + - 'v[0-9]+.[0-9]+.[0-9]+' + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: install go + uses: actions/setup-go@v1 + with: + go-version: 1.14.x + + - name: checkout + uses: actions/checkout@v1 + + - name: get version + id: v + run: echo ::set-output name=tag::$( awk -F '/' '{print $NF}' <<< "${GITHUB_REF}" ) + + - name: build + run: | + go build ./cmd/crypki + tar -czvf crypki-${{ steps.v.outputs.tag }}-linux.tar.gz --transform 's,^,crypki-${{ steps.v.outputs.tag }}-${OS}/,' crypki + + - name: create release + id: create-release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ steps.v.outputs.tag }} + release_name: ${{ steps.v.outputs.tag }} + draft: false + prerelease: false + + - name: upload linux binary + uses: actions/upload-release-asset@v1.0.1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create-release.outputs.upload_url }} + asset_path: crypki-${{ steps.v.outputs.tag }}-linux.tar.gz + asset_name: crypki-${{ steps.v.outputs.tag }}-linux.tar.gz + asset_content_type: application/gzip diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index b6ebb7b5..00000000 --- a/.travis.yml +++ /dev/null @@ -1,26 +0,0 @@ -language: go -env: -- GO111MODULE=on -go: -- 1.13 -- tip -script: -- go vet ./... -- go build ./... -- go test -v ./... -- go test -v -race ./... -- go test -race ./... -coverprofile=coverage.txt -- go build -o crypki-amd64 ./cmd/crypki/... -- sha256sum crypki-amd64 > crypki-amd64.sha256 -after_success: -- bash <(curl -s https://codecov.io/bash) -deploy: - provider: releases - api_key: - secure: xMbjQtlbyVhhlz2Yo5cNls55q3Cuq1YTuto7y8xtAzK+6VCk88RwORAvvb3Z1erKuYXDOv2JKPNwhz8MKTf2E1QTvhfBZNnRQiMDVahVZsBUrxgGvCttS9etmWUykWZMv9z2vao2xmkKbtf7H909xvmh83idh0jlCp94YczPTuhC0gQCum21986IxD9FSH/PDzt4gAc27NnZZk/YOcg8TyL9uuuq3CG5vGE2HYlvMin+IPNP4w2BdIh4TI82ll8PxJI86LrsN76QGqoSW/hV2zMlpnvrNxgDkJhdQCon2yHl/uqx4bpE7+dlLtyuGOkvIs6Mn+o7cq0hWHKPP9pwxBfNYZjghtbh6S5BpvQv3/KH9mpX3pQUvGqOqXfcWnETafaQaq9v/Tn8OSJw288i6L22PN+rmeS+hE9K29fX/MRDe6xD4YMQ3cy2Dw46JfuPXzdJWzM/zNejZbPyx/gleSgnmdQVlPK3GK1E0ij8wcZ5Q7eRehgYjkoeXs9Bjjjgh6Q/BAJM2Y8/rP4F471J+fIIG4m+82QwRogXcJJNqtzBS8DAX89et8iF+JwfPgiAuuyCQOqTgcjXvUOAejWisVdBgFTSAoeNEAU+75rgmj2MBVkLor1x0j+RSAYOBWErS7VCHJ8Vr93lHv40yFg5eHaWUB/PtxdFSbasmTUuJMA= - file: - - crypki-amd64 - - crypki-amd64.sha256 - skip_cleanup: true - on: - tags: true diff --git a/README.md b/README.md index ef54acfa..0f95b223 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,5 @@ -[![Build Status][travis-ci-badge]][travis-ci] [![GoDoc][godoc-badge]][godoc] [![Go Report Card][goreport-card-badge]][goreport-card] [![Go Coverage][codecov-card-badge]][codecov-card] +[![Build Status][build-badge]][build-url] [![GoDoc][godoc-badge]][godoc] [![Go Report Card][goreport-card-badge]][goreport-card] [![Go Coverage][codecov-card-badge]][codecov-card] -![Linux](https://github.com/yahoo/crypki/workflows/Linux/badge.svg) # crypki > _A simple service for interacting with an HSM or other PKCS#11 device._ @@ -128,10 +127,10 @@ Sign blob (input is base64 encoded value of raw hash of a blob. [example code](h This project is licensed under the terms of the [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0) open source license. Please refer to [LICENSE](LICENSE) for the full terms. +[build-badge]: https://github.com/yahoo/crypki/workflows/Linux/badge.svg +[build-url]: https://github.com/yahoo/crypki/actions?query=workflow%3ALinux [golang]: http://golang.org/ [golang-install]: http://golang.org/doc/install.html#releases -[travis-ci-badge]: https://travis-ci.com/yahoo/crypki.svg?branch=master -[travis-ci]: https://travis-ci.com/yahoo/crypki [godoc-badge]: https://godoc.org/github.com/yahoo/crypki?status.svg [godoc]: https://godoc.org/github.com/yahoo/crypki [goreport-card-badge]: https://goreportcard.com/badge/yahoo/crypki From 6220de2cc043c4165d2faab9fab1d460190d8dbb Mon Sep 17 00:00:00 2001 From: Aditya Mahendrakar Date: Sun, 19 Apr 2020 09:00:44 -0700 Subject: [PATCH 6/6] update url --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0f95b223..9dd65b39 100644 --- a/README.md +++ b/README.md @@ -128,7 +128,7 @@ Sign blob (input is base64 encoded value of raw hash of a blob. [example code](h This project is licensed under the terms of the [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0) open source license. Please refer to [LICENSE](LICENSE) for the full terms. [build-badge]: https://github.com/yahoo/crypki/workflows/Linux/badge.svg -[build-url]: https://github.com/yahoo/crypki/actions?query=workflow%3ALinux +[build-url]: https://github.com/yahoo/crypki/actions?query=branch%3Amaster+workflow%3ALinux [golang]: http://golang.org/ [golang-install]: http://golang.org/doc/install.html#releases [godoc-badge]: https://godoc.org/github.com/yahoo/crypki?status.svg