Skip to content

Commit

Permalink
add release action
Browse files Browse the repository at this point in the history
  • Loading branch information
maditya committed Apr 19, 2020
1 parent 492dd58 commit b6379d7
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 31 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
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.

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

0 comments on commit b6379d7

Please sign in to comment.