Update build workflow and improve Tauri sidecar handling
Enhanced the GitHub Actions workflow for Windows builds, including dynamic sidecar binary handling and updated Node version specification. Upgraded stream-gears crate to version 1.0.0. Refactored Tauri app to improve sidecar process management, including encoding handling, process shutdown, and automatic startup/shutdown integration. Added readme field to pyproject.toml and redirected frontend to localhost in App.tsx.
This commit is contained in:
1 parent
67d041a217
commit
380d1d4b25
6 files changed
+122
-48
No files matched your search
@@ -7,12 +7,14 @@ on:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
permissions:
|
||||
contents: write
|
||||
runs-on: 'windows-latest'
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 20
|
||||
node-version: lts/*
|
||||
- name: Build frontend
|
||||
run: |
|
||||
npm install
|
||||
@@ -22,23 +24,54 @@ jobs:
|
||||
python-version: '3.x'
|
||||
- uses: PyO3/maturin-action@v1
|
||||
with:
|
||||
command: develop
|
||||
command: build
|
||||
args: --release
|
||||
- name: Build
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install target/wheels/*.whl
|
||||
pip install pyinstaller
|
||||
pyinstaller biliup.spec
|
||||
- name: Rename and move sidecar
|
||||
run: |
|
||||
# 动态获取rustc的target triple
|
||||
$TARGET_TRIPLE = rustc -Vv | Select-String "host:" | ForEach-Object {$_.Line.split(" ")[1]}
|
||||
echo "Target Triple: $TARGET_TRIPLE"
|
||||
|
||||
# 创建目标目录 (如果不存在)
|
||||
New-Item -ItemType Directory -Force -Path tauri-app/src-tauri/binaries
|
||||
|
||||
# 假设的原始路径和新路径
|
||||
$SOURCE_PATH = "dist/biliup.exe"
|
||||
$DESTINATION_PATH = "tauri-app/src-tauri/binaries/biliup-$TARGET_TRIPLE.exe"
|
||||
|
||||
echo "Moving $SOURCE_PATH to $DESTINATION_PATH"
|
||||
|
||||
# 使用PowerShell的Move-Item命令进行移动和重命名
|
||||
Move-Item -Path $SOURCE_PATH -Destination $DESTINATION_PATH
|
||||
shell: pwsh
|
||||
# Optionally verify that it works (provided that it does not need user interaction)
|
||||
#- run: ./dist/your-code/your-code
|
||||
- uses: actions/upload-artifact@v4
|
||||
- name: install Rust stable
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
- name: install frontend dependencies
|
||||
run: |
|
||||
cd tauri-app
|
||||
npm install
|
||||
- uses: tauri-apps/tauri-action@v0
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
path: dist/*
|
||||
- name: Upload binaries to release
|
||||
uses: svenstaro/upload-release-action@v2
|
||||
with:
|
||||
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
# file: target/release/${{ matrix.artifact_name }}
|
||||
file: dist/biliup.exe
|
||||
asset_name: biliup_$tag.exe
|
||||
tag: ${{ github.ref }}
|
||||
tagName: ${{ github.ref }} # the action automatically replaces \_\_VERSION\_\_ with the app version.
|
||||
|
||||
# - uses: actions/upload-artifact@v4
|
||||
# with:
|
||||
# path: dist/*
|
||||
# - name: Upload binaries to release
|
||||
# uses: svenstaro/upload-release-action@v2
|
||||
# with:
|
||||
# repo_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
## file: target/release/${{ matrix.artifact_name }}
|
||||
# file: dist/biliup.exe
|
||||
# asset_name: biliup_$tag.exe
|
||||
# tag: ${{ github.ref }}
|
||||
Reference in new issue
Block a user