-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3a4571f
commit a8e7a05
Showing
3 changed files
with
92 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Build | ||
|
||
on: | ||
- push | ||
- pull_request | ||
|
||
jobs: | ||
test-build: | ||
name: Test & Build | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Set up Go 1.16 | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: '1.16.2' | ||
|
||
- name: Set GOPATH and PATH | ||
run: | | ||
echo "GOPATH=$(dirname $GITHUB_WORKSPACE)" >> $GITHUB_ENV | ||
echo "$(dirname $GITHUB_WORKSPACE)/bin" >> $GITHUB_PATH | ||
shell: bash | ||
|
||
- name: Check out code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Update build dependencies | ||
run: make setup | ||
|
||
- name: Check quality code | ||
run: make verify | ||
|
||
- name: Test | ||
run: make test | ||
|
||
- name: Build | ||
run: make bin | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: Release | ||
on: | ||
push: | ||
tags: | ||
- 'v*' | ||
jobs: | ||
build: | ||
name: Create Release | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Set up Go 1.16 | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: '1.16.2' | ||
|
||
- name: Set GOPATH and PATH | ||
run: | | ||
echo "GOPATH=$(dirname $GITHUB_WORKSPACE)" >> $GITHUB_ENV | ||
echo "$(dirname $GITHUB_WORKSPACE)/bin" >> $GITHUB_PATH | ||
shell: bash | ||
|
||
- name: Check out code into the Go module directory | ||
uses: actions/checkout@v2 | ||
|
||
- name: Generate releases | ||
run: make releases | ||
|
||
- name: Create Release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | ||
with: | ||
tag_name: ${{ github.ref }} | ||
release_name: ${{ github.ref }} | ||
draft: false | ||
prerelease: false | ||
|
||
- name: GitHub Release | ||
uses: softprops/action-gh-release@v1 | ||
if: success() | ||
with: | ||
draft: true | ||
files: | | ||
dist/asl_darwin-amd64 | ||
dist/asl_linux-amd64 | ||
dist/asl_windows-amd64 | ||
name: ${{ github.ref }} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
.DEFAULT_GOAL := all | ||
PLATFORMS := linux/amd64 darwin/amd64 windows/amd64 | ||
|
||
LD_FLAGS := -ldflags "-X main.Version=`git describe` -X main.BuildDate=`date -u +%Y-%m-%d_%H:%M:%S` -X main.GitHash=`git rev-parse HEAD`" | ||
LD_FLAGS := -ldflags "-X main.Version=`git describe --tags` -X main.BuildDate=`date -u +%Y-%m-%d_%H:%M:%S` -X main.GitHash=`git rev-parse HEAD`" | ||
|
||
temp = $(subst /, ,$@) | ||
os = $(word 1, $(temp)) | ||
|
@@ -14,6 +14,7 @@ setup: | |
@go get golang.org/x/lint/[email protected] | ||
@go get golang.org/x/tools/cmd/[email protected] | ||
@go get github.com/securego/gosec/[email protected] | ||
@go mod download | ||
|
||
GOFILES=$(shell find . -type f -name '*.go' -not -path "./.git/*") | ||
|
||
|