Skip to content

CI : Automated Release Pipeline for Tauri Desktop Simulator with enhanced Build Performance #536

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 41 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
9a2e436
Update tauri-release.yml
gitsofaryan Mar 11, 2025
b6d86f8
Update tauri-release.yml
gitsofaryan Mar 11, 2025
2a13ae3
Update tauri-release.yml
gitsofaryan Mar 11, 2025
c39e54d
Update tauri-release.yml
gitsofaryan Mar 11, 2025
76121d6
Update tauri.conf.json
gitsofaryan Mar 11, 2025
6310936
Update tauri-release.yml
gitsofaryan Mar 11, 2025
29afe3a
Update tauri.conf.json
gitsofaryan Mar 11, 2025
f4fa8c9
Update tauri.conf.json
gitsofaryan Mar 11, 2025
df04560
Create desktop.config.ts
gitsofaryan Mar 11, 2025
a3ea869
Create build-desktop.sh
gitsofaryan Mar 11, 2025
b8753ed
Update package.json
gitsofaryan Mar 11, 2025
38b5dc5
refactor: revert
gitsofaryan Mar 12, 2025
c8a9a02
refactor: revert
gitsofaryan Mar 12, 2025
00e32ad
refactor: revert
gitsofaryan Mar 12, 2025
811db41
refactor: revert
gitsofaryan Mar 12, 2025
116c7ad
refactor: revert
gitsofaryan Mar 12, 2025
b020b87
refactor: revert
gitsofaryan Mar 12, 2025
a4c788f
build: desky
gitsofaryan Mar 12, 2025
5f30528
build: desky
gitsofaryan Mar 12, 2025
aef0e64
build: desky
gitsofaryan Mar 12, 2025
3772f20
build: desky
gitsofaryan Mar 12, 2025
ac322fd
build: desky
gitsofaryan Mar 12, 2025
0d1d8a6
build: desky
gitsofaryan Mar 12, 2025
4a9a9a6
chore: desktop simulator build release
gitsofaryan Mar 14, 2025
1099d92
chore: desktop simulator build release 2
gitsofaryan Mar 14, 2025
146f5eb
chore: desktop simulator build release 3
gitsofaryan Mar 14, 2025
bb8d1ec
chore: desktop simulator build release 3
gitsofaryan Mar 14, 2025
b9c4c4e
Update tauri-release.yml
gitsofaryan Mar 14, 2025
0334029
Update tauri-release.yml
gitsofaryan Mar 14, 2025
0b74075
Create manual.yml
gitsofaryan Mar 14, 2025
8fc1f18
chore: desktop simulator build release 3
gitsofaryan Mar 14, 2025
6709f37
chore: desktop simulator build release 3
gitsofaryan Mar 14, 2025
ddfa9ec
chore: desktop simulator build release 3
gitsofaryan Mar 14, 2025
6f297c3
chore: desktop simulator build release 3
gitsofaryan Mar 14, 2025
ecc437a
chore: desktop simulator build release 3
gitsofaryan Mar 14, 2025
62cf822
chore: desktop simulator build release 3
gitsofaryan Mar 14, 2025
2e3354d
chore: desktop simulator build release 3
gitsofaryan Mar 14, 2025
7fdbe2c
ci: circuitverse desktop simulator release
gitsofaryan Mar 14, 2025
dac15e2
ci: circuitverse desktop simulator release
gitsofaryan Mar 14, 2025
4e80172
ci: circuitverse desktop simulator release
gitsofaryan Mar 14, 2025
7241d8b
ci: test release
gitsofaryan Mar 17, 2025
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
143 changes: 126 additions & 17 deletions .github/workflows/tauri-release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Vue Simulator Desktop Release
name: Vue + Tauri Simulator Desktop Release

on:
push:
Expand All @@ -17,45 +17,154 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v3
# node 22 is been used in circuitverse primary code base.

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

- name: Install Dependencies (Vue + Tauri CLI)
- name: Cache Node.js Dependencies
uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: ${{ runner.os }}-node-

- name: Install Dependencies
run: npm install
shell: bash

- name: Install Tauri CLI and API
run: |
npm install
npm install -g @tauri-apps/cli
working-directory: ./src
npm install @tauri-apps/cli @tauri-apps/api @tauri-apps/plugin-fs --save-dev
shell: bash

- name: Build Frontend (Vue)
run: |
npm run build
working-directory: ./src
- name: Run Cross-Platform Build Script
run: node tauri-build.js
shell: bash

- name: Setup Rust
if: matrix.os != 'windows-latest'
run: |
rustup update stable
rustup default stable
shell: bash

- name: Install Linux Dependencies (Ubuntu)
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt update
sudo apt install libwebkit2gtk-4.1-dev \
build-essential \
curl \
wget \
file \
libxdo-dev \
libssl-dev \
libayatana-appindicator3-dev \
librsvg2-dev
shell: bash

- name: Install macOS Dependencies
if: matrix.os == 'macos-latest'
run: |
brew update
brew install pkg-config
shell: bash

- name: Cache Rust Dependencies
uses: Swatinem/rust-cache@v2
with:
workspaces: "./src-tauri"

- name: Build Tauri App
uses: tauri-apps/tauri-action@v0
with:
projectPath: ./src-tauri
tagName: ${{ github.ref_name }}
releaseName: "Tauri Desktop Release ${{ github.ref_name }}"
releaseBody: "See the assets below to download this release."
releaseDraft: false
prerelease: false
run: npm run tauri build
shell: bash

- name: Upload Tauri Build Artifacts
uses: actions/upload-artifact@v4
with:
name: Tauri Build Artifacts (${{ matrix.os }})
path: |
src-tauri/target/release/bundle

create-release:
runs-on: ubuntu-latest
needs: build-tauri
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Download Artifacts
uses: actions/download-artifact@v4
with:
path: artifacts

- name: Prepare Release Assets
run: |
mkdir -p release-assets

# For Ubuntu (Linux)
if [ -d "artifacts/Tauri Build Artifacts (ubuntu-latest)/deb" ]; then
cp artifacts/Tauri\ Build\ Artifacts\ \(ubuntu-latest\)/deb/*.deb release-assets/ || true
fi
if [ -d "artifacts/Tauri Build Artifacts (ubuntu-latest)/appimage" ]; then
cp artifacts/Tauri\ Build\ Artifacts\ \(ubuntu-latest\)/appimage/*.AppImage release-assets/ || true
fi

# For Windows
if [ -d "artifacts/Tauri Build Artifacts (windows-latest)/msi" ]; then
cp artifacts/Tauri\ Build\ Artifacts\ \(windows-latest\)/msi/*.msi release-assets/ || true
fi

# For macOS
if [ -d "artifacts/Tauri Build Artifacts (macos-latest)/dmg" ]; then
cp artifacts/Tauri\ Build\ Artifacts\ \(macos-latest\)/dmg/*.dmg release-assets/ || true
fi
if [ -d "artifacts/Tauri Build Artifacts (macos-latest)/app" ]; then
cd artifacts/Tauri\ Build\ Artifacts\ \(macos-latest\)/app
for app in *.app; do
zip -r "../../../release-assets/${app%.app}.zip" "$app"
done
cd - || exit
fi

ls -la release-assets/
shell: bash

- name: Install GitHub CLI
run: |
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null
sudo apt update
sudo apt install gh -y
shell: bash

- name: Auto-increment version and create GitHub Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# Fetch latest tag
LATEST_TAG=$(git tag --sort=-v:refname | head -n 1)

# Extract major, minor, patch versions
if [[ "$LATEST_TAG" =~ ^v([0-9]+)\.([0-9]+)\.([0-9]+)$ ]]; then
MAJOR=${BASH_REMATCH[1]}
MINOR=${BASH_REMATCH[2]}
PATCH=${BASH_REMATCH[3]}
else
MAJOR=0
MINOR=0
PATCH=0
fi

# Increment patch version
NEW_VERSION="v$MAJOR.$MINOR.$((PATCH + 1))"

# Create release
gh release create "$NEW_VERSION" \
--title "CircuitVerse Desktop $NEW_VERSION" \
--notes "Official CircuitVerse desktop app release. Download the binaries below for your platform." \
release-assets/*
shell: bash
13 changes: 13 additions & 0 deletions src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,16 @@ log = "0.4"
tauri = { version = "2.3.1", features = ["devtools"] }
tauri-plugin-log = "2.0.0-rc"
tauri-plugin-fs = "2"

[profile.dev]
incremental = true # Fast rebuilds during development

[profile.release]
incremental = false
codegen-units = 1 # Use one code generation unit to improve cross-module optimization
lto = true # Enable Link Time Optimization to optimize across the entire binary
opt-level = "s" # Optimize for small binary size.
panic = "abort"
strip = true
debug = false
debug-assertions = false
2 changes: 1 addition & 1 deletion src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"frontendDist": "../dist",
"devUrl": "http://localhost:4000/simulatorvue/",
"beforeDevCommand": "npm run dev",
"beforeBuildCommand": "DESKTOP_MODE=true npm run build && cp ./dist/index-cv.html ./dist/index.html"
"beforeBuildCommand": "node tauri-build.js"
},
"app": {
"windows": [
Expand Down
36 changes: 36 additions & 0 deletions tauri-build.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
const os = require('os');
const { execSync } = require('child_process');


function runCommand(command) {
try {
const output = execSync(command, { encoding: 'utf8', stdio: 'pipe' });
if (output) {
console.log(output);
}
} catch (error) {
console.error(`Error executing command: ${command}`);
if (error.stdout) {
console.error(`Stdout: ${error.stdout}`);
}
if (error.stderr) {
console.error(`Stderr: ${error.stderr}`);
}
process.exit(1);
}
}


process.env.DESKTOP_MODE = "true";

const platform = os.platform();
console.log(`Building for ${platform === 'win32' ? 'Windows' : 'Unix-based system'}...`);


runCommand('npm run build');

if (platform === 'win32') {
runCommand('copy dist\\index-cv.html dist\\index.html');
} else {
runCommand('cp dist/index-cv.html dist/index.html');
}
Loading