From 0abe54dfbbd1d28aaa5d731c37eb8e4e008e744a Mon Sep 17 00:00:00 2001 From: Joonas Kuorilehto Date: Fri, 12 Feb 2021 06:55:16 +0000 Subject: [PATCH] dev: release on github --- .github/workflows/go.yml | 6 +++--- .github/workflows/release.yml | 29 +++++++++++++++++++++++++++++ .gitignore | 1 + .goreleaser.yml | 34 ++++++++++++++++++++++++++++++++++ 4 files changed, 67 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/release.yml create mode 100644 .gitignore create mode 100644 .goreleaser.yml diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 68e564b..6c8921f 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -2,9 +2,9 @@ name: Go on: push: - branches: [ master ] + branches: [ main ] pull_request: - branches: [ master ] + branches: [ main ] jobs: @@ -44,4 +44,4 @@ jobs: with: fetch-depth: 1 - run: "go vet ./..." - - run: "$(go env GOPATH)/bin/staticcheck -go 1.11 ./..." + - run: "$(go env GOPATH)/bin/staticcheck -go 1.11 ./..." \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..899fe0a --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,29 @@ +name: goreleaser + +on: + push: + tags: + - '*' + +jobs: + goreleaser: + runs-on: ubuntu-latest + steps: + - + name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + - + name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: ^1.15 + - + name: Run GoReleaser + uses: goreleaser/goreleaser-action@v2 + with: + version: latest + args: release --rm-dist + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1521c8b --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +dist diff --git a/.goreleaser.yml b/.goreleaser.yml new file mode 100644 index 0000000..6ba67d8 --- /dev/null +++ b/.goreleaser.yml @@ -0,0 +1,34 @@ +before: + hooks: + - go mod download +builds: + - id: "git-get" + binary: "git-get" + env: + - CGO_ENABLED=0 + goos: + - linux + - windows + - darwin +archives: + - replacements: + darwin: Darwin + linux: Linux + windows: Windows + 386: i386 + amd64: x86_64 + format_overrides: + - goos: windows + format: zip + +checksum: + name_template: 'checksums.txt' +snapshot: + name_template: "{{ .Tag }}-next" +changelog: + sort: asc + filters: + exclude: + - '^Github:' + - '^dev:' + - '^README:'