Skip to content

Commit

Permalink
Merge pull request #31 from yahoo/gh-actions
Browse files Browse the repository at this point in the history
use gh actions
  • Loading branch information
maditya authored Apr 20, 2020
2 parents 9414ec4 + 6220de2 commit 8e3d553
Show file tree
Hide file tree
Showing 4 changed files with 91 additions and 29 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
@@ -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
48 changes: 48 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
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
26 changes: 0 additions & 26 deletions .travis.yml

This file was deleted.

6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 8e3d553

Please sign in to comment.