Skip to content

Commit 34ef145

Browse files
committed
perf(ci): strip debug symbols from builds
Add -ldflags="-s -w" to go build commands in both build and release workflows. This removes the symbol table and DWARF debug information, reducing binary sizes by ~30%: - dtvem: ~10.9MB → ~7.5MB - dtvem-shim: ~10.3MB → ~7.2MB Fixes #72 🤖 Generated with [Claude Code](https://claude.com/claude-code)
1 parent 42b169d commit 34ef145

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,15 +140,15 @@ jobs:
140140

141141
- name: Build main CLI
142142
run: |
143-
go build -v -o dist/dtvem${{ matrix.goos == 'windows' && '.exe' || '' }} ./src
143+
go build -v -ldflags="-s -w" -o dist/dtvem${{ matrix.goos == 'windows' && '.exe' || '' }} ./src
144144
shell: bash
145145
env:
146146
GOOS: ${{ matrix.goos }}
147147
GOARCH: ${{ matrix.goarch }}
148148

149149
- name: Build shim executable
150150
run: |
151-
go build -v -o dist/dtvem-shim${{ matrix.goos == 'windows' && '.exe' || '' }} ./src/cmd/shim
151+
go build -v -ldflags="-s -w" -o dist/dtvem-shim${{ matrix.goos == 'windows' && '.exe' || '' }} ./src/cmd/shim
152152
shell: bash
153153
env:
154154
GOOS: ${{ matrix.goos }}

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,15 +179,15 @@ jobs:
179179

180180
- name: Build main CLI
181181
run: |
182-
go build -v -o dist/dtvem${{ matrix.goos == 'windows' && '.exe' || '' }} ./src
182+
go build -v -ldflags="-s -w" -o dist/dtvem${{ matrix.goos == 'windows' && '.exe' || '' }} ./src
183183
shell: bash
184184
env:
185185
GOOS: ${{ matrix.goos }}
186186
GOARCH: ${{ matrix.goarch }}
187187

188188
- name: Build shim executable
189189
run: |
190-
go build -v -o dist/dtvem-shim${{ matrix.goos == 'windows' && '.exe' || '' }} ./src/cmd/shim
190+
go build -v -ldflags="-s -w" -o dist/dtvem-shim${{ matrix.goos == 'windows' && '.exe' || '' }} ./src/cmd/shim
191191
shell: bash
192192
env:
193193
GOOS: ${{ matrix.goos }}

0 commit comments

Comments
 (0)