Skip to content

Commit 1071252

Browse files
committed
feat: Docker build linux-x64 + release script platform package support
- Add Dockerfile.linux-x64-gnu for building secure-exec-v8 binary - Stub unsupported platform packages with postinstall error - Release script: include platform packages, sync optionalDeps versions - Release workflow: Docker build + platform package publishing - Add --no-git-checks flag for RC releases from non-main branches
1 parent ec740af commit 1071252

11 files changed

Lines changed: 124 additions & 36 deletions

File tree

.github/workflows/release.yml

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,17 +52,23 @@ jobs:
5252
- name: Build
5353
run: pnpm turbo build
5454

55+
- name: Build linux-x64 binary via Docker
56+
run: |
57+
cd crates/v8-runtime
58+
docker build -f docker/Dockerfile.linux-x64-gnu -o type=local,dest=npm/linux-x64-gnu .
59+
5560
- name: Publish to npm
5661
run: |
5762
FAILURES=""
63+
64+
# Publish workspace packages
5865
for dir in $(pnpm -r ls --json --depth -1 | jq -r '.[] | select(.private != true) | .path'); do
5966
# Skip the root package
6067
if [ "$dir" = "$(pwd)" ]; then
6168
continue
6269
fi
6370
NAME=$(jq -r .name "$dir/package.json")
6471
VERSION="${{ inputs.version }}"
65-
# Skip if already published
6672
if npm view "${NAME}@${VERSION}" version >/dev/null 2>&1; then
6773
echo "⏭ ${NAME}@${VERSION} already published, skipping."
6874
continue
@@ -72,6 +78,24 @@ jobs:
7278
FAILURES="${FAILURES} ${NAME}"
7379
fi
7480
done
81+
82+
# Publish v8 platform packages (not in pnpm workspace)
83+
for dir in crates/v8-runtime/npm/*/; do
84+
if [ ! -f "$dir/package.json" ]; then
85+
continue
86+
fi
87+
NAME=$(jq -r .name "$dir/package.json")
88+
VERSION="${{ inputs.version }}"
89+
if npm view "${NAME}@${VERSION}" version >/dev/null 2>&1; then
90+
echo "⏭ ${NAME}@${VERSION} already published, skipping."
91+
continue
92+
fi
93+
echo "Publishing ${NAME}@${VERSION}..."
94+
if ! (cd "$dir" && npm publish --access public --tag ${{ inputs.npm-tag }}); then
95+
FAILURES="${FAILURES} ${NAME}"
96+
fi
97+
done
98+
7599
if [ -n "$FAILURES" ]; then
76100
echo "::error::Failed to publish:${FAILURES}"
77101
exit 1
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
FROM rust:1.85.0-bookworm AS builder
2+
WORKDIR /build
3+
COPY Cargo.toml Cargo.lock rust-toolchain.toml ./
4+
RUN mkdir src && echo 'fn main() {}' > src/main.rs
5+
RUN --mount=type=cache,target=/usr/local/cargo/registry \
6+
--mount=type=cache,target=/usr/local/cargo/git \
7+
--mount=type=cache,target=/build/target \
8+
cargo build --release --target x86_64-unknown-linux-gnu
9+
COPY src/ src/
10+
RUN --mount=type=cache,target=/usr/local/cargo/registry \
11+
--mount=type=cache,target=/usr/local/cargo/git \
12+
--mount=type=cache,target=/build/target \
13+
touch src/main.rs && \
14+
cargo build --release --target x86_64-unknown-linux-gnu && \
15+
cp target/x86_64-unknown-linux-gnu/release/secure-exec-v8 /secure-exec-v8
16+
FROM scratch
17+
COPY --from=builder /secure-exec-v8 /secure-exec-v8
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
console.error("@secure-exec/v8-darwin-arm64 is not yet supported. Only linux-x64 is available.");
2+
process.exit(1);

crates/v8-runtime/npm/darwin-arm64/package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,11 @@
44
"license": "Apache-2.0",
55
"os": ["darwin"],
66
"cpu": ["arm64"],
7-
"main": "secure-exec-v8",
8-
"files": ["secure-exec-v8"],
7+
"main": "install.js",
8+
"files": ["install.js"],
9+
"scripts": {
10+
"postinstall": "node install.js"
11+
},
912
"repository": {
1013
"type": "git",
1114
"url": "https://github.com/rivet-dev/secure-exec.git",
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
console.error("@secure-exec/v8-darwin-x64 is not yet supported. Only linux-x64 is available.");
2+
process.exit(1);

crates/v8-runtime/npm/darwin-x64/package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,11 @@
44
"license": "Apache-2.0",
55
"os": ["darwin"],
66
"cpu": ["x64"],
7-
"main": "secure-exec-v8",
8-
"files": ["secure-exec-v8"],
7+
"main": "install.js",
8+
"files": ["install.js"],
9+
"scripts": {
10+
"postinstall": "node install.js"
11+
},
912
"repository": {
1013
"type": "git",
1114
"url": "https://github.com/rivet-dev/secure-exec.git",
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
console.error("@secure-exec/v8-linux-arm64-gnu is not yet supported. Only linux-x64 is available.");
2+
process.exit(1);

crates/v8-runtime/npm/linux-arm64-gnu/package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,11 @@
44
"license": "Apache-2.0",
55
"os": ["linux"],
66
"cpu": ["arm64"],
7-
"main": "secure-exec-v8",
8-
"files": ["secure-exec-v8"],
7+
"main": "install.js",
8+
"files": ["install.js"],
9+
"scripts": {
10+
"postinstall": "node install.js"
11+
},
912
"repository": {
1013
"type": "git",
1114
"url": "https://github.com/rivet-dev/secure-exec.git",
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
console.error("@secure-exec/v8-win32-x64 is not yet supported. Only linux-x64 is available.");
2+
process.exit(1);

crates/v8-runtime/npm/win32-x64/package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,11 @@
44
"license": "Apache-2.0",
55
"os": ["win32"],
66
"cpu": ["x64"],
7-
"main": "secure-exec-v8.exe",
8-
"files": ["secure-exec-v8.exe"],
7+
"main": "install.js",
8+
"files": ["install.js"],
9+
"scripts": {
10+
"postinstall": "node install.js"
11+
},
912
"repository": {
1013
"type": "git",
1114
"url": "https://github.com/rivet-dev/secure-exec.git",

0 commit comments

Comments
 (0)