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
89 changes: 87 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ on:
branches: [main]
workflow_dispatch:

permissions:
actions: read
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
Expand All @@ -18,10 +22,17 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Checkout Sigma
uses: actions/checkout@v4
with:
repository: adsharma/sigma.js
ref: icebug-arrow-graph
path: .deps/sigma.js

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20
node-version: 24
cache: 'npm'

- name: Install dependencies
Expand Down Expand Up @@ -55,16 +66,41 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Checkout ladybug
uses: actions/checkout@v4
with:
repository: LadybugDB/ladybug
fetch-depth: 1
path: ladybug

- name: Checkout Sigma
uses: actions/checkout@v4
with:
repository: adsharma/sigma.js
ref: icebug-arrow-graph
path: .deps/sigma.js

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20
node-version: 24
cache: 'npm'

- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable

- name: Cache Tauri CLI
id: cache-tauri-cli
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/cargo-tauri
~/.cargo/registry
~/.cargo/git
key: ${{ runner.os }}-${{ matrix.target }}-cargo-tauri-v2-${{ hashFiles('src-tauri/Cargo.lock') }}

- name: Install Tauri CLI (cargo plugin)
if: steps.cache-tauri-cli.outputs.cache-hit != 'true'
run: cargo install tauri-cli --locked

- name: Install dependencies (macOS)
Expand All @@ -81,10 +117,58 @@ jobs:
- name: Install frontend dependencies
run: npm ci

- name: Build Sigma package
run: |
npm ci --prefix .deps/sigma.js
npm run build --prefix .deps/sigma.js

- name: Enable pnpm
run: corepack enable

- name: Resolve compatible lbug artifact run
working-directory: ladybug
shell: bash
env:
GITHUB_TOKEN: ${{ github.token }}
run: |
SHA="$(git rev-parse HEAD)"
API_URL="https://api.github.com/repos/LadybugDB/ladybug/actions/workflows/build-and-deploy.yml/runs"
AUTH_HEADER="Authorization: Bearer $GITHUB_TOKEN"
ACCEPT_HEADER="Accept: application/vnd.github+json"
VERSION_HEADER="X-GitHub-Api-Version: 2022-11-28"

RUN_ID="$(
curl -fsSL \
-H "$AUTH_HEADER" \
-H "$ACCEPT_HEADER" \
-H "$VERSION_HEADER" \
"$API_URL?head_sha=$SHA&status=success&per_page=1" \
| python -c 'import json,sys; data=json.load(sys.stdin); runs=data.get("workflow_runs") or []; print(runs[0]["id"] if runs else "")'
)"

if [ -z "$RUN_ID" ]; then
RUN_ID="$(
curl -fsSL \
-H "$AUTH_HEADER" \
-H "$ACCEPT_HEADER" \
-H "$VERSION_HEADER" \
"$API_URL?branch=main&status=success&per_page=1" \
| python -c 'import json,sys; data=json.load(sys.stdin); runs=data.get("workflow_runs") or []; print(runs[0]["id"] if runs else "")'
)"
fi

if [ -z "$RUN_ID" ]; then
echo "Could not find a successful LadybugDB/ladybug build-and-deploy run." >&2
exit 1
fi

echo "Using Ladybug build-and-deploy RUN_ID=$RUN_ID for SHA=$SHA"
echo "LBUG_PRECOMPILED_RUN_ID=$RUN_ID" >> "$GITHUB_ENV"

- name: Download liblbug
env:
GH_TOKEN: ${{ github.token }}
LBUG_TARGET_DIR: ${{ github.workspace }}/src-tauri/liblbug
run: bash scripts/download-liblbug.sh

- name: Build Tauri app (Linux)
Expand Down Expand Up @@ -117,6 +201,7 @@ jobs:
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
permissions:
actions: read
contents: write

steps:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ pnpm-debug.log*
lerna-debug.log*

node_modules
.deps
dist
dist-ssr
*.local
Expand Down
2 changes: 1 addition & 1 deletion eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import tseslint from 'typescript-eslint'
import { defineConfig, globalIgnores } from 'eslint/config'

export default defineConfig([
globalIgnores(['dist', 'src-tauri/target', 'src-tauri/src-tauri', 'src-tauri/gen']),
globalIgnores(['.deps', 'dist', 'src-tauri/target', 'src-tauri/src-tauri', 'src-tauri/gen']),
{
files: ['**/*.{ts,tsx}'],
extends: [
Expand Down
Loading
Loading