Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .github/workflows/build_and_test_debug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,16 @@ jobs:
node-version: 18
cache: npm

- name: Install Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: false

- name: Install NPM Dependencies
run: npm ci
env:
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: 'true'

- name: Lint
run: ./task lint
Expand Down Expand Up @@ -81,6 +89,40 @@ jobs:
files: |
src/shadowbox/server/api.yml

shadowbox-arm64:
name: Shadowbox (arm64)
runs-on: ubuntu-22.04-arm
needs: lint
steps:
- name: Checkout
uses: actions/checkout@v2.3.4

- name: Install Node
uses: actions/setup-node@v3
with:
node-version: 18
cache: npm

- name: Install Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: false

- name: Install NPM Dependencies
run: npm ci
env:
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: 'true'

- name: Shadowbox Debug Build (arm64)
run: TARGET_ARCH=aarch64 ./task shadowbox:build

- name: Shadowbox Unit Test
run: ./task shadowbox:test

- name: Shadowbox Docker Build (arm64)
run: TARGET_ARCH=aarch64 ./task shadowbox:docker:build

manual-install-script:
name: Manual Install Script
runs-on: ubuntu-latest
Expand Down
4 changes: 2 additions & 2 deletions src/server_manager/install_scripts/install_server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -456,8 +456,8 @@ function set_hostname() {
install_shadowbox() {
local MACHINE_TYPE
MACHINE_TYPE="$(uname -m)"
if [[ "${MACHINE_TYPE}" != "x86_64" ]]; then
log_error "Unsupported machine type: ${MACHINE_TYPE}. Please run this script on a x86_64 machine"
if [[ "${MACHINE_TYPE}" != "x86_64" && "${MACHINE_TYPE}" != "aarch64" && "${MACHINE_TYPE}" != "arm64" ]]; then
log_error "Unsupported machine type: ${MACHINE_TYPE}. Supported architectures: x86_64, aarch64/arm64."
exit 1
fi

Expand Down
16 changes: 13 additions & 3 deletions src/shadowbox/Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ tasks:
vars:
TARGET_OS: '{{.TARGET_OS | default "linux"}}'
TARGET_ARCH: '{{.TARGET_ARCH | default "x86_64"}}'
GOARCH: '{{get (dict "x86_64" "amd64") .TARGET_ARCH | default .TARGET_ARCH}}'
GOARCH: '{{get (dict "x86_64" "amd64" "aarch64" "arm64") .TARGET_ARCH | default .TARGET_ARCH}}'
TARGET_DIR: '{{.TARGET_DIR | default (joinPath .OUTPUT_BASE .TARGET_OS .TARGET_ARCH)}}'
NODE_DIR: '{{joinPath .TARGET_DIR "app"}}'
BIN_DIR: '{{joinPath .TARGET_DIR "bin"}}'
Expand Down Expand Up @@ -79,10 +79,19 @@ tasks:
# Newer node images have no valid content trust data.
# Pin the image node:16.18.0-alpine3.16 by hash.
# See image at https://hub.docker.com/_/node/tags?page=1&name=18.18.0-alpine3.18
# Note: "aarch64" is an alias for "arm64" — Linux ARM64 hosts report "aarch64" via uname -m.
NODE_IMAGE: '{{get
(dict
"x86_64" "node@sha256:a0b787b0d53feacfa6d606fb555e0dbfebab30573277f1fe25148b05b66fa097"
"arm64" "node@sha256:b4b7a1dd149c65ee6025956ac065a843b4409a62068bd2b0cbafbb30ca2fab3b"
"x86_64" "node@sha256:a0b787b0d53feacfa6d606fb555e0dbfebab30573277f1fe25148b05b66fa097"
"arm64" "node@sha256:b4b7a1dd149c65ee6025956ac065a843b4409a62068bd2b0cbafbb30ca2fab3b"
"aarch64" "node@sha256:b4b7a1dd149c65ee6025956ac065a843b4409a62068bd2b0cbafbb30ca2fab3b"
) .TARGET_ARCH
}}'
DOCKER_PLATFORM: '{{get
(dict
"x86_64" "linux/amd64"
"arm64" "linux/arm64"
"aarch64" "linux/arm64"
) .TARGET_ARCH
}}'
env:
Expand All @@ -103,6 +112,7 @@ tasks:
# Build image with given root
- |
"${DOCKER:-docker}" build --force-rm \
--platform '{{.DOCKER_PLATFORM}}' \
--build-arg NODE_IMAGE='{{.NODE_IMAGE}}' \
--build-arg VERSION='{{.VERSION}}' \
-f '{{joinPath .TASKFILE_DIR "docker" "Dockerfile"}}' \
Expand Down
Loading