Skip to content

Privacy-first password manager with built-in email aliasing. Fully encrypted and self-hostable.

Add core build step before running e2e tests (#1404)

Leendert de Borst0070808f815b
diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml
index 8efa919fb..2a42661d6 100644
--- a/.github/workflows/e2e-tests.yml
+++ b/.github/workflows/e2e-tests.yml
@@ -67,6 +67,30 @@ jobs:
with:
dotnet-version: 9.0.x
+ - name: Setup Node.js
+ uses: actions/setup-node@v4
+ with:
+ node-version: '20'
+
+ - name: Setup Rust toolchain
+ uses: dtolnay/rust-toolchain@stable
+ with:
+ targets: wasm32-unknown-unknown
+
+ - name: Cache Rust dependencies
+ uses: Swatinem/rust-cache@v2
+ with:
+ workspaces: core/rust
+
+ - name: Install wasm-pack
+ run: cargo install wasm-pack --locked
+
+ - name: Build core libraries
+ run: |
+ cd ./core
+ chmod +x build-and-distribute.sh
+ ./build-and-distribute.sh --browser
+
- name: Install dependencies
working-directory: apps/server
run: dotnet workload install wasm-tools
@@ -122,7 +146,7 @@ jobs:
run: |
cd ./core
chmod +x build-and-distribute.sh
- ./build-and-distribute.sh
+ ./build-and-distribute.sh --browser
- name: Install .NET dependencies
working-directory: apps/server
@@ -194,7 +218,7 @@ jobs:
run: |
cd ./core
chmod +x build-and-distribute.sh
- ./build-and-distribute.sh
+ ./build-and-distribute.sh --browser
- name: Install .NET dependencies
working-directory: apps/server
diff --git a/.github/workflows/mobile-app-build.yml b/.github/workflows/mobile-app-build.yml
index 8b08b616d..fb4525f0c 100644
--- a/.github/workflows/mobile-app-build.yml
+++ b/.github/workflows/mobile-app-build.yml
@@ -47,7 +47,7 @@ jobs:
run: |
cd ../../core
chmod +x build-and-distribute.sh
- ./build-and-distribute.sh
+ ./build-and-distribute.sh --android
- name: Verify core library distribution
run: |
@@ -103,7 +103,7 @@ jobs:
run: |
cd ../../core
chmod +x build-and-distribute.sh
- ./build-and-distribute.sh
+ ./build-and-distribute.sh --android
- name: Install dependencies
run: npm ci
diff --git a/core/build-and-distribute.sh b/core/build-and-distribute.sh
index 9f1e5660f..9d4ccd18b 100755
--- a/core/build-and-distribute.sh
+++ b/core/build-and-distribute.sh
@@ -3,6 +3,66 @@
set -e # Stop on error
set -u # Treat unset variables as errors
+# Build mode selection
+BUILD_ALL=false
+BUILD_BROWSER=false
+BUILD_DOTNET=false
+BUILD_ANDROID=false
+BUILD_COMMON=true # Always build TypeScript utils, models, and vault
+
+# Parse arguments
+while [[ $# -gt 0 ]]; do
+ case $1 in
+ --browser)
+ BUILD_BROWSER=true
+ shift
+ ;;
+ --dotnet)
+ BUILD_DOTNET=true
+ shift
+ ;;
+ --android)
+ BUILD_ANDROID=true
+ shift
+ ;;
+ --all)
+ BUILD_BROWSER=true
+ BUILD_DOTNET=true
+ BUILD_ANDROID=true
+ shift
+ ;;
+ --help)
+ echo "Usage: $0 [options]"
+ echo ""
+ echo "Target options:"
+ echo " --browser Build WASM for browser extension and Blazor WASM client"
+ echo " --dotnet Build native library for .NET server-side use"
+ echo " --android Build for Android with Kotlin bindings"
+ echo " --all Build all targets (browser, dotnet, android)"
+ echo ""
+ echo "Notes:"
+ echo " - TypeScript utilities, models, and vault are always built"
+ echo " - iOS builds are handled by Xcode build phases, not this script"
+ echo " - If no target is specified, all targets are built"
+ echo ""
+ exit 0
+ ;;
+ *)
+ echo "Unknown option: $1"
+ echo "Use --help for usage information"
+ exit 1
+ ;;
+ esac
+done
+
+# If no targets specified, build all
+if ! $BUILD_BROWSER && ! $BUILD_DOTNET && ! $BUILD_ANDROID; then
+ echo "No target specified, building all targets..."
+ BUILD_BROWSER=true
+ BUILD_DOTNET=true
+ BUILD_ANDROID=true
+fi
+
# Make all build scripts executable
chmod +x ./typescript/identity-generator/build.sh
chmod +x ./typescript/password-generator/build.sh
@@ -10,35 +70,63 @@ chmod +x ./models/build.sh
chmod +x ./vault/build.sh
chmod +x ./rust/build.sh
-# Run all build scripts
-echo "πŸš€ Starting build process for all modules..."
+echo "πŸš€ Starting build process for selected modules..."
+echo ""
-# TypeScript packages (legacy - to be migrated to Rust)
-cd ./typescript/identity-generator
-./build.sh
+# Always build common components (TypeScript utilities, models, vault)
+if $BUILD_COMMON; then
+ echo "πŸ“¦ Building common components..."
-cd ../password-generator
-./build.sh
+ # TypeScript packages (legacy - to be migrated to Rust)
+ cd ./typescript/identity-generator
+ ./build.sh
-# Models (TypeScript source of truth -> generates C#, Swift, Kotlin)
-cd ../../models
-./build.sh
+ cd ../password-generator
+ ./build.sh
-# Vault database schema & SQL utilities
-cd ../vault
-./build.sh
+ # Models (TypeScript source of truth -> generates C#, Swift, Kotlin)
+ cd ../../models
+ ./build.sh
+
+ # Vault database schema & SQL utilities
+ cd ../vault
+ ./build.sh
+
+ cd ..
+ echo "βœ… Common components built"
+ echo ""
+fi
# Rust core build (optional - requires Rust toolchain)
-cd ../rust
-if command -v rustc &> /dev/null; then
- echo "πŸ“¦ Building rust core (Rust toolchain detected)..."
- ./build.sh --android
- ./build.sh --browser
- # Do not build for iOS here as it will be built via Xcode build phases instead
- # Adding it here would make the GitHub Actions fail because of Linux runners
-else
- echo "⚠️ Skipping rust core build (Rust not installed)"
- echo " Install Rust from https://rustup.rs to enable Rust core builds"
+if $BUILD_BROWSER || $BUILD_DOTNET || $BUILD_ANDROID; then
+ cd ./rust
+
+ if command -v rustc &> /dev/null; then
+ echo "πŸ“¦ Building Rust core..."
+
+ if $BUILD_ANDROID; then
+ echo " β†’ Building for Android..."
+ ./build.sh --android
+ fi
+
+ if $BUILD_BROWSER; then
+ echo " β†’ Building for Browser/WASM..."
+ ./build.sh --browser
+ fi
+
+ if $BUILD_DOTNET; then
+ echo " β†’ Building for .NET..."
+ ./build.sh --dotnet
+ fi
+
+ echo "βœ… Rust core built"
+ else
+ echo "⚠️ Skipping Rust core build (Rust not installed)"
+ echo " Install Rust from https://rustup.rs to enable Rust core builds"
+ fi
+
+ cd ..
fi
+echo ""
echo "βœ… All builds completed successfully."