Skip to content

Commit

Permalink
Add GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
svetomir committed Apr 24, 2020
1 parent 629ab79 commit 7d1fc7b
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Go

on: [push, pull_request]

jobs:
build:
name: Build
runs-on: ${{ matrix.os }}
strategy:
matrix:
go: [1.14, 1.x]
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- name: Setup Go
uses: actions/setup-go@v1
with:
go-version: ${{ matrix.go }}
- name: Setup env
run: |
echo "::set-env name=GOPATH::$(go env GOPATH)"
echo "::add-path::$(go env GOPATH)/bin"
shell: bash
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 1
- name: Cache Go modules
uses: actions/cache@v1
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-build-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.OS }}-build-${{ env.cache-name }}-
${{ runner.OS }}-build-
${{ runner.OS }}-
- name: Setup GolangCI-Lint
run: go get -u github.com/golangci/golangci-lint/cmd/golangci-lint
working-directory: ~
- name: Lint
run: make lint
- name: Vet
run: make vet
- name: Build
run: make build
- name: Test
run: make test
27 changes: 27 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Release

on:
push:
branches-ignore:
- '**'
tags:
- 'v*.*.*'

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Setup Go
uses: actions/setup-go@v1
with:
go-version: 1.14
- name: Checkout
uses: actions/checkout@v2
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v1
with:
version: latest
args: release --rm-dist
key: ${{ secrets.YOUR_PRIVATE_KEY }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 7d1fc7b

Please sign in to comment.