Skip to content

Commit ab7658b

Browse files
authored
Merge pull request #76 from go-while/go-while-patch-7
Fix Go build flags in CI workflow
2 parents d308e00 + 568aca3 commit ab7658b

File tree

1 file changed

+7
-105
lines changed

1 file changed

+7
-105
lines changed

.github/workflows/build_and_publish_test.yml

Lines changed: 7 additions & 105 deletions
Original file line numberDiff line numberDiff line change
@@ -198,119 +198,21 @@ jobs:
198198
echo "CGO_ENABLED=1" >> $GITHUB_ENV
199199
echo "GOOS=windows" >> $GITHUB_ENV
200200
201-
- name: "Build rapidyenc (macOS)"
202-
if: matrix.os == 'darwin'
203-
timeout-minutes: 5
204-
run: |
205-
cd rapidyenc
206-
if [ "${{ matrix.arch }}" = "amd64" ]; then
207-
./crossbuild_rapidyenc_darwin-amd64.sh || ./build_rapidyenc_linux-amd64.sh
208-
else
209-
# For arm64, we might need to build natively or cross-compile
210-
./build_rapidyenc_linux-amd64.sh
211-
fi
212-
213201
- name: "Build rapidyenc (Alpine/musl)"
214202
if: matrix.libc == 'musl'
215203
timeout-minutes: 5
216204
run: |
217205
cd rapidyenc && ./build_rapidyenc_linux-amd64.sh
218206
# Note: May need Alpine-specific build script
219207
220-
# Run tests with race detector for supported platforms
221-
- name: "Run race detector tests (amd64/linux only)"
222-
if: matrix.os == 'linux' && matrix.arch == 'amd64' && !matrix.cross_compile
223-
timeout-minutes: 5
224-
run: go test -race ./rapidyenc/
225-
226-
- name: "Run normal tests (non-cross-compile platforms)"
227-
if: ${{ !(matrix.cross_compile) && !(matrix.os == 'linux' && matrix.arch == 'amd64') }}
228-
timeout-minutes: 5
229-
run: go test ./rapidyenc/
230-
231-
- name: "Skip tests for cross-compiled platforms"
232-
if: matrix.cross_compile
233-
run: echo "Skipping tests for cross-compiled platform ${{ matrix.name }} (requires emulation or native hardware)"
234-
235-
- name: "Test rapidyenc integration"
236-
if: ${{ !(matrix.cross_compile) }}
237-
timeout-minutes: 2
238-
run: |
239-
# Build first if not cross-compiling
240-
go build -o NZBreX -tags other .
241-
./NZBreX -testrapidyenc
242-
# - name: Clean Go module cache
243-
# run: |
244-
# rm -rf ~/.cache/go-build ~/go/pkg/mod
245-
# - name: Restore Go modules cache
246-
# # your cache restore step here
247-
248-
#- name: Cache Go modules
249-
# uses: actions/cache@v4
250-
# with:
251-
# path: |
252-
# ~/.cache/go-build
253-
# ~/go/pkg/mod
254-
# key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
255-
# restore-keys: |
256-
# ${{ runner.os }}-go-
257-
258-
- name: "clone rapidyenc"
259-
run: |
260-
cd rapidyenc
261-
if [ ! -e rapidyenc ]; then
262-
./clone_rapidyenc.sh
263-
if [ ! -e rapidyenc/.git ]; then
264-
echo "rapidyenc/ src not found, exiting"
265-
exit 1
266-
fi
267-
else
268-
echo "rapidyenc/ src exists, skipping clone"
269-
fi
270-
271-
# Build rapidyenc for different platforms
272-
- name: "Build rapidyenc (Linux amd64)"
273-
if: matrix.os == 'linux' && matrix.arch == 'amd64' && !matrix.cross_compile
274-
timeout-minutes: 5
275-
run: cd rapidyenc && ./build_rapidyenc_linux-amd64.sh
276-
277-
- name: "Build rapidyenc (Linux arm64 cross-compile)"
278-
if: matrix.os == 'linux' && matrix.arch == 'arm64' && matrix.cross_compile
279-
timeout-minutes: 5
280-
run: |
281-
cd rapidyenc && ./build_rapidyenc_linux-arm64.sh
282-
echo "CC=aarch64-linux-gnu-gcc" >> $GITHUB_ENV
283-
echo "CXX=aarch64-linux-gnu-g++" >> $GITHUB_ENV
284-
echo "CGO_ENABLED=1" >> $GITHUB_ENV
285-
echo "GOARCH=arm64" >> $GITHUB_ENV
286-
287-
- name: "Build rapidyenc (Windows amd64 cross-compile)"
288-
if: matrix.os == 'windows' && matrix.arch == 'amd64'
289-
timeout-minutes: 5
290-
run: |
291-
cd rapidyenc && ./crossbuild_rapidyenc_windows-amd64.sh
292-
echo "CC=x86_64-w64-mingw32-gcc" >> $GITHUB_ENV
293-
echo "CGO_ENABLED=1" >> $GITHUB_ENV
294-
echo "GOOS=windows" >> $GITHUB_ENV
295-
296208
- name: "Build rapidyenc (macOS)"
297209
if: matrix.os == 'darwin'
298210
timeout-minutes: 5
299211
run: |
300212
cd rapidyenc
301-
if [ "${{ matrix.arch }}" = "amd64" ]; then
302-
./crossbuild_rapidyenc_darwin-amd64.sh || ./build_rapidyenc_linux-amd64.sh
303-
else
304-
# For arm64, we might need to build natively or cross-compile
305-
./build_rapidyenc_linux-arm64.sh darwin
306-
fi
307-
308-
- name: "Build rapidyenc (Alpine/musl)"
309-
if: matrix.libc == 'musl'
310-
timeout-minutes: 5
311-
run: |
312-
cd rapidyenc && ./build_rapidyenc_linux-amd64.sh
313-
# Note: May need Alpine-specific build script
213+
# macOS builds natively - the build_rapidyenc_linux-amd64.sh script
214+
# is actually a native build script (despite the misleading name)
215+
./build_rapidyenc_linux-amd64.sh darwin
314216
315217
# Run tests with race detector for supported platforms
316218
- name: "Run race detector tests (amd64/linux only)"
@@ -386,7 +288,7 @@ jobs:
386288
binary_name=NZBreX
387289
fi
388290
echo "BINARY=$binary_name" >> $GITHUB_ENV
389-
GOARCH=${{ matrix.arch }} GOOS=${{ matrix.os }} go build -ldflags="-X main.appVersion=${{ env.VERSION }}" -o builds/${{ matrix.name }}/usr/bin/$binary_name
291+
GOARCH=${{ matrix.arch }} GOOS=${{ matrix.os }} go build -ldflags="-s -w -X main.appVersion=${{ env.VERSION }}" -o builds/${{ matrix.name }}/usr/bin/$binary_name
390292
if [ ! -f cleanHeaders.txt ]; then
391293
echo "cleanHeaders.txt not found! Build cannot continue." >&2
392294
exit 1
@@ -412,7 +314,7 @@ jobs:
412314
cat builds/${{ matrix.name }}/usr/bin/$binary_name.sha512sum
413315
fi
414316
#
415-
# packing the build
317+
# packing the build (only create zip and deb for now)
416318
#
417319
# .zip
418320
pwd && ls -lha && echo ".zip Packing builds/${{ matrix.name }}/usr/bin/$binary_name"
@@ -552,8 +454,8 @@ jobs:
552454
prerelease: ${{ contains(env.VERSION, 'test') || contains(env.VERSION, 'beta') || contains(env.VERSION, 'alpha') }}
553455
files: |
554456
NZBreX_${{ env.VERSION }}-${{ env.SHA7 }}-${{ matrix.name }}${{ env.LIBC }}.deb
555-
NZBreX_${{ env.VERSION }}-${{ env.SHA7 }}-${{ matrix.name }}${{ env.LIBC }}.tgz
556-
NZBreX_${{ env.VERSION }}-${{ env.SHA7 }}-${{ matrix.name }}${{ env.LIBC }}.tar.xz
457+
#NZBreX_${{ env.VERSION }}-${{ env.SHA7 }}-${{ matrix.name }}${{ env.LIBC }}.tgz
458+
#NZBreX_${{ env.VERSION }}-${{ env.SHA7 }}-${{ matrix.name }}${{ env.LIBC }}.tar.xz
557459
NZBreX_${{ env.VERSION }}-${{ env.SHA7 }}-${{ matrix.name }}${{ env.LIBC }}.zip
558460
NZBreX_${{ env.VERSION }}-${{ env.SHA7 }}-${{ matrix.name }}${{ env.LIBC }}.sha256sum
559461
NZBreX_${{ env.VERSION }}-${{ env.SHA7 }}-${{ matrix.name }}${{ env.LIBC }}.sha512sum

0 commit comments

Comments
 (0)