From 4d689aaffcb1c143c7c32b8b6337a55f77174c8d Mon Sep 17 00:00:00 2001 From: Nate Gay Date: Mon, 15 Jul 2024 21:57:44 -0500 Subject: [PATCH] Add goreleaser pipeline --- .github/workflows/goreleaser.yaml | 23 ++++------- .gitignore | 1 + .goreleaser.yaml | 66 +++++++++++++++++++++++++++++++ 3 files changed, 75 insertions(+), 15 deletions(-) create mode 100644 .goreleaser.yaml diff --git a/.github/workflows/goreleaser.yaml b/.github/workflows/goreleaser.yaml index 9607e1b..ca64e30 100644 --- a/.github/workflows/goreleaser.yaml +++ b/.github/workflows/goreleaser.yaml @@ -2,8 +2,8 @@ name: goreleaser on: push: - branches: - - main + tags: + - "*" permissions: contents: write @@ -12,26 +12,19 @@ jobs: goreleaser: runs-on: ubuntu-latest steps: - - - name: Checkout + - name: Checkout uses: actions/checkout@v4 with: fetch-depth: 0 - - - name: Set up Go + - name: Set up Go uses: actions/setup-go@v5 - - - name: Run GoReleaser + with: + go-version: stable + - name: Run GoReleaser uses: goreleaser/goreleaser-action@v6 with: distribution: goreleaser - version: '~> v2' + version: "v2.1.0" args: release --clean env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Upload assets - uses: actions/upload-artifact@v3 - with: - name: myapp - path: myfolder/dist/* diff --git a/.gitignore b/.gitignore index 796f0d2..bcb7705 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ .vscode bin/ +dist/ diff --git a/.goreleaser.yaml b/.goreleaser.yaml new file mode 100644 index 0000000..b781e8d --- /dev/null +++ b/.goreleaser.yaml @@ -0,0 +1,66 @@ +# yaml-language-server: $schema=https://goreleaser.com/static/schema.json +# vim: set ts=2 sw=2 tw=0 fo=cnqoj + +version: 2 + +before: + hooks: + - go mod tidy + +builds: + - env: + - CGO_ENABLED=0 + goos: + - linux + goarch: + - arm + goarm: + - 7 + +report_sizes: true + +archives: + - format: tar.gz + name_template: >- + {{ .ProjectName }}_ + {{- title .Os }}_ + {{- if eq .Arch "amd64" }}x86_64 + {{- else if eq .Arch "386" }}i386 + {{- else }}{{ .Arch }}{{ end }} + {{- if .Arm }}v{{ .Arm }}{{ end }} + files: + - LICENSE.md + - README.md + - pikvm-tailscale-cert-renewer.service + +changelog: + sort: asc + filters: + exclude: + - "^docs:" + - "^test:" + +gomod: + proxy: true + env: + - GOPROXY=https://proxy.golang.org,direct + - GOSUMDB=sum.golang.org + mod: mod + # gobinary: go1.22.5 + +# .goreleaser.yaml +release: + github: + owner: nateinaction + name: pikvm-tailscale-cert-renewer + + # TODO: Remove when comfortable with goreleaser setup + draft: true + + # Will mark the release as not ready for production in case + # there is an indicator for this in the tag e.g. v1.0.0-rc1 + prerelease: auto + + # Header for the release body. + header: | + ## PiKVM Tailscale Cert Renewer