Skip to content
Open
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
29 changes: 29 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ jobs:
worker-docker: ${{ steps.filter.outputs.worker-docker }}
worker-sys: ${{ steps.filter.outputs.worker-sys }}
worker-boxlite: ${{ steps.filter.outputs.worker-boxlite }}
worker-bridge-e2b: ${{ steps.filter.outputs.worker-bridge-e2b }}
web: ${{ steps.filter.outputs.web }}
website: ${{ steps.filter.outputs.website }}
steps:
Expand Down Expand Up @@ -56,6 +57,9 @@ jobs:
worker-boxlite:
- *shared
- 'worker/worker-boxlite/**'
worker-bridge-e2b:
- *shared
- 'worker/worker-bridge-e2b/**'
web:
- '.github/workflows/ci.yml'
- 'web/**'
Expand Down Expand Up @@ -174,6 +178,30 @@ jobs:
- name: Unit tests
run: cargo test

worker-bridge-e2b:
name: Check worker-bridge-e2b
needs: changes
if: needs.changes.outputs.worker-bridge-e2b == 'true'
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./worker/worker-bridge-e2b
steps:
- name: Checkout repository
uses: actions/checkout@v6

- name: Setup Go
uses: actions/setup-go@v6
with:
go-version-file: worker/worker-bridge-e2b/go.mod
cache-dependency-path: worker/worker-bridge-e2b/go.sum

- name: Vet
run: go vet ./...

- name: Unit tests
run: go test -race ./...

web:
name: Check web
needs: changes
Expand Down Expand Up @@ -274,6 +302,7 @@ jobs:
- worker-docker
- worker-sys
- worker-boxlite
- worker-bridge-e2b
- web
- website
runs-on: ubuntu-latest
Expand Down
100 changes: 100 additions & 0 deletions .github/workflows/package-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,105 @@ jobs:
)
gh release upload "${VERSION_RAW}" "build/${WORKER_BIN}.zip" --clobber

build-worker-bridge-e2b:
name: worker-bridge-e2b (${{ matrix.os_name }}/${{ matrix.goarch }})
runs-on: ubuntu-24.04
needs:
- prepare-release
- create-draft-release
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
include:
- arch: x64
os_name: linux
goos: linux
goarch: amd64
- arch: arm64
os_name: linux
goos: linux
goarch: arm64
- arch: x64
os_name: macos
goos: darwin
goarch: amd64
- arch: arm64
os_name: macos
goos: darwin
goarch: arm64
env:
VERSION_RAW: ${{ needs.prepare-release.outputs.version_raw }}
VERSION_SAFE: ${{ needs.prepare-release.outputs.version_safe }}
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
WORKER_BIN: onlyboxes-worker-bridge-e2b_${{ needs.prepare-release.outputs.version_safe }}_${{ matrix.os_name }}_${{ matrix.goarch }}
steps:
- name: Checkout repository
uses: actions/checkout@v6

- name: Setup Go
uses: actions/setup-go@v6
with:
go-version-file: worker/worker-bridge-e2b/go.mod
cache-dependency-path: worker/worker-bridge-e2b/go.sum

- name: Build worker binary
run: |
set -euo pipefail
mkdir -p build
(
cd worker/worker-bridge-e2b
CGO_ENABLED=0 GOOS="${GOOS}" GOARCH="${GOARCH}" go build -trimpath \
-ldflags "-X github.com/onlyboxes/onlyboxes/worker/worker-bridge-e2b/internal/buildinfo.Version=${VERSION_RAW}" \
-o "../../build/${WORKER_BIN}" \
./cmd/worker-bridge-e2b
)

- name: Validate worker binary architecture
run: |
set -euo pipefail
worker_info="$(file "build/${WORKER_BIN}")"
echo "${worker_info}"
case "${GOOS}/${GOARCH}" in
linux/amd64)
grep -Eq "ELF 64-bit.*x86-64" <<< "${worker_info}"
;;
linux/arm64)
grep -Eq "ELF 64-bit.*ARM aarch64" <<< "${worker_info}"
;;
darwin/amd64)
grep -Eq "Mach-O 64-bit.*x86_64" <<< "${worker_info}"
;;
darwin/arm64)
grep -Eq "Mach-O 64-bit.*arm64" <<< "${worker_info}"
;;
*)
echo "unsupported target: ${GOOS}/${GOARCH}" >&2
exit 1
;;
esac

- name: Upload worker workflow artifact
uses: actions/upload-artifact@v7
with:
name: onlyboxes-worker-bridge-e2b-${{ matrix.os_name }}-${{ matrix.arch }}-${{ env.VERSION_SAFE }}.zip
path: build/${{ env.WORKER_BIN }}
if-no-files-found: error

- name: Upload worker release asset
env:
GH_TOKEN: ${{ github.token }}
run: |
set -euo pipefail
(
cd build
zip -q -j "${WORKER_BIN}.zip" "${WORKER_BIN}"
)
gh release upload "${VERSION_RAW}" "build/${WORKER_BIN}.zip" --clobber

build-worker-sys:
name: worker-sys (${{ matrix.os_name }}/${{ matrix.goarch }})
runs-on: ubuntu-24.04
Expand Down Expand Up @@ -802,6 +901,7 @@ jobs:
- prepare-release
- build-console
- build-worker-docker
- build-worker-bridge-e2b
- build-worker-sys
- build-worker-boxlite
- push-console-image
Expand Down
67 changes: 52 additions & 15 deletions static/architecture-dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading