From 4d6eda36c049ce3df9ef139860e1cf4adc5b9777 Mon Sep 17 00:00:00 2001 From: Sudo-Ivan Date: Tue, 30 Dec 2025 12:09:29 -0600 Subject: [PATCH] feat: add support for building WebAssembly (WASM) targets in CI workflow --- .gitea/workflows/build.yml | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index abb02f3..4c5ff23 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -16,6 +16,9 @@ jobs: matrix: goos: [linux, windows, darwin, freebsd] goarch: [amd64, arm64, arm] + include: + - goos: js + goarch: wasm exclude: - goos: darwin goarch: arm @@ -47,12 +50,16 @@ jobs: GOARM: ${{ matrix.goarch == 'arm' && '6' || '' }} CGO_ENABLED: '0' run: | - task build output_name="reticulum-go-${GOOS}-${GOARCH}" - if [ "$GOOS" = "windows" ]; then - output_name+=".exe" - mv bin/reticulum-go "${output_name}" + if [ "$GOOS" = "js" ] && [ "$GOARCH" = "wasm" ]; then + task build-wasm + output_name+=".wasm" + mv bin/reticulum-go.wasm "${output_name}" else + task build + if [ "$GOOS" = "windows" ]; then + output_name+=".exe" + fi mv bin/reticulum-go "${output_name}" fi echo "Built: ${output_name}" @@ -62,6 +69,8 @@ jobs: output_name="reticulum-go-${{ matrix.goos }}-${{ matrix.goarch }}" if [ "${{ matrix.goos }}" = "windows" ]; then output_name+=".exe" + elif [ "${{ matrix.goos }}" = "js" ] && [ "${{ matrix.goarch }}" = "wasm" ]; then + output_name+=".wasm" fi BINARY_PATH="${output_name}" task checksum