From 64c8432817023d7f59707091202ef9fbb6df64b9 Mon Sep 17 00:00:00 2001 From: Mzack9999 Date: Mon, 1 Jun 2020 21:20:06 +0200 Subject: [PATCH] automating --- .github/workflows/build.yaml | 27 +++++++++++++++++++++++++++ .github/workflows/release.yml | 25 +++++++++++++++++++++++++ .goreleaser.yml | 21 +++++++++++++++++++++ 3 files changed, 73 insertions(+) create mode 100644 .github/workflows/build.yaml create mode 100644 .github/workflows/release.yml create mode 100644 .goreleaser.yml diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 0000000..b72b73b --- /dev/null +++ b/.github/workflows/build.yaml @@ -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/ \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..d9c4eaf --- /dev/null +++ b/.github/workflows/release.yml @@ -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}} \ No newline at end of file diff --git a/.goreleaser.yml b/.goreleaser.yml new file mode 100644 index 0000000..1fabc17 --- /dev/null +++ b/.goreleaser.yml @@ -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 \ No newline at end of file