-
Notifications
You must be signed in to change notification settings - Fork 73
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
Showing
6 changed files
with
142 additions
and
40 deletions.
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,109 @@ | ||
name: Build | ||
|
||
'on': | ||
'push': | ||
'tags': | ||
- 'v*' | ||
'branches': | ||
- '*' | ||
'pull_request': | ||
|
||
jobs: | ||
tests: | ||
runs-on: ${{ matrix.os }} | ||
env: | ||
GO111MODULE: "on" | ||
strategy: | ||
matrix: | ||
os: | ||
- windows-latest | ||
- macos-latest | ||
- ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@master | ||
|
||
- uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.x | ||
|
||
- name: Run tests | ||
run: |- | ||
go test -race -v -bench=. -coverprofile=coverage.txt -covermode=atomic ./... | ||
- name: Upload coverage | ||
uses: codecov/codecov-action@v1 | ||
if: "success() && matrix.os == 'ubuntu-latest'" | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
file: ./coverage.txt | ||
|
||
build: | ||
needs: | ||
- tests | ||
runs-on: ubuntu-latest | ||
env: | ||
GO111MODULE: "on" | ||
steps: | ||
- uses: actions/checkout@master | ||
|
||
- uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.x | ||
|
||
- name: Prepare environment | ||
run: |- | ||
RELEASE_VERSION="${GITHUB_REF##*/}" | ||
if [[ "${RELEASE_VERSION}" != v* ]]; then RELEASE_VERSION='dev'; fi | ||
echo "RELEASE_VERSION=\"${RELEASE_VERSION}\"" >> $GITHUB_ENV | ||
# Win | ||
- run: GOOS=windows GOARCH=386 VERSION=${RELEASE_VERSION} make release | ||
- run: GOOS=windows GOARCH=amd64 VERSION=${RELEASE_VERSION} make release | ||
|
||
# MacOS | ||
- run: GOOS=darwin GOARCH=amd64 VERSION=${RELEASE_VERSION} make release | ||
|
||
# Linux X86 | ||
- run: GOOS=linux GOARCH=386 VERSION=${RELEASE_VERSION} make release | ||
- run: GOOS=linux GOARCH=amd64 VERSION=${RELEASE_VERSION} make release | ||
|
||
# Linux ARM | ||
- run: GOOS=linux GOARCH=arm GOARM=6 VERSION=${RELEASE_VERSION} make release | ||
- run: GOOS=linux GOARCH=arm64 VERSION=${RELEASE_VERSION} make release | ||
|
||
# Linux MIPS/MIPSLE | ||
- run: GOOS=linux GOARCH=mips GOMIPS=softfloat VERSION=${RELEASE_VERSION} make release | ||
- run: GOOS=linux GOARCH=mipsle GOMIPS=softfloat VERSION=${RELEASE_VERSION} make release | ||
|
||
# FreeBSD X86 | ||
- run: GOOS=freebsd GOARCH=386 VERSION=${RELEASE_VERSION} make release | ||
- run: GOOS=freebsd GOARCH=amd64 VERSION=${RELEASE_VERSION} make release | ||
|
||
# FreeBSD ARM/ARM64 | ||
- run: GOOS=freebsd GOARCH=arm GOARM=6 VERSION=${RELEASE_VERSION} make release | ||
- run: GOOS=freebsd GOARCH=arm64 VERSION=${RELEASE_VERSION} make release | ||
|
||
- run: ls -l build/dnslookup-* | ||
|
||
- name: Create release | ||
if: startsWith(github.ref, 'refs/tags/v') | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ github.ref }} | ||
release_name: Release ${{ github.ref }} | ||
draft: false | ||
prerelease: false | ||
|
||
- name: Upload | ||
if: startsWith(github.ref, 'refs/tags/v') | ||
uses: xresloader/upload-to-github-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
file: "build/dnslookup-*.tar.gz;build/dnslookup-*.zip" | ||
tags: true | ||
draft: false |
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,26 @@ | ||
name: golangci-lint | ||
'on': | ||
'push': | ||
'tags': | ||
- 'v*' | ||
'branches': | ||
- '*' | ||
'pull_request': | ||
|
||
jobs: | ||
golangci: | ||
runs-on: | ||
${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: | ||
- ubuntu-latest | ||
- macos-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: golangci-lint | ||
uses: golangci/[email protected] | ||
with: | ||
# This field is required. Dont set the patch version to always use | ||
# the latest patch version. | ||
version: v1.38 |
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
This file was deleted.
Oops, something went wrong.
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
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