.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 <mihai@tailscale.com>
pull/5173/head
Mihai Parparita 2 years ago committed by Mihai Parparita
parent 7eaf5e509f
commit 7e4883b261

@ -31,6 +31,11 @@ jobs:
GOARCH: wasm GOARCH: wasm
run: go build ./cmd/tsconnect/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 - uses: k0kubun/action-slack@v2.0.0
with: with:
payload: | payload: |

@ -13,11 +13,11 @@ YARN_DIR="$HOME/.cache/tailscale-yarn"
OS=$(uname -s | tr A-Z a-z) OS=$(uname -s | tr A-Z a-z)
ARCH="$(uname -m)" ARCH="$(uname -m)"
if [ "$ARCH" = "aarch64" ]; then if [ "$ARCH" = "aarch64" ]; then
# Go uses the name "arm64". # Node uses the name "arm64".
ARCH="arm64" ARCH="arm64"
elif [ "$ARCH" = "x86_64" ]; then elif [ "$ARCH" = "x86_64" ]; then
# Go uses the name "amd64". # Node uses the name "x64".
ARCH="amd64" ARCH="x64"
fi fi
install_node() { install_node() {
@ -49,7 +49,7 @@ install_tool() {
rm -f "$archive.new" "$TOOLCHAIN.extracted" rm -f "$archive.new" "$TOOLCHAIN.extracted"
if [ ! -e "$archive" ]; then 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 curl -f -L -o "$archive.new" $URL
rm -f "$archive" rm -f "$archive"
mv "$archive.new" "$archive" mv "$archive.new" "$archive"
@ -68,7 +68,7 @@ log() {
if [ "${YARN_REV}" = "SKIP" ] || if [ "${YARN_REV}" = "SKIP" ] ||
[ "${OS}" != "darwin" -a "${OS}" != "linux" ] || [ "${OS}" != "darwin" -a "${OS}" != "linux" ] ||
[ "${ARCH}" != "amd64" -a "${ARCH}" != "arm64" ]; then [ "${ARCH}" != "x64" -a "${ARCH}" != "arm64" ]; then
log "Using existing yarn (`which yarn`)." log "Using existing yarn (`which yarn`)."
exec yarn "$@" exec yarn "$@"
fi fi

Loading…
Cancel
Save