Skip to content

Commit a2b5cd0

Browse files
chore: complete first heading
1 parent 1842d61 commit a2b5cd0

1 file changed

Lines changed: 247 additions & 16 deletions

File tree

content/posts/Harsh_Rao_2025_final_report

Lines changed: 247 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,31 +15,262 @@ Welcome to my final blog for Google Summer of Code 2025 for the project **Deskto
1515
---
1616

1717
> **[_Desktop Application & Vue Frontend Updates:_](https://summerofcode.withgoogle.com/programs/2025/projects/RLcXZOiF)
18-
> The project works on the Vue Simulator **
18+
> The project works on the Vue Simulator and aims at pushing the vue-simulator to production. We have achieved several milestones like Authentication model, a beautiful Release Pipeline for Tauri simulator, version sync for v0 and v1, a brand new Testbench UI and many more. Let's dive into them right away !!**
1919

20-
### New features that have been added and merged include:
21-
- Verilog modules for circuit elements
22-
- Play/Pause button in the simulator
23-
- Improved UI/UX for code editor
24-
- Verilog terminal
25-
- Resizable & draggable view of tools window
26-
- Yosys Upgrade
20+
### Major statures that have been added and merged include:
21+
- Authentication model for Web and Tauri Simulator
22+
- Release Pipeline for Tauri Simulator
23+
- An improved Testbench UI/UX
24+
- Vue-Simulator integration with the primary codebase
25+
- Legacy feature sync to v0 and v1
26+
- Tackling major bugs
2727

2828
---
2929

30-
{{< youtube id="6wrr2ERPNHs" >}}
31-
32-
---
33-
34-
[Project link](https://github.com/orgs/CircuitVerse/projects/37/views/1)
30+
[Project link](https://github.com/orgs/CircuitVerse/projects/43/views/2)
3531

3632
---
3733
### Version confusion
3834
CircuitVerse had implemented the versioning system to avoid merging big changes to the simulator directly. This resulted in the formation of V0/, V1/ and SRC/ folders in the vue-simulator. Currently the V0 folder is default source but it can be changed by altering the configuration files. My changes were made and merged into the V1/ folder. In future all these folders will be in sync and users can change between the verisons easily.
3935

40-
### The Verilog feature in CircuitVerse includes
41-
1. Circuit to Verilog - allows users to convert circuit to verilog code
42-
2. Verilog to Circuit - allows users to convert verilog code to circuits
36+
### Automating Cross-Platform Desktop Releases
37+
One of the key deliverables for my GSoC project was a reliable release pipeline for the CircuitVerse desktop app. I initially explored fully automated tools like semantic-release and release-it!, but they offered less manual control than we needed. The ideal solution needed to balance powerful automation with maintainer oversight.
38+
39+
The breakthrough was using GitHub Actions' workflow_dispatch. This allows us to trigger the release manually, providing input on the version type (major, minor, or patch), giving us the perfect blend of automation and control. This approach culminated in the final workflow that now powers our desktop releases.
40+
41+
### The Release Workflow Code
42+
The entire process is encapsulated in a single GitHub Actions workflow file. It's composed of two primary jobs: build-tauri to compile the application across all platforms, and create-release to package and publish the final release.
43+
44+
```bash
45+
name: Manually Triggered Desktop Release
46+
47+
permissions:
48+
contents: write
49+
actions: read
50+
51+
concurrency:
52+
group: desktop-release-${{ github.ref }}
53+
cancel-in-progress: true
54+
55+
on:
56+
workflow_dispatch:
57+
inputs:
58+
version-bump:
59+
description: 'The type of version bump (major, minor, or patch)'
60+
required: true
61+
default: 'patch'
62+
type: choice
63+
options:
64+
- patch
65+
- minor
66+
- major
67+
68+
jobs:
69+
build-tauri:
70+
runs-on: ${{ matrix.os }}
71+
strategy:
72+
fail-fast: false
73+
matrix:
74+
os: [ubuntu-latest, windows-latest, macos-latest]
75+
76+
steps:
77+
- name: Checkout repository
78+
uses: actions/checkout@v4
79+
80+
- name: Setup Node.js
81+
uses: actions/setup-node@v4
82+
with:
83+
node-version: 22
84+
85+
- name: Cache Node.js Dependencies
86+
uses: actions/cache@v4
87+
with:
88+
path: ~/.npm
89+
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
90+
restore-keys: ${{ runner.os }}-node-
91+
92+
- name: Install Dependencies
93+
run: npm install
94+
shell: bash
95+
96+
- name: Run Cross-Platform Build Script
97+
run: node build-desktop.js
98+
shell: bash
99+
100+
- name: Setup Rust (stable)
101+
uses: dtolnay/rust-toolchain@stable
102+
103+
- name: Install Linux Dependencies (Ubuntu)
104+
if: matrix.os == 'ubuntu-latest'
105+
run: |
106+
sudo apt update
107+
sudo apt install libwebkit2gtk-4.1-dev \
108+
build-essential \
109+
curl \
110+
wget \
111+
file \
112+
libxdo-dev \
113+
libssl-dev \
114+
libayatana-appindicator3-dev \
115+
librsvg2-dev
116+
shell: bash
117+
118+
- name: Install macOS Dependencies
119+
if: matrix.os == 'macos-latest'
120+
run: |
121+
brew update
122+
brew install pkg-config
123+
shell: bash
124+
125+
- name: Install Windows Dependencies
126+
if: matrix.os == 'windows-latest'
127+
shell: powershell
128+
run: |
129+
choco install -y wixtoolset nsis microsoft-edge-webview2-runtime
130+
131+
- name: Cache Rust Dependencies
132+
uses: Swatinem/rust-cache@v2
133+
with:
134+
workspaces: "./src-tauri"
135+
136+
- name: Build Tauri App
137+
run: npm run tauri build
138+
shell: bash
139+
140+
- name: Upload Tauri Build Artifacts
141+
uses: actions/upload-artifact@v4
142+
with:
143+
name: Tauri Build Artifacts (${{ matrix.os }})
144+
path: |
145+
src-tauri/target/release/bundle
146+
147+
create-release:
148+
runs-on: ubuntu-latest
149+
needs: build-tauri
150+
steps:
151+
- name: Checkout repository
152+
uses: actions/checkout@v4
153+
with:
154+
fetch-depth: 0
155+
156+
- name: Generate Changelog
157+
id: changelog
158+
uses: TriPSs/conventional-changelog-action@v3
159+
with:
160+
github-token: ${{ secrets.GITHUB_TOKEN }}
161+
162+
- name: Download all build artifacts
163+
uses: actions/download-artifact@v4
164+
with:
165+
path: artifacts
166+
167+
- name: Prepare Release Assets
168+
run: |
169+
mkdir -p release-assets
170+
# Move all built files (.deb, .AppImage, .msi, .dmg) into one folder
171+
# The '|| true' prevents the workflow from failing if a specific file type doesn't exist
172+
find artifacts -type f \( -name "*.deb" -o -name "*.AppImage" -o -name "*.msi" -o -name "*.dmg" \) -exec cp {} release-assets/ \; || true
173+
174+
if [ -d "artifacts/Tauri Build Artifacts (macos-latest)/src-tauri/target/release/bundle/macos" ]; then
175+
cd "artifacts/Tauri Build Artifacts (macos-latest)/src-tauri/target/release/bundle/macos"
176+
for app in *.app; do
177+
zip -r "../../../release-assets/${app%.app}.zip" "$app"
178+
done
179+
cd -
180+
fi
181+
182+
echo "Prepared release assets:"
183+
ls -l release-assets/
184+
185+
- name: Install GitHub CLI
186+
run: |
187+
type -p curl >/dev/null || (sudo apt update && sudo apt install curl -y)
188+
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg \
189+
&& sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg \
190+
&& 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 \
191+
&& sudo apt update \
192+
&& sudo apt install gh -y
193+
194+
- name: Determine New Version and Create GitHub Release
195+
env:
196+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
197+
run: |
198+
# Fetch the latest tag from the repository
199+
LATEST_TAG=$(git tag --sort=-v:refname | head -n 1)
200+
if [[ -z "$LATEST_TAG" ]]; then
201+
# If no tags exist, start from v0.0.0
202+
LATEST_TAG="v0.0.0"
203+
fi
204+
205+
# Parse the latest tag to get major, minor, and patch numbers
206+
if [[ "$LATEST_TAG" =~ ^v([0-9]+)\.([0-9]+)\.([0-9]+)$ ]]; then
207+
MAJOR=${BASH_REMATCH[1]}
208+
MINOR=${BASH_REMATCH[2]}
209+
PATCH=${BASH_REMATCH[3]}
210+
else
211+
echo "Could not parse latest tag: $LATEST_TAG. Starting from v0.1.0."
212+
MAJOR=0; MINOR=1; PATCH=0
213+
fi
214+
# Increment the version based on the manual input
215+
BUMP_TYPE="${{ github.event.inputs.version-bump }}"
216+
if [ "$BUMP_TYPE" == "major" ]; then
217+
MAJOR=$((MAJOR + 1)); MINOR=0; PATCH=0
218+
elif [ "$BUMP_TYPE" == "minor" ]; then
219+
MINOR=$((MINOR + 1)); PATCH=0
220+
else # Default to patch
221+
PATCH=$((PATCH + 1))
222+
fi
223+
224+
if [ -n "${{ steps.changelog.outputs.tag }}" ]; then
225+
NEW_VERSION="${{ steps.changelog.outputs.tag }}"
226+
echo "Using tag from changelog output: $NEW_VERSION"
227+
else
228+
NEW_VERSION="v$MAJOR.$MINOR.$PATCH"
229+
fi
230+
echo "Creating new release: $NEW_VERSION"
231+
232+
# Get the release notes generated by the changelog action
233+
CHANGELOG_NOTES_FILE="RELEASE_NOTES.md"
234+
printf "%s\n" "${{ steps.changelog.outputs.changelog }}" > "$CHANGELOG_NOTES_FILE"
235+
236+
# Create the GitHub Release and upload all assets
237+
test -n "$(ls -A release-assets 2>/dev/null)" || { echo "No assets to upload"; exit 1; }
238+
gh release create "$NEW_VERSION" \
239+
--title "CircuitVerse Desktop $NEW_VERSION" \
240+
--notes-file "$CHANGELOG_NOTES_FILE" \
241+
release-assets/*
242+
```
243+
### How It Works 🧐
244+
The workflow operates in two sequential jobs:
245+
246+
**Job 1: `build-tauri`**
247+
This job is the workhorse, responsible for compiling the application. It uses a matrix strategy to run three parallel jobs, one for each target OS: `ubuntu-latest`, `windows-latest`, and `macos-latest`. This is the key to efficient cross-platform building.
248+
249+
- **Environment Setup:** Each job begins by checking out the code and setting up the required toolchains, like Node.js and Rust. Crucially, it also installs OS-specific dependencies needed for compilation, such as `libwebkit2gtk-4.1-dev` on Ubuntu or `wixtoolset` on Windows.
250+
251+
- **Dependency Caching:** To dramatically speed up build times on subsequent runs, the workflow caches both the Node.js (`.npm`) and Rust (`.cargo`, `target`) dependency directories. This avoids re-downloading and re-compiling hundreds of packages every time.
252+
253+
- **Build & Upload:** The job then runs the tauri build command, which creates the native application installers. Once complete, it uses the `actions/upload-artifact` action to save these installers, making them available to the next job in the workflow.
254+
255+
**Job 2: `create-release`**
256+
This job only runs after all three build jobs have completed successfully (needs: build-tauri). It handles the final packaging and publishing.
257+
258+
- **Artifact & Code Aggregation:** It begins by downloading all the build artifacts (the installers for Linux, macOS, and Windows) from the previous job. It also checks out the repository with `fetch-depth: 0` to ensure it has the full git history, which is essential for the next step.
259+
260+
- **Automated Changelog:** The `conventional-changelog-action` scans the git history since the last release tag. Based on conventional commit messages (like `feat:`, `fix:`, etc.), it automatically generates professional, well-formatted release notes.
261+
262+
- **Versioning:** A bash script then determines the new version number. It fetches the latest git tag (e.g., `v1.2.3`), parses it, and increments the version based on the version-bump input (`patch`, `minor`, or `major`) that was provided when the workflow was triggered.
263+
264+
- **Publishing:** Finally, using the GitHub CLI, the script creates a new GitHub Release. It tags the commit with the new version, sets the release title, attaches the auto-generated changelog as the release notes, and uploads all the cross-platform installers as release assets.
265+
266+
**The Final Product ✨**
267+
The result is a beautifully simple and powerful release process. Now, any maintainer can go to the repository's "`Actions`" tab, select the "`Manually Triggered Desktop Release`" workflow, choose whether it's a `major`, `minor`, or `patch` release, and click "Run workflow."
268+
269+
~~**[Screenshot Here]: A screenshot of the GitHub Actions UI showing the "Run workflow" button with the version-bump dropdown.**~~
270+
271+
From there, everything is automated. Within minutes, a new, cross-platform release is published to GitHub, complete with installers for every OS and a professional changelog, ready for our users. This pipeline removes manual effort, eliminates human error, and ensures our releases are consistent and reliable every single time.
272+
273+
~~**[GIF/Video Here]: A short screen recording showing the process from clicking "Run workflow" to the final, published release on the GitHub Releases page.**~~
43274

44275
### Adding the Verilog Modules for Circuit Elements
45276

0 commit comments

Comments
 (0)