Skip to content
This repository was archived by the owner on Aug 24, 2024. It is now read-only.
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
37 changes: 37 additions & 0 deletions .github/workflows/build_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Go build and test

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_dispatch:

jobs:
build:

strategy:
matrix:
go-version: [1.15.x]
platform: [ubuntu-latest, macos-latest, windows-latest]

runs-on: ${{ matrix.platform }}

steps:

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

- name: Check out code
uses: actions/checkout@v2

- name: Build
run: make

- name: Setup minimal git config
run: git config --global user.email "[email protected]" && git config --global user.name "GitHub Action"

- name: Test
run: make test
41 changes: 41 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Build release binaries

on:
workflow_dispatch:
push:
tags:
- "v*"

jobs:
build-release:
runs-on: "ubuntu-latest"

steps:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.15.x

- name: Check out code
uses: actions/checkout@v2

- name: Build
run: make

- name: Setup minimal git config
run: |
git config --global user.email "[email protected]"
git config --global user.name "GitHub Action"

- name: Test
run: make test

- name: Build binaries
run: go get github.com/mitchellh/gox && make releases

- uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
draft: true
prerelease: false
files: dist/*
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ install:
go install -ldflags "$(LDFLAGS)" .

releases:
gox -ldflags "$(LDFLAGS)" -output "dist/{{.Dir}}_{{.OS}}_{{.Arch}}"
gox -ldflags "$(LDFLAGS)" -osarch '!darwin/386' -output "dist/{{.Dir}}_{{.OS}}_{{.Arch}}"

test:
go test -v -bench=. ./...
Expand Down