Build dll runner with goreleaser

This commit is contained in:
Jerry Jacobs 2024-07-29 21:59:03 +02:00
parent c2249af78d
commit 9a402ede2e
3 changed files with 22 additions and 6 deletions

View File

@ -26,13 +26,30 @@ builds:
goarch:
- amd64
ldflags:
- -s -trimpath
- -w -trimpath
gobinary: "scripts/garble.sh"
buildmode: c-shared
tags:
- release
- dll
- id: "win-dll-loader"
env:
- CGO_ENABLED=1
- CC=x86_64-w64-mingw32-gcc
- CXX=x86_64-w64-mingw32-g++
main: ./cmd/win-dll-runner/main.go
ldflags:
- -w
gobinary: "scripts/garble.sh"
goos:
- windows
goarch:
- amd64
tags:
- release
- id: "win-release"
env:
- CGO_ENABLED=1
@ -43,7 +60,7 @@ builds:
goarch:
- amd64
ldflags:
- -H=windowsgui
- -w -H=windowsgui
gobinary: "scripts/garble.sh"
tags:
- release
@ -52,7 +69,7 @@ upx:
- # Whether to enable it or not.
#
# Templates: allowed.
enabled: true
enabled: false
# Filter by build ID.
#ids: [build1, build2]

View File

@ -5,7 +5,6 @@ package main
import (
"golang.org/x/sys/windows"
"os"
)
func runMainFromDLL() {
@ -17,7 +16,7 @@ func runMainFromDLL() {
return
}
_, _, _ := runMainFunc.Call()
_, _, _ = runMainFunc.Call()
}
func main() {

2
go.mod
View File

@ -6,13 +6,13 @@ require (
github.com/cloudfoundry/socks5-proxy v0.2.120
github.com/xor-gate/sshfp v0.0.0-20200411085609-13942eb67330
golang.org/x/crypto v0.25.0
golang.org/x/sys v0.22.0
)
require (
github.com/cloudfoundry/go-socks5 v0.0.0-20180221174514-54f73bdb8a8e // indirect
github.com/miekg/dns v1.1.29 // indirect
golang.org/x/net v0.27.0 // indirect
golang.org/x/sys v0.22.0 // indirect
)
replace github.com/cloudfoundry/socks5-proxy v0.2.120 => github.com/xor-gate/socks5-proxy v0.0.0-20240724155447-4b9ab1a56d38