Skip to content

Commit

Permalink
add github action
Browse files Browse the repository at this point in the history
  • Loading branch information
catatsuy committed Aug 28, 2021
1 parent 93bad0b commit 8fc10c9
Show file tree
Hide file tree
Showing 4 changed files with 89 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Go
on: [push]
jobs:

test:
name: Build
runs-on: ubuntu-latest
strategy:
matrix:
go: [ '1.17.x' ]
steps:

- name: Set up Go
uses: actions/setup-go@v1
with:
go-version: ${{ matrix.go }}
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@v2

- name: test
run: |
go vet ./...
go test ./...
go build
22 changes: 22 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: release
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Setup Go
uses: actions/setup-go@v1
with:
go-version: 1.17.x
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v1
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18 changes: 18 additions & 0 deletions .github/workflows/review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: reviewdog
on: [pull_request]
jobs:
staticcheck:
name: runner / staticcheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: reviewdog/action-staticcheck@v1
with:
github_token: ${{ secrets.github_token }}
staticcheck_flags: 'all,-ST1000'
# Change reviewdog reporter if you need [github-pr-check,github-check,github-pr-review].
reporter: github-pr-review
# Report all results.
filter_mode: nofilter
# Exit with 1 when it find at least one finding.
fail_on_error: true
23 changes: 23 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
project_name: lls
env:
- GO111MODULE=on
before:
hooks:
- go mod tidy
builds:
- main: ./main.go
binary: lls
ldflags:
- -s -w
- -X github.com/catatsuy/lls/cli.Version=v{{.Version}}
env:
- CGO_ENABLED=0
goos:
- linux
goarch:
- amd64
- arm64
archives:
- name_template: '{{ .ProjectName }}-{{ .Os }}-{{ .Arch }}'
release:
prerelease: auto

0 comments on commit 8fc10c9

Please sign in to comment.