@@ -2,6 +2,7 @@ name: CircuitVerse Simulator Desktop Release
2
2
3
3
on :
4
4
push :
5
+ branches : [ "main" ]
5
6
6
7
jobs :
7
8
build-tauri :
14
15
15
16
steps :
16
17
- name : Checkout Repository
17
- uses : actions/checkout@v4
18
+ uses : actions/checkout@v3
19
+ with :
20
+ persist-credentials : true
18
21
22
+ # Node 22 is used in CircuitVerse's primary code base.
19
23
- name : Setup Node.js
20
24
uses : actions/setup-node@v4
21
25
with :
@@ -30,27 +34,62 @@ jobs:
30
34
31
35
- name : Install npm Dependencies
32
36
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
33
68
34
69
- name : Run Pre-Build Script
35
70
run : node build-desktop.js
71
+ shell : bash
36
72
37
73
- name : Setup Rust (Non-Windows)
38
74
if : matrix.os != 'windows-latest'
39
75
run : |
40
76
rustup update stable
41
77
rustup default stable
78
+ shell : bash
42
79
43
80
- name : Install OS-Specific Dependencies (Ubuntu)
44
81
if : matrix.os == 'ubuntu-latest'
45
82
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
48
86
49
87
- name : Install OS-Specific Dependencies (macOS)
50
88
if : matrix.os == 'macos-latest'
51
89
run : |
52
90
brew update
53
91
brew install pkg-config
92
+ shell : bash
54
93
55
94
- name : Cache Rust Dependencies
56
95
uses : Swatinem/rust-cache@v2
@@ -59,18 +98,27 @@ jobs:
59
98
60
99
- name : Build Tauri App
61
100
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
64
113
65
114
- name : Upload Build Artifacts
66
115
uses : actions/upload-artifact@v4
67
116
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
71
119
72
- upload -release :
73
- name : Upload Artifacts to GitHub Release
120
+ create -release :
121
+ name : Create GitHub Release
74
122
runs-on : ubuntu-latest
75
123
needs : build-tauri
76
124
steps :
@@ -85,13 +133,16 @@ jobs:
85
133
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
86
134
sudo apt update
87
135
sudo apt install gh -y
136
+ shell : bash
88
137
89
- - name : Upload to Release
138
+ - name : Create GitHub Release
90
139
env :
91
140
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
92
141
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