Skip to content

Commit 6709f37

Browse files
committed
chore: desktop simulator build release 3
2 parents 8fc1f18 + 0b74075 commit 6709f37

File tree

1 file changed

+67
-16
lines changed

1 file changed

+67
-16
lines changed

.github/workflows/tauri-release.yml

Lines changed: 67 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ name: CircuitVerse Simulator Desktop Release
22

33
on:
44
push:
5+
branches: [ "main" ]
56

67
jobs:
78
build-tauri:
@@ -14,8 +15,11 @@ jobs:
1415

1516
steps:
1617
- name: Checkout Repository
17-
uses: actions/checkout@v4
18+
uses: actions/checkout@v3
19+
with:
20+
persist-credentials: true
1821

22+
# Node 22 is used in CircuitVerse's primary code base.
1923
- name: Setup Node.js
2024
uses: actions/setup-node@v4
2125
with:
@@ -30,27 +34,62 @@ jobs:
3034

3135
- name: Install npm Dependencies
3236
run: npm install
37+
shell: bash
38+
39+
- name: Create Tag if None Exist
40+
id: tag_creator
41+
run: |
42+
# If no git tags exist, create one based on package.json version.
43+
if [ -z "$(git tag)" ]; then
44+
VERSION=$(node -p "require('./package.json').version")
45+
echo "No tags found. Creating tag v$VERSION"
46+
git tag "v$VERSION"
47+
git push origin "v$VERSION"
48+
echo "VERSION=$VERSION" >> $GITHUB_ENV
49+
else
50+
VERSION=$(git describe --tags --abbrev=0)
51+
echo "Existing tag found: $VERSION"
52+
echo "VERSION=$VERSION" >> $GITHUB_ENV
53+
fi
54+
echo "Version is $VERSION"
55+
shell: bash
56+
57+
- name: Update Tauri Config with Version
58+
run: |
59+
jq '.package.version = env.VERSION' src-tauri/tauri.conf.json > src-tauri/tauri.conf.json.tmp && \
60+
mv src-tauri/tauri.conf.json.tmp src-tauri/tauri.conf.json
61+
shell: bash
62+
63+
- name: Install Tauri CLI and API
64+
run: |
65+
npm install -g @tauri-apps/cli
66+
npm install @tauri-apps/cli @tauri-apps/api @tauri-apps/plugin-fs --save-dev
67+
shell: bash
3368

3469
- name: Run Pre-Build Script
3570
run: node build-desktop.js
71+
shell: bash
3672

3773
- name: Setup Rust (Non-Windows)
3874
if: matrix.os != 'windows-latest'
3975
run: |
4076
rustup update stable
4177
rustup default stable
78+
shell: bash
4279

4380
- name: Install OS-Specific Dependencies (Ubuntu)
4481
if: matrix.os == 'ubuntu-latest'
4582
run: |
46-
sudo apt-get update
47-
sudo apt-get install -y libwebkit2gtk-4.1-dev build-essential curl wget file libxdo-dev libssl-dev libayatana-appindicator3-dev librsvg2-dev
83+
sudo apt update
84+
sudo apt install -y libwebkit2gtk-4.1-dev build-essential curl wget file libxdo-dev libssl-dev libayatana-appindicator3-dev librsvg2-dev
85+
shell: bash
4886

4987
- name: Install OS-Specific Dependencies (macOS)
5088
if: matrix.os == 'macos-latest'
5189
run: |
5290
brew update
5391
brew install pkg-config
92+
shell: bash
5493

5594
- name: Cache Rust Dependencies
5695
uses: Swatinem/rust-cache@v2
@@ -59,18 +98,27 @@ jobs:
5998

6099
- name: Build Tauri App
61100
run: npm run tauri build
62-
env:
63-
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
101+
shell: bash
102+
103+
- name: List Build Artifacts
104+
run: ls -la src-tauri/target/release/bundle
105+
shell: bash
106+
107+
- name: Create Checksums for Artifacts
108+
run: |
109+
for file in $(find src-tauri/target/release/bundle -type f -executable); do
110+
sha256sum "$file" >> src-tauri/target/release/bundle/checksums.txt
111+
done
112+
shell: bash
64113

65114
- name: Upload Build Artifacts
66115
uses: actions/upload-artifact@v4
67116
with:
68-
name: Tauri-Build-Artifacts-${{ matrix.os }}
69-
path: src-tauri/target/release/bundle/
70-
retention-days: 5
117+
name: Tauri Build Artifacts (${{ matrix.os }})
118+
path: src-tauri/target/release/bundle
71119

72-
upload-release:
73-
name: Upload Artifacts to GitHub Release
120+
create-release:
121+
name: Create GitHub Release
74122
runs-on: ubuntu-latest
75123
needs: build-tauri
76124
steps:
@@ -85,13 +133,16 @@ jobs:
85133
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
86134
sudo apt update
87135
sudo apt install gh -y
136+
shell: bash
88137

89-
- name: Upload to Release
138+
- name: Create GitHub Release
90139
env:
91140
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
92141
run: |
93-
TAG_NAME="${{ github.ref_name }}"
94-
gh release upload "$TAG_NAME" \
95-
artifacts/Tauri-Build-Artifacts-ubuntu-latest/* \
96-
artifacts/Tauri-Build-Artifacts-windows-latest/* \
97-
artifacts/Tauri-Build-Artifacts-macos-latest/*
142+
gh release create "v${{ env.VERSION }}" \
143+
--title "Release v${{ env.VERSION }}" \
144+
--notes "Official CircuitVerse Simulator Desktop Release v${{ env.VERSION }}. Download the binaries and checksums below." \
145+
artifacts/Tauri\ Build\ Artifacts\ \(ubuntu-latest\)/* \
146+
artifacts/Tauri\ Build\ Artifacts\ \(windows-latest\)/* \
147+
artifacts/Tauri\ Build\ Artifacts\ \(macos-latest\)/*
148+
shell: bash

0 commit comments

Comments
 (0)