diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml new file mode 100644 index 00000000..3545ed2e --- /dev/null +++ b/.github/workflows/linux.yml @@ -0,0 +1,40 @@ +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 }} build + steps: + - uses: actions/checkout@v2 + - name: Setup go + uses: actions/setup-go@v1 + with: + go-version: ${{ matrix.go }} + + - name: go vet + run: go vet -v ./... + + - 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 -coverprofile=coverage.txt -covermode=atomic ./... + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v1 + with: + file: ./coverage.txt 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 21756fbf..9dd65b39 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![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] # crypki @@ -127,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=branch%3Amaster+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