From 3a17bc36e3cd5fb01ad7a2e504dfb458f94b1fba Mon Sep 17 00:00:00 2001 From: Nadia Santalla Date: Wed, 30 Oct 2024 10:57:48 +0100 Subject: [PATCH] goreleaser: download sm-k6 binary from grafana/xk6-sm --- .github/renovate.json5 | 1 + .goreleaser.yaml | 13 +++++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/renovate.json5 b/.github/renovate.json5 index 62beb105e..f24d3829b 100644 --- a/.github/renovate.json5 +++ b/.github/renovate.json5 @@ -103,6 +103,7 @@ "fileMatch": [ "Dockerfile", "internal/prober/multihttp/script_test.go", + ".goreleaser.yaml" ], "matchStrings": [ "https://github.com/grafana/xk6-sm/releases/download/(?[^/]+)/" diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 542672d4a..131b88240 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -17,6 +17,16 @@ builds: - goos: darwin goarch: arm gobinary: scripts/package/goreleaser-build + hooks: + post: + # Download sm-k6 from grafana/sm-k6 repo. + # Renovate updates this URL. + # Folded block scalar converts newlines into spaces, no need to escape them. + - >- + wget + https://github.com/grafana/xk6-sm/releases/download/v0.0.4/sm-k6-{{ .Os }}-{{ .Arch }} + -O + dist/sm-k6-{{ .Os }}-{{ .Arch }} #sboms: # - artifacts: archive archives: @@ -52,9 +62,8 @@ nfpms: type: 'config|noreplace' - src: ./scripts/package/config/systemd/synthetic-monitoring-agent.service dst: /etc/systemd/system/synthetic-monitoring-agent.service - # Copy k6 as sm-k6 to prevent clashing with k6 if it's installed. - - src: ./dist/synthetic-monitoring-agent_{{.Os}}_{{.Arch}}{{ with .Amd64 }}_{{ . }}{{ end}}/k6 + - src: ./dist/sm-k6-{{ .Os }}-{{ .Arch }} dst: /usr/bin/sm-k6 rpm: signature: