From 7e4883b261936571d3c67290f9bb3f6b62d10e0b Mon Sep 17 00:00:00 2001 From: Mihai Parparita Date: Mon, 25 Jul 2022 12:16:02 -0700 Subject: [PATCH] .github/workflows: add tsconnect static build to wasm GitHub action Technically not the same as the wasm cross-compilation, but it's closely connected to it. Also includes some fixes to tool/yasm to make it actually work on non-ARM platforms. Fixes #5134 Signed-off-by: Mihai Parparita --- .github/workflows/cross-wasm.yml | 5 +++++ tool/yarn | 10 +++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/cross-wasm.yml b/.github/workflows/cross-wasm.yml index 34697a517..246e1cbf1 100644 --- a/.github/workflows/cross-wasm.yml +++ b/.github/workflows/cross-wasm.yml @@ -31,6 +31,11 @@ jobs: GOARCH: wasm run: go build ./cmd/tsconnect/wasm + - name: tsconnect static build + # Use our custom Go toolchain, we set build tags (to control binary size) + # that depend on it. + run: ./tool/go run ./cmd/tsconnect build + - uses: k0kubun/action-slack@v2.0.0 with: payload: | diff --git a/tool/yarn b/tool/yarn index 4f70e4106..e8c1b697f 100755 --- a/tool/yarn +++ b/tool/yarn @@ -13,11 +13,11 @@ YARN_DIR="$HOME/.cache/tailscale-yarn" OS=$(uname -s | tr A-Z a-z) ARCH="$(uname -m)" if [ "$ARCH" = "aarch64" ]; then - # Go uses the name "arm64". + # Node uses the name "arm64". ARCH="arm64" elif [ "$ARCH" = "x86_64" ]; then - # Go uses the name "amd64". - ARCH="amd64" + # Node uses the name "x64". + ARCH="x64" fi install_node() { @@ -49,7 +49,7 @@ install_tool() { rm -f "$archive.new" "$TOOLCHAIN.extracted" if [ ! -e "$archive" ]; then - log "Need to download $TOOL '$REV'." + log "Need to download $TOOL '$REV' from $URL." curl -f -L -o "$archive.new" $URL rm -f "$archive" mv "$archive.new" "$archive" @@ -68,7 +68,7 @@ log() { if [ "${YARN_REV}" = "SKIP" ] || [ "${OS}" != "darwin" -a "${OS}" != "linux" ] || - [ "${ARCH}" != "amd64" -a "${ARCH}" != "arm64" ]; then + [ "${ARCH}" != "x64" -a "${ARCH}" != "arm64" ]; then log "Using existing yarn (`which yarn`)." exec yarn "$@" fi