feat: 在每夜构建中使用每夜构建版本的 zju-connect

This commit is contained in:
Chenx Dust
2026-05-24 18:17:42 +08:00
parent 67ef51663d
commit 6501405d1e
4 changed files with 27 additions and 13 deletions

View File

@@ -62,7 +62,7 @@ jobs:
- name: Download and copy files
shell: pwsh
run: |
.\scripts\deploy-windows.ps1 -TargetName "${{ env.TARGET_NAME }}" -DisplayName "${{ env.DISPLAY_NAME }}" -BuildDir "build" -Architecture "amd64"
.\scripts\deploy-windows.ps1 -TargetName "${{ env.TARGET_NAME }}" -DisplayName "${{ env.DISPLAY_NAME }}" -BuildDir "build" -Architecture "amd64" -Nightly ${{ inputs.nightly || github.event_name != 'release' }}
Compress-Archive -Path "${{ env.DISPLAY_NAME }}" -DestinationPath ${{ env.ARCHIVE_NAME }}.zip
- name: Upload artifact
@@ -110,7 +110,7 @@ jobs:
- name: Download and copy files
shell: pwsh
run: |
.\scripts\deploy-windows.ps1 -TargetName "${{ env.TARGET_NAME }}" -DisplayName "${{ env.DISPLAY_NAME }}" -BuildDir "build" -Architecture "arm64"
.\scripts\deploy-windows.ps1 -TargetName "${{ env.TARGET_NAME }}" -DisplayName "${{ env.DISPLAY_NAME }}" -BuildDir "build" -Architecture "arm64" -Nightly ${{ inputs.nightly || github.event_name != 'release' }}
Compress-Archive -Path "${{ env.DISPLAY_NAME }}" -DestinationPath ${{ env.ARCHIVE_NAME }}.zip
- name: Upload artifact
@@ -156,7 +156,7 @@ jobs:
- name: Download and copy files
run: |
./scripts/deploy-macos.sh "${{ env.TARGET_NAME }}" "build" "x86_64"
./scripts/deploy-macos.sh "${{ env.TARGET_NAME }}" "build" "x86_64" "${{ inputs.nightly || github.event_name != 'release' }}"
- name: Import macOS signing certificate
if: github.event_name == 'release' || github.event_name == 'workflow_dispatch'
@@ -261,7 +261,7 @@ jobs:
- name: Download and copy files
run: |
./scripts/deploy-macos.sh "${{ env.TARGET_NAME }}" "build" "arm64"
./scripts/deploy-macos.sh "${{ env.TARGET_NAME }}" "build" "arm64" "${{ inputs.nightly || github.event_name != 'release' }}"
- name: Import macOS signing certificate
if: github.event_name == 'release' || github.event_name == 'workflow_dispatch'
@@ -366,7 +366,7 @@ jobs:
- name: Download and copy files
run: |
./scripts/deploy-linux.sh "${{ env.TARGET_NAME }}" "${{ env.DISPLAY_NAME }}" "build" "x86_64"
./scripts/deploy-linux.sh "${{ env.TARGET_NAME }}" "${{ env.DISPLAY_NAME }}" "build" "x86_64" "${{ inputs.nightly || github.event_name != 'release' }}"
mv *.AppImage ${{ env.ARCHIVE_NAME }}.AppImage
- name: Upload artifact
@@ -417,7 +417,7 @@ jobs:
- name: Download and copy files
run: |
./scripts/deploy-linux.sh "${{ env.TARGET_NAME }}" "${{ env.DISPLAY_NAME }}" "build" "arm64"
./scripts/deploy-linux.sh "${{ env.TARGET_NAME }}" "${{ env.DISPLAY_NAME }}" "build" "arm64" "${{ inputs.nightly || github.event_name != 'release' }}"
mv *.AppImage ${{ env.ARCHIVE_NAME }}.AppImage
- name: Upload artifact

View File

@@ -1,6 +1,6 @@
#!/bin/bash
# Linux deployment script
# Usage: ./scripts/deploy-linux.sh "EZ4Connect" "EZ4Connect" "build" "x86_64"
# Usage: ./scripts/deploy-linux.sh "EZ4Connect" "EZ4Connect" "build" "x86_64" "false"
set -euo pipefail
@@ -8,6 +8,7 @@ TARGET_NAME="${1:-EZ4Connect}"
DISPLAY_NAME="${2:-EZ4Connect}"
BUILD_DIR="${3:-build}"
ARCH="${4:-x86_64}"
NIGHTLY="${5:-false}"
# Determine AppImage tool architecture
if [ "$ARCH" = "x86_64" ]; then
@@ -48,7 +49,12 @@ if [ "$ARCH" = "x86_64" ]; then
ZJU_ARCH="amd64"
fi
wget -O "zju-connect-linux-$ZJU_ARCH.zip" "https://github.com/Mythologyli/zju-connect/releases/latest/download/zju-connect-linux-$ZJU_ARCH.zip"
ZJU_RELEASE_PATH="latest/download"
if [ "$NIGHTLY" = "true" ]; then
ZJU_RELEASE_PATH="download/nightly"
fi
wget -O "zju-connect-linux-$ZJU_ARCH.zip" "https://github.com/Mythologyli/zju-connect/releases/$ZJU_RELEASE_PATH/zju-connect-linux-$ZJU_ARCH.zip"
unzip -o "zju-connect-linux-$ZJU_ARCH.zip"
cp zju-connect AppDir/usr/bin/
rm "zju-connect-linux-$ZJU_ARCH.zip"

View File

@@ -1,12 +1,13 @@
#!/bin/bash
# macOS deployment script
# Usage: ./scripts/deploy-macos.sh "EZ4Connect" "build" "amd64"
# Usage: ./scripts/deploy-macos.sh "EZ4Connect" "build" "amd64" "false"
set -euo pipefail
TARGET_NAME="${1:-EZ4Connect}"
BUILD_DIR="${2:-build}"
ARCH="${3:-arm64}"
NIGHTLY="${4:-false}"
APP_PATH="$TARGET_NAME.app"
# Copy app bundle
@@ -18,7 +19,12 @@ if [ "$ARCH" = "x86_64" ]; then
ZJU_ARCH="amd64"
fi
curl -LO "https://github.com/Mythologyli/zju-connect/releases/latest/download/zju-connect-darwin-$ZJU_ARCH.zip"
ZJU_RELEASE_PATH="latest/download"
if [ "$NIGHTLY" = "true" ]; then
ZJU_RELEASE_PATH="download/nightly"
fi
curl -LO "https://github.com/Mythologyli/zju-connect/releases/$ZJU_RELEASE_PATH/zju-connect-darwin-$ZJU_ARCH.zip"
unzip -o "zju-connect-darwin-$ZJU_ARCH.zip"
rm "zju-connect-darwin-$ZJU_ARCH.zip"

View File

@@ -1,11 +1,12 @@
# Windows deployment script
# Usage: .\deploy-windows.ps1 -TargetName "EZ4Connect" -DisplayName "EZ4Connect" -BuildDir "build" -Architecture "amd64"
# Usage: .\deploy-windows.ps1 -TargetName "EZ4Connect" -DisplayName "EZ4Connect" -BuildDir "build" -Architecture "amd64" -Nightly "false"
param(
[string]$TargetName = "EZ4Connect",
[string]$DisplayName = "EZ4Connect",
[string]$BuildDir = "build",
[string]$Architecture = "amd64"
[string]$Architecture = "amd64",
[string]$Nightly = "false"
)
Import-Module -Name Microsoft.PowerShell.Utility
@@ -21,7 +22,8 @@ Copy-Item -Path "../$BuildDir/Release/$TargetName.exe" -Destination .
& windeployqt.exe "$TargetName.exe"
# Download and extract zju-connect
$ZjuUrl = "https://github.com/Mythologyli/zju-connect/releases/latest/download/zju-connect-windows-$Architecture.zip"
$ZjuReleasePath = if ($Nightly -eq "true") { "download/nightly" } else { "latest/download" }
$ZjuUrl = "https://github.com/Mythologyli/zju-connect/releases/$ZjuReleasePath/zju-connect-windows-$Architecture.zip"
$ZjuZipPath = "zju-connect-windows-$Architecture.zip"
Invoke-WebRequest -Uri $ZjuUrl -OutFile $ZjuZipPath
Expand-Archive -Path $ZjuZipPath -DestinationPath . -Force