From eb1e00405b2ce28b1319c61a24a179cff86cca08 Mon Sep 17 00:00:00 2001 From: Miles Smith Date: Sun, 31 Dec 2023 18:55:55 -0500 Subject: [PATCH 1/6] fix: add rel --- .github/workflows/go-ossf-slsa3-publish.yml | 4 -- .gitignore | 2 + .goreleaser.yaml | 47 +++++++++++++++++++++ 3 files changed, 49 insertions(+), 4 deletions(-) create mode 100644 .gitignore create mode 100644 .goreleaser.yaml diff --git a/.github/workflows/go-ossf-slsa3-publish.yml b/.github/workflows/go-ossf-slsa3-publish.yml index e3530d2..8b7febe 100644 --- a/.github/workflows/go-ossf-slsa3-publish.yml +++ b/.github/workflows/go-ossf-slsa3-publish.yml @@ -32,7 +32,3 @@ jobs: uses: slsa-framework/slsa-github-generator/.github/workflows/builder_go_slsa3.yml@v1.4.0 with: go-version: 1.21 - # ============================================================================================================= - # Optional: For more options, see https://github.com/slsa-framework/slsa-github-generator#golang-projects - # ============================================================================================================= - diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..cde0123 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ + +dist/ diff --git a/.goreleaser.yaml b/.goreleaser.yaml new file mode 100644 index 0000000..76e928c --- /dev/null +++ b/.goreleaser.yaml @@ -0,0 +1,47 @@ +# This is an example .goreleaser.yml file with some sensible defaults. +# Make sure to check the documentation at https://goreleaser.com + +# The lines below are called `modelines`. See `:help modeline` +# Feel free to remove those if you don't want/need to use them. +# yaml-language-server: $schema=https://goreleaser.com/static/schema.json +# vim: set ts=2 sw=2 tw=0 fo=cnqoj + +version: 1 + +before: + hooks: + # You may remove this if you don't use go modules. + - go mod tidy + # you may remove this if you don't need go generate + - go generate ./... + +builds: + - main: ./cmd/sol-shotty + env: + - CGO_ENABLED=0 + goos: + - linux + - windows + - darwin + +archives: + - format: tar.gz + # this name template makes the OS and Arch compatible with the results of `uname`. + 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 }} + # use zip for windows archives + format_overrides: + - goos: windows + format: zip + +changelog: + sort: asc + filters: + exclude: + - "^docs:" + - "^test:" From 80116f9ba92279d70ff5da0ea60c146559af7ec1 Mon Sep 17 00:00:00 2001 From: Miles Smith Date: Sun, 31 Dec 2023 19:01:24 -0500 Subject: [PATCH 2/6] fix: releases --- .github/workflows/go-ossf-slsa3-publish.yml | 34 --------------------- .github/workflows/releaser.yml | 30 ++++++++++++++++++ 2 files changed, 30 insertions(+), 34 deletions(-) delete mode 100644 .github/workflows/go-ossf-slsa3-publish.yml create mode 100644 .github/workflows/releaser.yml diff --git a/.github/workflows/go-ossf-slsa3-publish.yml b/.github/workflows/go-ossf-slsa3-publish.yml deleted file mode 100644 index 8b7febe..0000000 --- a/.github/workflows/go-ossf-slsa3-publish.yml +++ /dev/null @@ -1,34 +0,0 @@ -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. - -# This workflow lets you compile your Go project using a SLSA3 compliant builder. -# This workflow will generate a so-called "provenance" file describing the steps -# that were performed to generate the final binary. -# The project is an initiative of the OpenSSF (openssf.org) and is developed at -# https://github.com/slsa-framework/slsa-github-generator. -# The provenance file can be verified using https://github.com/slsa-framework/slsa-verifier. -# For more information about SLSA and how it improves the supply-chain, visit slsa.dev. - -name: SLSA Go releaser -on: - workflow_dispatch: - release: - types: [created] - -permissions: read-all - -jobs: - # ======================================================================================================================================== - # Prerequesite: Create a .slsa-goreleaser.yml in the root directory of your project. - # See format in https://github.com/slsa-framework/slsa-github-generator/blob/main/internal/builders/go/README.md#configuration-file - #========================================================================================================================================= - build: - permissions: - id-token: write # To sign. - contents: write # To upload release assets. - actions: read # To read workflow path. - uses: slsa-framework/slsa-github-generator/.github/workflows/builder_go_slsa3.yml@v1.4.0 - with: - go-version: 1.21 diff --git a/.github/workflows/releaser.yml b/.github/workflows/releaser.yml new file mode 100644 index 0000000..ef61bbc --- /dev/null +++ b/.github/workflows/releaser.yml @@ -0,0 +1,30 @@ +name: goreleaser + +on: + pull_request: + push: + +permissions: + contents: write + +jobs: + goreleaser: + runs-on: ubuntu-latest + steps: + - + name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - + name: Set up Go + uses: actions/setup-go@v4 + - + name: Run GoReleaser + uses: goreleaser/goreleaser-action@v5 + with: + distribution: goreleaser + version: latest + args: release --clean + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file From c03c79e175831bccbfc4e5d8ceaacf37d28a2b4b Mon Sep 17 00:00:00 2001 From: Miles Smith Date: Sun, 31 Dec 2023 19:05:49 -0500 Subject: [PATCH 3/6] fix: releases --- .github/workflows/releaser.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/releaser.yml b/.github/workflows/releaser.yml index ef61bbc..7b2cfde 100644 --- a/.github/workflows/releaser.yml +++ b/.github/workflows/releaser.yml @@ -19,6 +19,8 @@ jobs: - name: Set up Go uses: actions/setup-go@v4 + with: + go-version: 1.21 - name: Run GoReleaser uses: goreleaser/goreleaser-action@v5 From 5219e2ee0934760f341888939f6b1a056896da88 Mon Sep 17 00:00:00 2001 From: Miles Smith Date: Sun, 31 Dec 2023 19:13:28 -0500 Subject: [PATCH 4/6] fix: include config.yaml in release archives --- .goreleaser.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 76e928c..8e972c3 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -23,6 +23,7 @@ builds: - linux - windows - darwin + archives: - format: tar.gz @@ -38,6 +39,7 @@ archives: format_overrides: - goos: windows format: zip + files: [ 'LICENSE*', 'README*', 'CHANGELOG', 'license*', 'readme*', 'changelog', 'config.yaml'] changelog: sort: asc From d5bb9932f010d5c5140f2ad9035224320a9197b5 Mon Sep 17 00:00:00 2001 From: Miles Smith Date: Sun, 31 Dec 2023 19:19:05 -0500 Subject: [PATCH 5/6] fix: files listing --- .goreleaser.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 8e972c3..525cb30 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -39,7 +39,8 @@ archives: format_overrides: - goos: windows format: zip - files: [ 'LICENSE*', 'README*', 'CHANGELOG', 'license*', 'readme*', 'changelog', 'config.yaml'] + files: + - 'config.yaml' changelog: sort: asc From e9f70d08c8a5da4c061185c5446489d1d3bfb627 Mon Sep 17 00:00:00 2001 From: Miles Smith Date: Sun, 31 Dec 2023 19:24:23 -0500 Subject: [PATCH 6/6] chore: update release semantics and order --- .github/workflows/releaser.yml | 5 +++-- .goreleaser.yaml | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/releaser.yml b/.github/workflows/releaser.yml index 7b2cfde..8a1a5db 100644 --- a/.github/workflows/releaser.yml +++ b/.github/workflows/releaser.yml @@ -1,8 +1,9 @@ -name: goreleaser +name: Release on: - pull_request: push: + tags: + - '*' permissions: contents: write diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 525cb30..e81dfeb 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -41,6 +41,8 @@ archives: format: zip files: - 'config.yaml' + - 'LICENSE*' + - 'README*' changelog: sort: asc