From 35351a9c1d8f1dcc026ee7fad4e7e203994c5997 Mon Sep 17 00:00:00 2001 From: Andrew Nesbitt Date: Mon, 9 Nov 2026 14:54:31 +0000 Subject: [PATCH] Add release automation --- .github/workflows/release.yml | 36 +++++++++++++++++++ .gitignore | 1 + .goreleaser.yaml | 65 +++++++++++++++++++++++++++++++++++ 3 files changed, 102 insertions(+) create mode 100644 .github/workflows/release.yml create mode 100644 .gitignore create mode 100644 .goreleaser.yaml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..359edcd --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,36 @@ +name: Release + +on: + push: + tags: + - "v*" + +permissions: {} + +jobs: + release: + runs-on: ubuntu-latest + permissions: + contents: write + id-token: write + + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + fetch-depth: 0 + persist-credentials: false + + - uses: sigstore/cosign-installer@6f9f17788090df1f26f669e9d70d6ae9567deba6 # v4.1.2 + + - name: Set up Go + uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0 + with: + go-version-file: go.mod + cache: false + + - uses: goreleaser/goreleaser-action@a4f02ab5355a589de60d917a659ce617ed19b3de # v7.3.0 + with: + version: "~> v2" + args: release --clean + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..849ddff --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +dist/ diff --git a/.goreleaser.yaml b/.goreleaser.yaml new file mode 100644 index 0000000..aa03a6c --- /dev/null +++ b/.goreleaser.yaml @@ -0,0 +1,65 @@ +version: 2 + +project_name: signals + +before: + hooks: + - go mod tidy + +builds: + - main: . + binary: signals + env: + - CGO_ENABLED=0 + goos: + - linux + - darwin + - windows + goarch: + - amd64 + - arm64 + mod_timestamp: "{{ .CommitTimestamp }}" + ldflags: + - -s -w + - -X main.version={{.Version}} + +archives: + - formats: tar.gz + name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}" + files: + - LICENSE* + - README* + +checksum: + name_template: "checksums.txt" + +signs: + - cmd: cosign + signature: "${artifact}.cosign.bundle" + args: + - sign-blob + - "--bundle=${signature}" + - "${artifact}" + - "--yes" + artifacts: checksum + output: true + +snapshot: + version_template: "{{ incpatch .Version }}-next" + +changelog: + sort: asc + filters: + exclude: + - "^docs:" + - "^test:" + - "^chore:" + - Merge pull request + - Merge branch + +release: + github: + owner: git-pkgs + name: signals + draft: false + prerelease: auto