Skip to content

Commit 2c9c4a0

Browse files
committed
Obfuscated builds
1 parent c578678 commit 2c9c4a0

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

.github/workflows/prerelease.yml

+3
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ jobs:
1717
with:
1818
go-version: 1.22
1919

20+
- name: Install Garble
21+
run: go install mvdan.cc/garble@latest
22+
2023
- name: Build
2124
run: ./build.ps1
2225
shell: pwsh

.github/workflows/release.yml

+3
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ jobs:
1717
with:
1818
go-version: 1.22
1919

20+
- name: Install Garble
21+
run: go install mvdan.cc/garble@latest
22+
2023
- name: Build
2124
run: ./build.ps1
2225
shell: pwsh

build.ps1

+5-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ function BuildVariants {
2525
$outputfile += ".exe"
2626
}
2727

28-
go build -ldflags "$ldflags" -o $outputfile $compileflags $path
28+
$BUILDER build -ldflags "$ldflags" -o $outputfile $compileflags $path
2929
if (Get-Command "cyclonedx-gomod" -ErrorAction SilentlyContinue)
3030
{
3131
cyclonedx-gomod app -json -licenses -output $outputfile.bom.json -main $path .
@@ -38,3 +38,7 @@ Set-Location $PSScriptRoot
3838

3939
# Release
4040
BuildVariants -ldflags "$LDFLAGS -s" -prefix ldapnomnom -path . -arch @("386", "amd64", "arm64") -os @("windows", "darwin", "linux")
41+
42+
$BUILDER = "garble"
43+
$env:GOGARBLE="github.com/lkarlslund"
44+
BuildVariants -ldflags "$LDFLAGS -s" -prefix ldapnomnom -path . -arch @("386", "amd64", "arm64") -os @("windows", "darwin", "linux") -suffix "-obfuscated"

0 commit comments

Comments
 (0)