From 898e8074e87bcf2a78f61c80cfc5611c12aaa68d Mon Sep 17 00:00:00 2001 From: Lucas Bremgartner Date: Tue, 19 Sep 2023 21:25:42 +0200 Subject: [PATCH] Add goreleaser & GH action for deps update --- .github/workflows/deps.yml | 21 ++++++++++++++++++ .github/workflows/release.yml | 41 +++++++++++++++++++++++++++++++++++ .goreleaser.yml | 34 +++++++++++++++++++++++++++++ 3 files changed, 96 insertions(+) create mode 100644 .github/workflows/deps.yml create mode 100644 .github/workflows/release.yml create mode 100644 .goreleaser.yml diff --git a/.github/workflows/deps.yml b/.github/workflows/deps.yml new file mode 100644 index 0000000..91440a2 --- /dev/null +++ b/.github/workflows/deps.yml @@ -0,0 +1,21 @@ +# https://github.com/actions/go-dependency-submission +name: dependency-submission +on: + push: + branches: + - master + +permissions: + contents: write + +jobs: + main: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-go@v3 + with: + go-version: "1.20" + - uses: actions/go-dependency-submission@v1 + with: + go-mod-path: go.mod diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..8a40e3e --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,41 @@ +name: goreleaser + +on: + push: + tags: + - 'v[0-9]+.[0-9]+.[0-9]+' + workflow_dispatch: + +jobs: + goreleaser: + runs-on: ubuntu-latest + steps: + - + name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - + name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: "1.20" + + - + name: Run GoReleaser + uses: goreleaser/goreleaser-action@v4 + with: + distribution: goreleaser + version: latest + args: release --clean + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + # https://github.com/marketplace/actions/go-proxy-warming + pkg-go-dev-warming: + name: Renew documentation + runs-on: ubuntu-latest + steps: + - name: Pull new module version + uses: andrewslotin/go-proxy-pull-action@master diff --git a/.goreleaser.yml b/.goreleaser.yml new file mode 100644 index 0000000..1d84b10 --- /dev/null +++ b/.goreleaser.yml @@ -0,0 +1,34 @@ +# This is an example .goreleaser.yml file with some sane defaults. +# Make sure to check the documentation at http://goreleaser.com +before: + hooks: + # You may remove this if you don't use go modules. + - go mod tidy +builds: + - main: . + binary: pigeon + env: + - CGO_ENABLED=0 + goos: + - linux + - windows + - darwin +archives: + - name_template: >- + {{- .Binary }}_ + {{- .Version }}_ + {{- title .Os }}_ + {{- if eq .Arch "amd64" }}x86_64 + {{- else if eq .Arch "386" }}i386 + {{- else }}{{ .Arch }}{{ end }} + {{- if .Arm }}v{{ .Arm }}{{ end -}} +snapshot: + name_template: "{{ .Tag }}-next" +changelog: + skip: true +release: + github: + owner: mna + name: pigeon +gomod: + proxy: true