Skip to content

Commit e464466

Browse files
authored
Build weeklies with debug information (#3415)
1 parent 59d8af6 commit e464466

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

.github/workflows/weekly-release.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ jobs:
1515
run: echo "GORELEASER_CURRENT_TAG=v0.0.0-$(./tools/image-tag)" >> $GITHUB_ENV
1616
- name: Set WEEKLY_IMAGE_TAG
1717
run: echo "WEEKLY_IMAGE_TAG=$(./tools/image-tag)" >> $GITHUB_ENV
18+
- name: Set GORELEASER_STRIP_DEBUG_INFO=false, so binaries are not stripped of debug info
19+
run: echo "GORELEASER_STRIP_DEBUG_INFO=false" >> $GITHUB_ENV
1820
# Forces goreleaser to use the correct previous tag for the changelog
1921
- name: Set GORELEASER_PREVIOUS_TAG
2022
run: echo "GORELEASER_PREVIOUS_TAG=$(git tag -l --sort=-version:refname | grep -E '^weekly-.*' | head -n 2 | tail -1)" >> $GITHUB_ENV

.goreleaser.yaml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@ version: 2
33
before:
44
hooks:
55
# This hook ensures that goreleaser uses the correct go version for a Pyroscope release
6-
- sh -euc "go version | grep "go version go1.21.11 " || { echo "Unexpected go version"; exit 1; }"
6+
- sh -euc 'go version | grep "go version go1.21.11 " || { echo "Unexpected go version"; exit 1; }'
7+
env:
8+
# Strip debug information from the binary by default, weekly builds will have debug information
9+
- GORELEASER_DEBUG_INFO_FLAGS={{ if and (index .Env "GORELEASER_STRIP_DEBUG_INFO") (eq .Env.GORELEASER_STRIP_DEBUG_INFO "false") }}{{ else }}-s -w{{ end }}
710
builds:
811
- env:
912
- CGO_ENABLED=0
@@ -26,7 +29,7 @@ builds:
2629
- embedassets
2730
ldflags:
2831
- >
29-
-extldflags "-static" -s -w
32+
-extldflags "-static" {{ .Env.GORELEASER_DEBUG_INFO_FLAGS }}
3033
-X "github.com/grafana/pyroscope/pkg/util/build.Branch={{ .Branch }}"
3134
-X "github.com/grafana/pyroscope/pkg/util/build.Version={{ .Version }}"
3235
-X "github.com/grafana/pyroscope/pkg/util/build.Revision={{ .ShortCommit }}"
@@ -38,7 +41,7 @@ builds:
3841
- netgo
3942
ldflags:
4043
- >
41-
-extldflags "-static" -s -w
44+
-extldflags "-static" {{ .Env.GORELEASER_DEBUG_INFO_FLAGS }}
4245
-X "github.com/grafana/pyroscope/pkg/util/build.Branch={{ .Branch }}"
4346
-X "github.com/grafana/pyroscope/pkg/util/build.Version={{ .Version }}"
4447
-X "github.com/grafana/pyroscope/pkg/util/build.Revision={{ .ShortCommit }}"

0 commit comments

Comments
 (0)