Skip to content

Commit

Permalink
*: add github actions (#65)
Browse files Browse the repository at this point in the history
Signed-off-by: mahjonp <[email protected]>
  • Loading branch information
mahjonp authored Aug 20, 2020
1 parent 89fc4b9 commit b967805
Show file tree
Hide file tree
Showing 6 changed files with 76 additions and 34 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: "release"
on:
push:
tags:
- '*'

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v1
with:
go-version: 1.13.x
- uses: actions/checkout@v2

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v1
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23 changes: 23 additions & 0 deletions .github/workflows/workflow.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: "workflow"
on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v1
with:
go-version: 1.13.x
- uses: actions/checkout@v2

- name: "fmt"
run: make fmt

- name: "vet"
run: make vet

- name: "test"
run: make test

- name: "build"
run: make build
26 changes: 26 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# This is an example goreleaser.yaml file with some sane defaults.
# Make sure to check the documentation at http://goreleaser.com
before:
hooks:
- go mod tidy
builds:
- binary: horo
id: horo
main: ./cmd/
env:
- CGO_ENABLED=0
- GO111MODULE=on
goarch:
- amd64
goos:
- linux
- darwin
archives:
- replacements:
darwin: Darwin
linux: Linux
windows: Windows
386: i386
amd64: x86_64
checksum:
name_template: 'checksums.txt'
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ PACKAGES := $$($(PACKAGE_LIST))

GOBUILD=$(GO) build

default: horoscope
default: build

horoscope:
build:
$(GOBUILD) $(GOMOD) -o bin/horo cmd/*.go

fmt:
Expand Down
3 changes: 1 addition & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,12 @@ require (
github.com/golang/protobuf v1.4.2 // indirect
github.com/jedib0t/go-pretty v4.3.0+incompatible
github.com/magiconair/properties v1.8.0
github.com/pingcap/errors v0.11.5-0.20190809092503-95897b64e011
github.com/pingcap/go-tpc v1.0.3 // indirect
github.com/pingcap/parser v0.0.0-20200612092132-17a1160e5a81
github.com/pingcap/tidb v2.0.11+incompatible
github.com/pingcap/tipb v0.0.0-20200610045017-b69a98cfcf6b // indirect
github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0 // indirect
github.com/sirupsen/logrus v1.6.0
github.com/spf13/pflag v1.0.3 // indirect
github.com/stretchr/testify v1.6.1
github.com/urfave/cli/v2 v2.2.0
golang.org/x/perf v0.0.0-20200318175901-9c9101da8316
Expand Down
Loading

0 comments on commit b967805

Please sign in to comment.