Skip to content

Commit affb4b4

Browse files
committed
add tauri
1 parent f4785ce commit affb4b4

23 files changed

+890
-138
lines changed

.github/workflows/gh-pages.yml

Lines changed: 88 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,47 @@ jobs:
9898
echo "VERSION=$VERSION" >> $GITHUB_ENV
9999
100100
101+
build-tauri:
102+
needs: deploy
103+
runs-on: ubuntu-latest
104+
strategy:
105+
matrix:
106+
platform: [windows-latest]
107+
steps:
108+
# Step 1: Checkout Code
109+
- name: Checkout code
110+
uses: actions/checkout@v3
111+
# Step 2: Set up Rust
112+
- name: Set up Rust
113+
uses: actions-rs/toolchain@v1
114+
with:
115+
toolchain: stable
116+
profile: minimal
117+
components: rustfmt, clippy
118+
# Step 3: Install and build
119+
- name: Install dependencies
120+
run: npm install
121+
- name: Build
122+
run: npm run build
123+
- name: Install Tauri dependencies
124+
run: |
125+
# Install dependencies for building Tauri apps
126+
cargo install tauri-cli
127+
# Step 4: Build Tauri App
128+
- name: Build Tauri App
129+
run: cargo tauri build
130+
# Step 5: Archive Build Artifacts
131+
- name: Archive artifacts
132+
uses: actions/upload-artifact@v3
133+
with:
134+
name: app-windows-msi
135+
path: src-tauri/target/release/bundle/msi/*
136+
- name: Archive artifacts
137+
uses: actions/upload-artifact@v3
138+
with:
139+
name: app-windows-nsis
140+
path: src-tauri/target/release/bundle/nsis/*
141+
101142
build-electron:
102143
needs: build-electron-win
103144
runs-on: macos-latest
@@ -109,8 +150,6 @@ jobs:
109150
uses: actions/checkout@v3
110151
- name: Install dependencies
111152
run: npm install
112-
- name: Install dmg-license
113-
run: npm install dmg-license
114153
- name: Build
115154
run: npm run build
116155
- name: Build Electron App
@@ -136,9 +175,10 @@ jobs:
136175
path: artifacts
137176

138177
release:
139-
needs: build-electron
178+
needs: [build-electron, build-tauri]
140179
runs-on: ubuntu-latest
141180
steps:
181+
# Electron
142182
- name: Download win Artifacts
143183
uses: actions/download-artifact@v3
144184
with:
@@ -151,6 +191,16 @@ jobs:
151191
uses: actions/download-artifact@v3
152192
with:
153193
name: linux-builds
194+
# Tauri
195+
- name: Download Tauri Windows Artifacts
196+
uses: actions/download-artifact@v3
197+
with:
198+
name: app-windows-msi
199+
- name: Download Tauri Windows Artifacts
200+
uses: actions/download-artifact@v3
201+
with:
202+
name: app-windows-nsis
203+
# Create a new GitHub release
154204
- name: Create GitHub Release
155205
id: create_release
156206
uses: actions/create-release@v1
@@ -162,31 +212,43 @@ jobs:
162212
release_name: Release New Version ${{ env.VERSION }}
163213
draft: false
164214
prerelease: false
165-
- name: Find All Files Matching VERSION
166-
id: find_files
167-
run: |
168-
VERSION=${{ env.VERSION }}
169-
files=($(ls ./*${VERSION}* 2>/dev/null || echo ""))
170-
if [ ${#files[@]} -eq 0 ]; then
171-
echo "Error: No files found matching VERSION ${VERSION}"
172-
exit 1
173-
fi
174-
echo "Found files: ${files[@]}"
175-
file_list=$(IFS=','; echo "${files[*]}")
176-
echo "file_list=$file_list" >> $GITHUB_ENV
215+
# Upload all artifacts to the release
177216
- name: Upload Release Assets
178-
run: |
179-
IFS=',' read -r -a file_array <<< "${{ env.file_list }}"
180-
for file in "${file_array[@]}"; do
181-
echo "Uploading $file..."
182-
curl -XPOST \
183-
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
184-
-H "Content-Type: application/octet-stream" \
185-
--data-binary @$file \
186-
"https://uploads.github.com/repos/iDataVisualizationLab/TxDOT/releases/${{ steps.create_release.outputs.id }}/assets?name=$(basename $file)"
187-
done
217+
uses: actions/upload-release-asset@v1
188218
env:
189-
file_list: ${{ env.file_list }}
219+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
220+
VERSION: ${{ env.VERSION }}
221+
with:
222+
upload_url: ${{ steps.create_release.outputs.upload_url }}
223+
asset_path: artifacts/*.*
224+
asset_name: ${{ github.ref_name }}-build-${{ matrix.platform }}
225+
asset_content_type: application/octet-stream
226+
227+
# - name: Find All Files Matching VERSION
228+
# id: find_files
229+
# run: |
230+
# VERSION=${{ env.VERSION }}
231+
# files=($(ls ./*${VERSION}* 2>/dev/null || echo ""))
232+
# if [ ${#files[@]} -eq 0 ]; then
233+
# echo "Error: No files found matching VERSION ${VERSION}"
234+
# exit 1
235+
# fi
236+
# echo "Found files: ${files[@]}"
237+
# file_list=$(IFS=','; echo "${files[*]}")
238+
# echo "file_list=$file_list" >> $GITHUB_ENV
239+
# - name: Upload Release Assets
240+
# run: |
241+
# IFS=',' read -r -a file_array <<< "${{ env.file_list }}"
242+
# for file in "${file_array[@]}"; do
243+
# echo "Uploading $file..."
244+
# curl -XPOST \
245+
# -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
246+
# -H "Content-Type: application/octet-stream" \
247+
# --data-binary @$file \
248+
# "https://uploads.github.com/repos/iDataVisualizationLab/TxDOT/releases/${{ steps.create_release.outputs.id }}/assets?name=$(basename $file)"
249+
# done
250+
# env:
251+
# file_list: ${{ env.file_list }}
190252

191253

192254

dist/build/static/js/bundle.min.js

Lines changed: 0 additions & 2 deletions
This file was deleted.

dist/build/static/js/bundle.min.js.LICENSE.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

dist/builder-debug.yml

Lines changed: 197 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,200 @@ x64:
1515
nodeModuleFilePatterns:
1616
- '**/*'
1717
- build/**/*
18+
nsis:
19+
script: |-
20+
!include "T:\TxCRCP\TxDOT\node_modules\app-builder-lib\templates\nsis\include\StdUtils.nsh"
21+
!addincludedir "T:\TxCRCP\TxDOT\node_modules\app-builder-lib\templates\nsis\include"
22+
!macro _isUpdated _a _b _t _f
23+
${StdUtils.TestParameter} $R9 "updated"
24+
StrCmp "$R9" "true" `${_t}` `${_f}`
25+
!macroend
26+
!define isUpdated `"" isUpdated ""`
27+
28+
!macro _isForceRun _a _b _t _f
29+
${StdUtils.TestParameter} $R9 "force-run"
30+
StrCmp "$R9" "true" `${_t}` `${_f}`
31+
!macroend
32+
!define isForceRun `"" isForceRun ""`
33+
34+
!macro _isKeepShortcuts _a _b _t _f
35+
${StdUtils.TestParameter} $R9 "keep-shortcuts"
36+
StrCmp "$R9" "true" `${_t}` `${_f}`
37+
!macroend
38+
!define isKeepShortcuts `"" isKeepShortcuts ""`
39+
40+
!macro _isNoDesktopShortcut _a _b _t _f
41+
${StdUtils.TestParameter} $R9 "no-desktop-shortcut"
42+
StrCmp "$R9" "true" `${_t}` `${_f}`
43+
!macroend
44+
!define isNoDesktopShortcut `"" isNoDesktopShortcut ""`
45+
46+
!macro _isDeleteAppData _a _b _t _f
47+
${StdUtils.TestParameter} $R9 "delete-app-data"
48+
StrCmp "$R9" "true" `${_t}` `${_f}`
49+
!macroend
50+
!define isDeleteAppData `"" isDeleteAppData ""`
51+
52+
!macro _isForAllUsers _a _b _t _f
53+
${StdUtils.TestParameter} $R9 "allusers"
54+
StrCmp "$R9" "true" `${_t}` `${_f}`
55+
!macroend
56+
!define isForAllUsers `"" isForAllUsers ""`
57+
58+
!macro _isForCurrentUser _a _b _t _f
59+
${StdUtils.TestParameter} $R9 "currentuser"
60+
StrCmp "$R9" "true" `${_t}` `${_f}`
61+
!macroend
62+
!define isForCurrentUser `"" isForCurrentUser ""`
63+
64+
!macro addLangs
65+
!insertmacro MUI_LANGUAGE "English"
66+
!insertmacro MUI_LANGUAGE "German"
67+
!insertmacro MUI_LANGUAGE "French"
68+
!insertmacro MUI_LANGUAGE "SpanishInternational"
69+
!insertmacro MUI_LANGUAGE "SimpChinese"
70+
!insertmacro MUI_LANGUAGE "TradChinese"
71+
!insertmacro MUI_LANGUAGE "Japanese"
72+
!insertmacro MUI_LANGUAGE "Korean"
73+
!insertmacro MUI_LANGUAGE "Italian"
74+
!insertmacro MUI_LANGUAGE "Dutch"
75+
!insertmacro MUI_LANGUAGE "Danish"
76+
!insertmacro MUI_LANGUAGE "Swedish"
77+
!insertmacro MUI_LANGUAGE "Norwegian"
78+
!insertmacro MUI_LANGUAGE "Finnish"
79+
!insertmacro MUI_LANGUAGE "Russian"
80+
!insertmacro MUI_LANGUAGE "Portuguese"
81+
!insertmacro MUI_LANGUAGE "PortugueseBR"
82+
!insertmacro MUI_LANGUAGE "Polish"
83+
!insertmacro MUI_LANGUAGE "Ukrainian"
84+
!insertmacro MUI_LANGUAGE "Czech"
85+
!insertmacro MUI_LANGUAGE "Slovak"
86+
!insertmacro MUI_LANGUAGE "Hungarian"
87+
!insertmacro MUI_LANGUAGE "Arabic"
88+
!insertmacro MUI_LANGUAGE "Turkish"
89+
!insertmacro MUI_LANGUAGE "Thai"
90+
!insertmacro MUI_LANGUAGE "Vietnamese"
91+
!macroend
92+
93+
!addplugindir /x86-unicode "C:\Users\pyppr\AppData\Local\electron-builder\Cache\nsis\nsis-resources-3.4.1\plugins\x86-unicode"
94+
!include "C:\Users\pyppr\AppData\Local\Temp\t-2NpzRD\0-messages.nsh"
95+
96+
Var newStartMenuLink
97+
Var oldStartMenuLink
98+
Var newDesktopLink
99+
Var oldDesktopLink
100+
Var oldShortcutName
101+
Var oldMenuDirectory
102+
103+
!include "common.nsh"
104+
!include "MUI2.nsh"
105+
!include "multiUser.nsh"
106+
!include "allowOnlyOneInstallerInstance.nsh"
107+
108+
!ifdef INSTALL_MODE_PER_ALL_USERS
109+
!ifdef BUILD_UNINSTALLER
110+
RequestExecutionLevel user
111+
!else
112+
RequestExecutionLevel admin
113+
!endif
114+
!else
115+
RequestExecutionLevel user
116+
!endif
117+
118+
!ifdef BUILD_UNINSTALLER
119+
SilentInstall silent
120+
!else
121+
Var appExe
122+
Var launchLink
123+
!endif
124+
125+
!ifdef ONE_CLICK
126+
!include "oneClick.nsh"
127+
!else
128+
!include "assistedInstaller.nsh"
129+
!endif
130+
131+
!insertmacro addLangs
132+
133+
!ifmacrodef customHeader
134+
!insertmacro customHeader
135+
!endif
136+
137+
Function .onInit
138+
SetOutPath $INSTDIR
139+
${LogSet} on
140+
141+
!ifmacrodef preInit
142+
!insertmacro preInit
143+
!endif
144+
145+
!ifdef DISPLAY_LANG_SELECTOR
146+
!insertmacro MUI_LANGDLL_DISPLAY
147+
!endif
148+
149+
!ifdef BUILD_UNINSTALLER
150+
WriteUninstaller "${UNINSTALLER_OUT_FILE}"
151+
!insertmacro quitSuccess
152+
!else
153+
!insertmacro check64BitAndSetRegView
154+
155+
!ifdef ONE_CLICK
156+
!insertmacro ALLOW_ONLY_ONE_INSTALLER_INSTANCE
157+
!else
158+
${IfNot} ${UAC_IsInnerInstance}
159+
!insertmacro ALLOW_ONLY_ONE_INSTALLER_INSTANCE
160+
${EndIf}
161+
!endif
162+
163+
!insertmacro initMultiUser
164+
165+
!ifmacrodef customInit
166+
!insertmacro customInit
167+
!endif
168+
169+
!ifmacrodef addLicenseFiles
170+
InitPluginsDir
171+
!insertmacro addLicenseFiles
172+
!endif
173+
!endif
174+
FunctionEnd
175+
176+
!ifndef BUILD_UNINSTALLER
177+
!include "installUtil.nsh"
178+
!endif
179+
180+
Section "install"
181+
!ifndef BUILD_UNINSTALLER
182+
# If we're running a silent upgrade of a per-machine installation, elevate so extracting the new app will succeed.
183+
# For a non-silent install, the elevation will be triggered when the install mode is selected in the UI,
184+
# but that won't be executed when silent.
185+
!ifndef INSTALL_MODE_PER_ALL_USERS
186+
!ifndef ONE_CLICK
187+
${if} $hasPerMachineInstallation == "1" # set in onInit by initMultiUser
188+
${andIf} ${Silent}
189+
${ifNot} ${UAC_IsAdmin}
190+
ShowWindow $HWNDPARENT ${SW_HIDE}
191+
!insertmacro UAC_RunElevated
192+
${Switch} $0
193+
${Case} 0
194+
${Break}
195+
${Case} 1223 ;user aborted
196+
${Break}
197+
${Default}
198+
MessageBox mb_IconStop|mb_TopMost|mb_SetForeground "Unable to elevate, error $0"
199+
${Break}
200+
${EndSwitch}
201+
Quit
202+
${else}
203+
!insertmacro setInstallModePerAllUsers
204+
${endIf}
205+
${endIf}
206+
!endif
207+
!endif
208+
!include "installSection.nsh"
209+
!endif
210+
SectionEnd
211+
212+
!ifdef BUILD_UNINSTALLER
213+
!include "uninstaller.nsh"
214+
!endif

dist/builder-effective-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ compression: maximum
1111
asar: true
1212
asarUnpack: '**\*.{node,dll}'
1313
productName: TxCRCPME
14-
artifactName: TxCRCPMEv${version}.exe
1514
mac:
16-
category: public.app-category.productivity
1715
target:
18-
- zip
16+
- dmg
17+
category: public.app-category.utilities
1918
win:
2019
target:
2120
- portable
2221
- nsis
22+
artifactName: TxCRCPMEv${version}.exe
2323
icon: build/logo.png
2424
nsis:
2525
artifactName: TxCRCPMEv${version}-Setup.exe

dist/latest.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
version: 1.0.0
22
files:
3-
- url: TxCRCPME-Setup-1.0.0.exe
4-
sha512: LNqVBeEGNNf0JBimoRk9QkNXNzHjNFGpG+JYraQ3KdAxSGCX+YgjVnn0/erqPJhGdgMjT9CpnoM9M6PfWH4ZMw==
5-
size: 102032459
6-
path: TxCRCPME-Setup-1.0.0.exe
7-
sha512: LNqVBeEGNNf0JBimoRk9QkNXNzHjNFGpG+JYraQ3KdAxSGCX+YgjVnn0/erqPJhGdgMjT9CpnoM9M6PfWH4ZMw==
8-
releaseDate: '2024-11-22T03:58:05.957Z'
3+
- url: TxCRCPMEv1.0.0-Setup.exe
4+
sha512: Q41B8tGkJFXSAmeaBnr6rNQsAqm1cV7eQGWL8hSW9VrGhVbkQMQpOKzx+snG9z7xE3pnf78noJJ6IsLlpLbyGA==
5+
size: 107903900
6+
path: TxCRCPMEv1.0.0-Setup.exe
7+
sha512: Q41B8tGkJFXSAmeaBnr6rNQsAqm1cV7eQGWL8hSW9VrGhVbkQMQpOKzx+snG9z7xE3pnf78noJJ6IsLlpLbyGA==
8+
releaseDate: '2024-12-05T20:42:09.429Z'

0 commit comments

Comments
 (0)