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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1 +1 @@
* @soomtochukwu
* @soomtochukwu
164 changes: 82 additions & 82 deletions .github/scripts/deploy-contracts.sh
Original file line number Diff line number Diff line change
@@ -1,82 +1,82 @@
#!/bin/bash
set -e

# ./.github/scripts/deploy-contracts.sh
# Meticulously build and deploy Soroban contracts to Stellar Testnet.

NETWORK="testnet"
RPC_URL="https://soroban-testnet.stellar.org"
FRIENDLY_NAME="deployer"

# Automatically set testnet passphrase if not provided
if [ -z "$STELLAR_NETWORK_PASSPHRASE" ]; then
export STELLAR_NETWORK_PASSPHRASE="Test SDF Network ; September 2015"
fi


echo "🛠️ Building optimized WASM binaries using Stellar CLI..."
stellar contract build

# Create scripts directory if not exists (redundant for CI but good for local)
mkdir -p ./.github/scripts

# Function to deploy a contract and capture its address
deploy_contract() {
local contract_name=$1
local wasm_path="./target/wasm32v1-none/release/${contract_name}.wasm"


echo "🚀 Deploying ${contract_name} to ${NETWORK}..." >&2


# In a real CI, STELLAR_ACCOUNT_SECRET would be provided
# stellar contract deploy \
# --wasm "$wasm_path" \
# --source "$FRIENDLY_NAME" \
# --network "$NETWORK"

# For now, we simulation the output or use the CLI if available
# Assuming the CLI is available in the CI environment
ID=$(stellar contract deploy \
--wasm "$wasm_path" \
--source-account "$STELLAR_ACCOUNT_SECRET" \
--network "$NETWORK" \
--rpc-url "$RPC_URL")

echo "$ID"
}

# Ensure .env.local exists or create it
ENV_FILE=".env.local"
touch $ENV_FILE

echo "📦 Capturing Contract IDs..."

ESCROW_ID=$(deploy_contract "escrow")
REPUTATION_ID=$(deploy_contract "reputation")
JOB_REGISTRY_ID=$(deploy_contract "job_registry")

# Update .env.local with new IDs
sed -i "/NEXT_PUBLIC_ESCROW_CONTRACT_ID=/d" $ENV_FILE
echo "NEXT_PUBLIC_ESCROW_CONTRACT_ID=$ESCROW_ID" >> $ENV_FILE

sed -i "/NEXT_PUBLIC_REPUTATION_CONTRACT_ID=/d" $ENV_FILE
echo "NEXT_PUBLIC_REPUTATION_CONTRACT_ID=$REPUTATION_ID" >> $ENV_FILE

sed -i "/NEXT_PUBLIC_JOB_REGISTRY_CONTRACT_ID=/d" $ENV_FILE
echo "NEXT_PUBLIC_JOB_REGISTRY_CONTRACT_ID=$JOB_REGISTRY_ID" >> $ENV_FILE

echo "✅ Deployment complete! IDs saved to $ENV_FILE"
echo "Escrow: $ESCROW_ID"
echo "Reputation: $REPUTATION_ID"
echo "Job Registry: $JOB_REGISTRY_ID"

# Optional: Notify via GitHub Step Summary or similar
if [ -n "$GITHUB_STEP_SUMMARY" ]; then
echo "### 🚀 Deployment Successful" >> $GITHUB_STEP_SUMMARY
echo "| Contract | ID |" >> $GITHUB_STEP_SUMMARY
echo "| --- | --- |" >> $GITHUB_STEP_SUMMARY
echo "| Escrow | \`$ESCROW_ID\` |" >> $GITHUB_STEP_SUMMARY
echo "| Reputation | \`$REPUTATION_ID\` |" >> $GITHUB_STEP_SUMMARY
echo "| Job Registry | \`$JOB_REGISTRY_ID\` |" >> $GITHUB_STEP_SUMMARY
fi
#!/bin/bash
set -e
# ./.github/scripts/deploy-contracts.sh
# Meticulously build and deploy Soroban contracts to Stellar Testnet.
NETWORK="testnet"
RPC_URL="https://soroban-testnet.stellar.org"
FRIENDLY_NAME="deployer"
# Automatically set testnet passphrase if not provided
if [ -z "$STELLAR_NETWORK_PASSPHRASE" ]; then
export STELLAR_NETWORK_PASSPHRASE="Test SDF Network ; September 2015"
fi
echo "🛠️ Building optimized WASM binaries using Stellar CLI..."
stellar contract build
# Create scripts directory if not exists (redundant for CI but good for local)
mkdir -p ./.github/scripts
# Function to deploy a contract and capture its address
deploy_contract() {
local contract_name=$1
local wasm_path="./target/wasm32v1-none/release/${contract_name}.wasm"
echo "🚀 Deploying ${contract_name} to ${NETWORK}..." >&2
# In a real CI, STELLAR_ACCOUNT_SECRET would be provided
# stellar contract deploy \
# --wasm "$wasm_path" \
# --source "$FRIENDLY_NAME" \
# --network "$NETWORK"
# For now, we simulation the output or use the CLI if available
# Assuming the CLI is available in the CI environment
ID=$(stellar contract deploy \
--wasm "$wasm_path" \
--source-account "$STELLAR_ACCOUNT_SECRET" \
--network "$NETWORK" \
--rpc-url "$RPC_URL")
echo "$ID"
}
# Ensure .env.local exists or create it
ENV_FILE=".env.local"
touch $ENV_FILE
echo "📦 Capturing Contract IDs..."
ESCROW_ID=$(deploy_contract "escrow")
REPUTATION_ID=$(deploy_contract "reputation")
JOB_REGISTRY_ID=$(deploy_contract "job_registry")
# Update .env.local with new IDs
sed -i "/NEXT_PUBLIC_ESCROW_CONTRACT_ID=/d" $ENV_FILE
echo "NEXT_PUBLIC_ESCROW_CONTRACT_ID=$ESCROW_ID" >> $ENV_FILE
sed -i "/NEXT_PUBLIC_REPUTATION_CONTRACT_ID=/d" $ENV_FILE
echo "NEXT_PUBLIC_REPUTATION_CONTRACT_ID=$REPUTATION_ID" >> $ENV_FILE
sed -i "/NEXT_PUBLIC_JOB_REGISTRY_CONTRACT_ID=/d" $ENV_FILE
echo "NEXT_PUBLIC_JOB_REGISTRY_CONTRACT_ID=$JOB_REGISTRY_ID" >> $ENV_FILE
echo "✅ Deployment complete! IDs saved to $ENV_FILE"
echo "Escrow: $ESCROW_ID"
echo "Reputation: $REPUTATION_ID"
echo "Job Registry: $JOB_REGISTRY_ID"
# Optional: Notify via GitHub Step Summary or similar
if [ -n "$GITHUB_STEP_SUMMARY" ]; then
echo "### 🚀 Deployment Successful" >> $GITHUB_STEP_SUMMARY
echo "| Contract | ID |" >> $GITHUB_STEP_SUMMARY
echo "| --- | --- |" >> $GITHUB_STEP_SUMMARY
echo "| Escrow | \`$ESCROW_ID\` |" >> $GITHUB_STEP_SUMMARY
echo "| Reputation | \`$REPUTATION_ID\` |" >> $GITHUB_STEP_SUMMARY
echo "| Job Registry | \`$JOB_REGISTRY_ID\` |" >> $GITHUB_STEP_SUMMARY
fi
114 changes: 57 additions & 57 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -1,57 +1,57 @@
name: CI

on:
push:
branches: [main, master]
pull_request:
branches: [main, master]

env:
# Real Cloud Run Backend URL for the Frontend
NEXT_PUBLIC_API_URL: https://lance-api-641037923100.us-central1.run.app

# Securely injected via GitHub Actions Secrets
DATABASE_URL: ${{ secrets.DATABASE_URL }}
JUDGE_AUTHORITY_SECRET: ${{ secrets.JUDGE_AUTHORITY_SECRET }}
OPENCLAW_API_KEY: ${{ secrets.OPENCLAW_API_KEY }}

# Contract IDs (Public information, safe to commit)
ESCROW_CONTRACT_ID: CD5E6AXK2J5C6A6C6A6C6A6C6A6C6A6C6A6C6A6C6A6C6A6C6A6C6A6C6A6
REPUTATION_CONTRACT_ID: CD5E6AXK2J5C6A6C6A6C6A6C6A6C6A6C6A6C6A6C6A6C6A6C6A6C6A6C6A6
JOB_REGISTRY_CONTRACT_ID: CD5E6AXK2J5C6A6C6A6C6A6C6A6C6A6C6A6C6A6C6A6C6A6C6A6C6A6C6A6
OPENCLAW_BASE_URL: http://localhost:8080

jobs:
backend:
name: Node.js Backend
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: "npm"
cache-dependency-path: package-lock.json
- name: Install dependencies
run: npm install --prefix backend
- name: Generate Prisma Client
run: npx prisma generate --schema=backend/prisma/schema.prisma
- name: Build
run: npm run build --prefix backend

web-build:
name: Web Frontend
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: "npm"
cache-dependency-path: package-lock.json
- name: Install dependencies
run: npm install --prefix apps/web
- name: Build
run: npm run build --prefix apps/web
name: CI
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
env:
# Real Cloud Run Backend URL for the Frontend
NEXT_PUBLIC_API_URL: https://lance-api-641037923100.us-central1.run.app
# Securely injected via GitHub Actions Secrets
DATABASE_URL: ${{ secrets.DATABASE_URL }}
JUDGE_AUTHORITY_SECRET: ${{ secrets.JUDGE_AUTHORITY_SECRET }}
OPENCLAW_API_KEY: ${{ secrets.OPENCLAW_API_KEY }}
# Contract IDs (Public information, safe to commit)
ESCROW_CONTRACT_ID: CD5E6AXK2J5C6A6C6A6C6A6C6A6C6A6C6A6C6A6C6A6C6A6C6A6C6A6C6A6
REPUTATION_CONTRACT_ID: CD5E6AXK2J5C6A6C6A6C6A6C6A6C6A6C6A6C6A6C6A6C6A6C6A6C6A6C6A6
JOB_REGISTRY_CONTRACT_ID: CD5E6AXK2J5C6A6C6A6C6A6C6A6C6A6C6A6C6A6C6A6C6A6C6A6C6A6C6A6
OPENCLAW_BASE_URL: http://localhost:8080
jobs:
backend:
name: Node.js Backend
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: "npm"
cache-dependency-path: package-lock.json
- name: Install dependencies
run: npm install --prefix backend
- name: Generate Prisma Client
run: npx prisma generate --schema=backend/prisma/schema.prisma
- name: Build
run: npm run build --prefix backend
web-build:
name: Web Frontend
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: "npm"
cache-dependency-path: package-lock.json
- name: Install dependencies
run: npm install --prefix apps/web
- name: Build
run: npm run build --prefix apps/web
Loading
Loading