Skip to content
Closed
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
43 changes: 18 additions & 25 deletions .github/workflows/tauri-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,28 +14,27 @@ jobs:
fail-fast: false
matrix:
include:
- platform: 'macos-latest'
args: '--target aarch64-apple-darwin' # Apple Silicon
- platform: 'macos-latest'
args: '--target x86_64-apple-darwin' # Intel Mac
- platform: 'ubuntu-22.04'
args: ''

- platform: macos-latest
args: --target aarch64-apple-darwin
- platform: macos-latest
args: --target x86_64-apple-darwin
- platform: ubuntu-22.04
args: ""
- platform: windows-latest
args: ""

runs-on: ${{ matrix.platform }}

steps:
- name: Checkout repository
uses: actions/checkout@v4
- uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
- uses: actions/setup-node@v4
with:
node-version: 22
node-version: 18
cache: npm

- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable
- uses: dtolnay/rust-toolchain@stable
with:
# Targets for cross-compiling on MacOS
targets: ${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }}

- name: Install Linux dependencies
Expand All @@ -50,26 +49,20 @@ jobs:

- name: Install Frontend Dependencies
run: npm install
working-directory: ./src
working-directory: .

- name: Build Frontend (Vue)
# Using npx ensures these tools work on Windows, Mac, and Linux
run: |
npx cross-env DESKTOP_MODE=true npm run build
node -e "const fs = require('fs'); const src='./dist/index-cv.html'; const dest='./dist/index.html'; if (fs.existsSync(src)) { fs.copyFileSync(src, dest); console.log('Synced index files'); } else { console.log('index-cv.html not found, skipping sync'); }"
working-directory: ./src
node -e "const fs=require('fs');const s='./dist/index-cv.html';const d='./dist/index.html';if(fs.existsSync(s))fs.copyFileSync(s,d)"
working-directory: .

- name: Build Tauri App
uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
projectPath: ./src-tauri
tagName: app-v__VERSION__
releaseName: "CircuitVerse Desktop v__VERSION__"
releaseBody: "See the assets below to download this release."
releaseDraft: true
prerelease: false
projectPath: ./src-tauri
args: ${{ matrix.args }}

- name: Upload Artifacts
Expand Down
10 changes: 10 additions & 0 deletions build.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
const { execSync } = require("child_process");

const versions = ["v0", "v1"];

for (const version of versions) {
console.log(`Building for version: ${version}`);
execSync(`vite build --config vite.config.${version}.ts`, {
stdio: "inherit",
});
}
Loading
Loading