Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to GitHub actions #587

Merged
merged 7 commits into from
Jan 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Golang CI

on:
push:
branches: [master]
pull_request:
types: [opened, reopened, synchronize]
schedule:
- cron: '15 3 * * 0'

jobs:
build:
name: CI Build
runs-on: ubuntu-latest
steps:
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: '1.15'
- name: Setup tools
run: |
go get golang.org/x/lint/golint
- name: Checkout code
uses: actions/checkout@v2
- name: Test Project
run: |
make test
- name: Build Project
run: |
make
32 changes: 32 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Publish release artifacts

on:
release:
type: [created]

jobs:
release:
name: Publish binaries
runs-on: ubuntu-latest
steps:
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: '1.15'
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Build Project binaries
env:
CGO_ENABLED: 0
run: |
make xc
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: dist/aws*
tag: ${{ github.ref }}
overwrite: true
file_glob: true
29 changes: 0 additions & 29 deletions .travis.yml

This file was deleted.

5 changes: 5 additions & 0 deletions golang.mk
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ GOPKGS=$(shell go list ./...)

OUTPUT_FILE=$(NAME)-$(BUILD_VERSION)-$(shell go env GOOS)-$(shell go env GOARCH)$(shell go env GOARM)$(shell go env GOEXE)
OUTPUT_LINK=$(NAME)$(shell go env GOEXE)
WINDOWS_ZIP=$(shell echo $(OUTPUT_FILE) | sed 's/\.exe/\.zip/')

default: build

Expand Down Expand Up @@ -69,7 +70,11 @@ build: go_generate _build
$(foreach TARGET,$(TARGETS),ln -sf $(OUTPUT_FILE) dist/$(OUTPUT_LINK);)

compress: _build
ifeq ($(GOOS),windows)
zip -j dist/$(WINDOWS_ZIP) dist/$(OUTPUT_FILE)
else
tar czf dist/$(OUTPUT_FILE).tar.gz -C dist $(OUTPUT_FILE)
endif
rm -f dist/$(OUTPUT_FILE)

xc: go_generate
Expand Down