automating

This commit is contained in:
Mzack9999 2020-06-01 21:20:06 +02:00
parent c4d286a2f6
commit 64c8432817
3 changed files with 73 additions and 0 deletions

27
.github/workflows/build.yaml vendored Normal file
View File

@ -0,0 +1,27 @@
name: Build
on:
push:
branches:
- master
pull_request:
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.14
- name: Check out code
uses: actions/checkout@v2
- name: Test
run: go test .
working-directory: cmd/httpx/
- name: Build
run: go build .
working-directory: cmd/httpx/

25
.github/workflows/release.yml vendored Normal file
View File

@ -0,0 +1,25 @@
name: Release
on:
create:
tags:
- v*
jobs:
release:
name: Release on GitHub
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v1
- name: Validates GO releaser config
uses: docker://goreleaser/goreleaser:latest
with:
args: check
- name: Create release on GitHub
uses: docker://goreleaser/goreleaser:latest
with:
args: release
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

21
.goreleaser.yml Normal file
View File

@ -0,0 +1,21 @@
builds:
- binary: httpx
main: cmd/httpx/httpx.go
goos:
- linux
- windows
- darwin
goarch:
- amd64
- 386
- arm
- arm64
archives:
- id: tgz
format: tar.gz
replacements:
darwin: macOS
format_overrides:
- goos: windows
format: zip