File tree Expand file tree Collapse file tree 1 file changed +14
-14
lines changed
Expand file tree Collapse file tree 1 file changed +14
-14
lines changed Original file line number Diff line number Diff line change @@ -93,63 +93,53 @@ jobs:
9393 name : macOS-64bit
9494 ext : " "
9595 archive : tar.gz
96- ldflags : ' -s -extldflags "-sectcreate __TEXT __info_plist Info.plist"'
9796 - goos : darwin
9897 goarch : arm64
9998 name : macOS-ARM64
10099 ext : " "
101100 archive : tar.gz
102- ldflags : ' -s -extldflags "-sectcreate __TEXT __info_plist Info.plist"'
103101
104102 # BSD builds
105103 - goos : dragonfly
106104 goarch : amd64
107105 name : DragonFlyBSD-64bit
108106 ext : " "
109107 archive : tar.gz
110- ldflags : " "
111108 - goos : freebsd
112109 goarch : amd64
113110 name : FreeBSD-64bit
114111 ext : " "
115112 archive : tar.gz
116- ldflags : " "
117113 - goos : freebsd
118114 goarch : arm64
119115 name : FreeBSD-ARM64
120116 ext : " "
121117 archive : tar.gz
122- ldflags : " "
123118 - goos : netbsd
124119 goarch : " 386"
125120 name : NetBSD-32bit
126121 ext : " "
127122 archive : tar.gz
128- ldflags : " "
129123 - goos : netbsd
130124 goarch : amd64
131125 name : NetBSD-64bit
132126 ext : " "
133127 archive : tar.gz
134- ldflags : " "
135128 - goos : netbsd
136129 goarch : arm64
137130 name : NetBSD-ARM64
138131 ext : " "
139132 archive : tar.gz
140- ldflags : " "
141133 - goos : openbsd
142134 goarch : amd64
143135 name : OpenBSD-64bit
144136 ext : " "
145137 archive : tar.gz
146- ldflags : " "
147138 - goos : openbsd
148139 goarch : arm64
149140 name : OpenBSD-ARM64
150141 ext : " "
151142 archive : tar.gz
152- ldflags : " "
153143
154144 steps :
155145 - name : Checkout repository
@@ -167,10 +157,20 @@ jobs:
167157 GOARCH : ${{ matrix.goarch }}
168158 GOARM : ${{ matrix.goarm }}
169159 run : |
170- LDFLAGS="${{ matrix.ldflags }}"
171- if [ -z "$LDFLAGS" ] && [ "${{ matrix.goos }}" != "darwin" ] && [ "${{ matrix.goos }}" != "dragonfly" ] && [ "${{ matrix.goos }}" != "freebsd" ] && [ "${{ matrix.goos }}" != "netbsd" ] && [ "${{ matrix.goos }}" != "openbsd" ]; then
172- LDFLAGS='-extldflags "-static"'
173- fi
160+ # Set LDFLAGS based on platform
161+ case "${{ matrix.goos }}" in
162+ "darwin")
163+ LDFLAGS='-s -extldflags "-sectcreate __TEXT __info_plist Info.plist"'
164+ ;;
165+ "dragonfly"|"freebsd"|"netbsd"|"openbsd")
166+ LDFLAGS=""
167+ ;;
168+ *)
169+ LDFLAGS='-extldflags "-static"'
170+ ;;
171+ esac
172+
173+ echo "Building for ${{ matrix.goos }}/${{ matrix.goarch }} with LDFLAGS: $LDFLAGS"
174174 go build -ldflags "$LDFLAGS" -o croc${{ matrix.ext }}
175175
176176 - name : Create archive
You can’t perform that action at this time.
0 commit comments