From 4f697d2f5a25b3318386e42d39ddae8c0edabaae Mon Sep 17 00:00:00 2001 From: arthur Date: Fri, 24 Jan 2025 17:20:32 +0100 Subject: [PATCH 1/3] feat: create .goreleaser file and github action associated Signed-off-by: Arthur Broudoux --- .github/workflows/build-verify.yml | 18 +++++++++--------- .github/workflows/goreleaser.yaml | 30 ++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 9 deletions(-) create mode 100644 .github/workflows/goreleaser.yaml diff --git a/.github/workflows/build-verify.yml b/.github/workflows/build-verify.yml index 3b2ad96..dad6891 100644 --- a/.github/workflows/build-verify.yml +++ b/.github/workflows/build-verify.yml @@ -3,16 +3,16 @@ on: push: paths-ignore: #- '.github/**' - - '.gitignore' - - 'LICENSE' - - '*.md' + - ".gitignore" + - "LICENSE" + - "*.md" pull_request: paths-ignore: - - '.github/**' - - '.gitignore' - - 'LICENSE' - - '*.md' -permissions: + - ".github/**" + - ".gitignore" + - "LICENSE" + - "*.md" +permissions: contents: read id-token: write # needed for signing the images with GitHub OIDC Token @@ -32,7 +32,7 @@ jobs: - name: Setup Go uses: actions/setup-go@v5 with: - go-version: '1.21.3' + go-version: "1.21.3" - name: Build Go packages run: | diff --git a/.github/workflows/goreleaser.yaml b/.github/workflows/goreleaser.yaml new file mode 100644 index 0000000..6cb9d29 --- /dev/null +++ b/.github/workflows/goreleaser.yaml @@ -0,0 +1,30 @@ +name: goreleaser + +on: + push: + tags: + - "*" + +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@v5 + with: + go-version: stable + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v6 + with: + distribution: goreleaser + version: "${{ env.GITHUB_REF_NAME }}" + args: release --clean + env: + GITHUB_TOKEN: ${{ secrets.PUBLISHER_TOKEN }} From 072cdfe4e68692455b2ad264f04f174d9da2676e Mon Sep 17 00:00:00 2001 From: arthur Date: Fri, 24 Jan 2025 17:21:03 +0100 Subject: [PATCH 2/3] feat: update .goreleaser file Signed-off-by: Arthur Broudoux --- .goreleaser.yaml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .goreleaser.yaml diff --git a/.goreleaser.yaml b/.goreleaser.yaml new file mode 100644 index 0000000..77dd9be --- /dev/null +++ b/.goreleaser.yaml @@ -0,0 +1,23 @@ +version: 2 + +builds: + - main: ./main.go + binary: microcks-cli + env: + - CGO_ENABLED=0 + +release: + prerelease: auto + +universal_binaries: + - replace: true + +brews: + - name: microcks-cli + homepage: https://github.com/microcks/microcks-cli + repository: + owner: microcks + name: homebrew-tap + +checksum: + name_template: "checksums.txt" From a4fd9b6c499091bf0bac827bd50440f9392d534d Mon Sep 17 00:00:00 2001 From: arthur Date: Fri, 24 Jan 2025 17:29:31 +0100 Subject: [PATCH 3/3] feat(goreleaser): generate SBOM while release Signed-off-by: Arthur Broudoux --- .goreleaser.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 77dd9be..c46389d 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -19,5 +19,8 @@ brews: owner: microcks name: homebrew-tap +sboms: + - artifacts: archive + checksum: name_template: "checksums.txt"