mirror of
https://github.com/wwiinnddyy/LanMountainDesktop.git
synced 2026-08-18 13:30:47 +08:00
feat.action工作流重构
This commit is contained in:
26
.github/workflows/build.yml
vendored
26
.github/workflows/build.yml
vendored
@@ -22,7 +22,7 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
configuration: [ Debug, Release ]
|
configuration: [ Debug, Release ]
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v7
|
uses: actions/checkout@v7
|
||||||
@@ -50,7 +50,7 @@ jobs:
|
|||||||
- name: Build
|
- name: Build
|
||||||
run: dotnet build ${{ env.Solution_Name }} --no-restore -c ${{ matrix.configuration }} -v minimal
|
run: dotnet build ${{ env.Solution_Name }} --no-restore -c ${{ matrix.configuration }} -v minimal
|
||||||
env:
|
env:
|
||||||
# Skip AirAppHost build to avoid recursive build issues
|
# AirAppHost 已在解决方案中独立构建;跳过主程序的嵌套 AirAppHost 构建目标
|
||||||
SkipAirAppHostBuild: true
|
SkipAirAppHostBuild: true
|
||||||
|
|
||||||
- name: Upload artifacts
|
- name: Upload artifacts
|
||||||
@@ -64,7 +64,7 @@ jobs:
|
|||||||
build-linux:
|
build-linux:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
name: Build_Linux
|
name: Build_Linux
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v7
|
uses: actions/checkout@v7
|
||||||
@@ -109,7 +109,7 @@ jobs:
|
|||||||
- name: Build
|
- name: Build
|
||||||
run: dotnet build ${{ env.Solution_Name }} --no-restore -c Release -v minimal
|
run: dotnet build ${{ env.Solution_Name }} --no-restore -c Release -v minimal
|
||||||
env:
|
env:
|
||||||
# Skip AirAppHost build to avoid recursive build issues
|
# AirAppHost 已在解决方案中独立构建;跳过主程序的嵌套 AirAppHost 构建目标
|
||||||
SkipAirAppHostBuild: true
|
SkipAirAppHostBuild: true
|
||||||
|
|
||||||
- name: Upload artifacts
|
- name: Upload artifacts
|
||||||
@@ -123,7 +123,7 @@ jobs:
|
|||||||
build-macos:
|
build-macos:
|
||||||
runs-on: macos-latest
|
runs-on: macos-latest
|
||||||
name: Build_macOS
|
name: Build_macOS
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v7
|
uses: actions/checkout@v7
|
||||||
@@ -154,7 +154,7 @@ jobs:
|
|||||||
- name: Build
|
- name: Build
|
||||||
run: dotnet build ${{ env.Solution_Name }} --no-restore -c Release -v minimal
|
run: dotnet build ${{ env.Solution_Name }} --no-restore -c Release -v minimal
|
||||||
env:
|
env:
|
||||||
# Skip AirAppHost build to avoid recursive build issues
|
# AirAppHost 已在解决方案中独立构建;跳过主程序的嵌套 AirAppHost 构建目标
|
||||||
SkipAirAppHostBuild: true
|
SkipAirAppHostBuild: true
|
||||||
|
|
||||||
- name: Upload artifacts
|
- name: Upload artifacts
|
||||||
@@ -168,7 +168,7 @@ jobs:
|
|||||||
build-android:
|
build-android:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
name: Build_Android
|
name: Build_Android
|
||||||
# Android head 尚未合入时允许跳过
|
# Android head 需要 Android workload,仅验证 mobile/LanMountainDesktop.Mobile.Android
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v7
|
uses: actions/checkout@v7
|
||||||
@@ -179,7 +179,7 @@ jobs:
|
|||||||
- name: Check Android head exists
|
- name: Check Android head exists
|
||||||
id: check
|
id: check
|
||||||
run: |
|
run: |
|
||||||
if [ -f "LanMountainDesktop.Mobile.Android/LanMountainDesktop.Mobile.Android.csproj" ]; then
|
if [ -f "mobile/LanMountainDesktop.Mobile.Android/LanMountainDesktop.Mobile.Android.csproj" ]; then
|
||||||
echo "exists=true" >> "$GITHUB_OUTPUT"
|
echo "exists=true" >> "$GITHUB_OUTPUT"
|
||||||
else
|
else
|
||||||
echo "exists=false" >> "$GITHUB_OUTPUT"
|
echo "exists=false" >> "$GITHUB_OUTPUT"
|
||||||
@@ -215,7 +215,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Build Android head
|
- name: Build Android head
|
||||||
if: steps.check.outputs.exists == 'true'
|
if: steps.check.outputs.exists == 'true'
|
||||||
run: dotnet build LanMountainDesktop.Mobile.Android/LanMountainDesktop.Mobile.Android.csproj -c Release -v minimal
|
run: dotnet build mobile/LanMountainDesktop.Mobile.Android/LanMountainDesktop.Mobile.Android.csproj -c Release -v minimal
|
||||||
|
|
||||||
- name: Upload artifacts
|
- name: Upload artifacts
|
||||||
if: steps.check.outputs.exists == 'true'
|
if: steps.check.outputs.exists == 'true'
|
||||||
@@ -223,7 +223,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
name: build-android
|
name: build-android
|
||||||
path: |
|
path: |
|
||||||
LanMountainDesktop.Mobile.Android/bin/Release/**/*.apk
|
mobile/LanMountainDesktop.Mobile.Android/bin/Release/**/*.apk
|
||||||
if-no-files-found: warn
|
if-no-files-found: warn
|
||||||
retention-days: 7
|
retention-days: 7
|
||||||
|
|
||||||
@@ -252,14 +252,14 @@ jobs:
|
|||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-nuget-
|
${{ runner.os }}-nuget-
|
||||||
|
|
||||||
- name: Pack SDK and template packages
|
- name: Pack AirApp SDK and template packages
|
||||||
shell: pwsh
|
shell: pwsh
|
||||||
run: .\scripts\Pack-PluginPackages.ps1 -Configuration Release -OutputPath .\artifacts\nuget
|
run: .\scripts\Pack-AirAppPackages.ps1 -Configuration Release -OutputPath .\artifacts\nuget
|
||||||
|
|
||||||
- name: Upload AirApp package artifacts
|
- name: Upload AirApp package artifacts
|
||||||
uses: actions/upload-artifact@v7
|
uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
name: plugin-packages
|
name: airapp-packages
|
||||||
path: artifacts/nuget/*.nupkg
|
path: artifacts/nuget/*.nupkg
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
retention-days: 14
|
retention-days: 14
|
||||||
|
|||||||
64
.github/workflows/release.yml
vendored
64
.github/workflows/release.yml
vendored
@@ -169,7 +169,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
$publishDir = "publish/windows-${{ matrix.arch }}"
|
$publishDir = "publish/windows-${{ matrix.arch }}"
|
||||||
|
|
||||||
dotnet publish LanMountainDesktop/LanMountainDesktop.csproj `
|
dotnet publish desktop/LanMountainDesktop/LanMountainDesktop.csproj `
|
||||||
-c Release `
|
-c Release `
|
||||||
-o ./$publishDir `
|
-o ./$publishDir `
|
||||||
--self-contained:false `
|
--self-contained:false `
|
||||||
@@ -269,7 +269,7 @@ jobs:
|
|||||||
$arch = "${{ matrix.arch }}"
|
$arch = "${{ matrix.arch }}"
|
||||||
$publishDir = "publish/windows-$arch"
|
$publishDir = "publish/windows-$arch"
|
||||||
|
|
||||||
./LanMountainDesktop/scripts/Optimize-PublishPayload.ps1 `
|
./desktop/LanMountainDesktop/scripts/Optimize-PublishPayload.ps1 `
|
||||||
-PublishDir $publishDir `
|
-PublishDir $publishDir `
|
||||||
-RuntimeIdentifier "win-$arch" `
|
-RuntimeIdentifier "win-$arch" `
|
||||||
-AssertClean
|
-AssertClean
|
||||||
@@ -310,7 +310,7 @@ jobs:
|
|||||||
$suffix = "${{ matrix.suffix }}"
|
$suffix = "${{ matrix.suffix }}"
|
||||||
$publishDir = "publish/windows-$arch"
|
$publishDir = "publish/windows-$arch"
|
||||||
$outputDir = "build-installer"
|
$outputDir = "build-installer"
|
||||||
$installerScript = "LanMountainDesktop/installer/LanMountainDesktop.iss"
|
$installerScript = "desktop/LanMountainDesktop/installer/LanMountainDesktop.iss"
|
||||||
|
|
||||||
New-Item -ItemType Directory -Path $outputDir -Force | Out-Null
|
New-Item -ItemType Directory -Path $outputDir -Force | Out-Null
|
||||||
|
|
||||||
@@ -485,7 +485,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Publish Main App
|
- name: Publish Main App
|
||||||
run: |
|
run: |
|
||||||
dotnet publish LanMountainDesktop/LanMountainDesktop.csproj \
|
dotnet publish desktop/LanMountainDesktop/LanMountainDesktop.csproj \
|
||||||
-c Release \
|
-c Release \
|
||||||
-o ./publish/linux-x64-app \
|
-o ./publish/linux-x64-app \
|
||||||
--self-contained \
|
--self-contained \
|
||||||
@@ -521,6 +521,26 @@ jobs:
|
|||||||
-p:FileVersion=${{ needs.prepare.outputs.assembly_version }} \
|
-p:FileVersion=${{ needs.prepare.outputs.assembly_version }} \
|
||||||
-p:InformationalVersion=${{ needs.prepare.outputs.informational_version }}
|
-p:InformationalVersion=${{ needs.prepare.outputs.informational_version }}
|
||||||
|
|
||||||
|
- name: Publish AirAppHost
|
||||||
|
run: |
|
||||||
|
dotnet publish airapp/LanMountainDesktop.AirAppHost/LanMountainDesktop.AirAppHost.csproj \
|
||||||
|
-c Release \
|
||||||
|
-o ./publish/linux-x64-app \
|
||||||
|
--self-contained \
|
||||||
|
-r linux-x64 \
|
||||||
|
-p:SelfContained=true \
|
||||||
|
-p:PublishSingleFile=false \
|
||||||
|
-p:DebugType=none \
|
||||||
|
-p:DebugSymbols=false \
|
||||||
|
-p:PublishTrimmed=false \
|
||||||
|
-p:PublishReadyToRun=false \
|
||||||
|
-p:BuildingAirAppHost=true \
|
||||||
|
-p:SkipAirAppHostBuild=true \
|
||||||
|
-p:Version=${{ needs.prepare.outputs.version }} \
|
||||||
|
-p:AssemblyVersion=${{ needs.prepare.outputs.assembly_version }} \
|
||||||
|
-p:FileVersion=${{ needs.prepare.outputs.assembly_version }} \
|
||||||
|
-p:InformationalVersion=${{ needs.prepare.outputs.informational_version }}
|
||||||
|
|
||||||
- name: Restructure for Launcher
|
- name: Restructure for Launcher
|
||||||
run: |
|
run: |
|
||||||
version="${{ needs.prepare.outputs.version }}"
|
version="${{ needs.prepare.outputs.version }}"
|
||||||
@@ -581,8 +601,8 @@ jobs:
|
|||||||
package_name="LanMountainDesktop"
|
package_name="LanMountainDesktop"
|
||||||
package_version="${version}"
|
package_version="${version}"
|
||||||
arch="amd64"
|
arch="amd64"
|
||||||
desktop_template="LanMountainDesktop/packaging/linux/LanMountainDesktop.desktop"
|
desktop_template="desktop/LanMountainDesktop/packaging/linux/LanMountainDesktop.desktop"
|
||||||
icon_source="LanMountainDesktop/packaging/linux/lanmountaindesktop.png"
|
icon_source="desktop/LanMountainDesktop/packaging/linux/lanmountaindesktop.png"
|
||||||
|
|
||||||
mkdir -p "build-deb/DEBIAN"
|
mkdir -p "build-deb/DEBIAN"
|
||||||
mkdir -p "build-deb/usr/local/bin"
|
mkdir -p "build-deb/usr/local/bin"
|
||||||
@@ -669,7 +689,7 @@ jobs:
|
|||||||
# ll-builder mounts the project directory to /project inside the container
|
# ll-builder mounts the project directory to /project inside the container
|
||||||
mkdir -p "$linglongDir/publish"
|
mkdir -p "$linglongDir/publish"
|
||||||
cp -r "$publishDir"/* "$linglongDir/publish/"
|
cp -r "$publishDir"/* "$linglongDir/publish/"
|
||||||
cp -r LanMountainDesktop "$linglongDir/LanMountainDesktop"
|
cp -r desktop/LanMountainDesktop "$linglongDir/LanMountainDesktop"
|
||||||
|
|
||||||
# Build using ll-builder
|
# Build using ll-builder
|
||||||
cd "$linglongDir"
|
cd "$linglongDir"
|
||||||
@@ -743,8 +763,8 @@ jobs:
|
|||||||
EOF
|
EOF
|
||||||
|
|
||||||
# Copy icon
|
# Copy icon
|
||||||
cp LanMountainDesktop/packaging/linux/lanmountaindesktop.png "$appimageDir/AppDir/"
|
cp desktop/LanMountainDesktop/packaging/linux/lanmountaindesktop.png "$appimageDir/AppDir/"
|
||||||
cp LanMountainDesktop/packaging/linux/lanmountaindesktop.png \
|
cp desktop/LanMountainDesktop/packaging/linux/lanmountaindesktop.png \
|
||||||
"$appimageDir/AppDir/usr/share/icons/hicolor/256x256/apps/"
|
"$appimageDir/AppDir/usr/share/icons/hicolor/256x256/apps/"
|
||||||
|
|
||||||
# Create AppRun script
|
# Create AppRun script
|
||||||
@@ -848,7 +868,7 @@ jobs:
|
|||||||
EOF
|
EOF
|
||||||
|
|
||||||
# Copy icon
|
# Copy icon
|
||||||
cp LanMountainDesktop/packaging/linux/lanmountaindesktop.png \
|
cp desktop/LanMountainDesktop/packaging/linux/lanmountaindesktop.png \
|
||||||
"$flatpakDir/source/"
|
"$flatpakDir/source/"
|
||||||
|
|
||||||
# Build Flatpak
|
# Build Flatpak
|
||||||
@@ -968,7 +988,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Publish Main App
|
- name: Publish Main App
|
||||||
run: |
|
run: |
|
||||||
dotnet publish LanMountainDesktop/LanMountainDesktop.csproj \
|
dotnet publish desktop/LanMountainDesktop/LanMountainDesktop.csproj \
|
||||||
-c Release \
|
-c Release \
|
||||||
-o ./publish/macos-${{ matrix.arch }}-app \
|
-o ./publish/macos-${{ matrix.arch }}-app \
|
||||||
--self-contained:false \
|
--self-contained:false \
|
||||||
@@ -1004,12 +1024,32 @@ jobs:
|
|||||||
-p:FileVersion=${{ needs.prepare.outputs.assembly_version }} \
|
-p:FileVersion=${{ needs.prepare.outputs.assembly_version }} \
|
||||||
-p:InformationalVersion=${{ needs.prepare.outputs.informational_version }}
|
-p:InformationalVersion=${{ needs.prepare.outputs.informational_version }}
|
||||||
|
|
||||||
|
- name: Publish AirAppHost
|
||||||
|
run: |
|
||||||
|
dotnet publish airapp/LanMountainDesktop.AirAppHost/LanMountainDesktop.AirAppHost.csproj \
|
||||||
|
-c Release \
|
||||||
|
-o ./publish/macos-${{ matrix.arch }}-app \
|
||||||
|
--self-contained false \
|
||||||
|
-r osx-${{ matrix.arch }} \
|
||||||
|
-p:SelfContained=false \
|
||||||
|
-p:PublishSingleFile=false \
|
||||||
|
-p:DebugType=none \
|
||||||
|
-p:DebugSymbols=false \
|
||||||
|
-p:PublishTrimmed=false \
|
||||||
|
-p:PublishReadyToRun=false \
|
||||||
|
-p:BuildingAirAppHost=true \
|
||||||
|
-p:SkipAirAppHostBuild=true \
|
||||||
|
-p:Version=${{ needs.prepare.outputs.version }} \
|
||||||
|
-p:AssemblyVersion=${{ needs.prepare.outputs.assembly_version }} \
|
||||||
|
-p:FileVersion=${{ needs.prepare.outputs.assembly_version }} \
|
||||||
|
-p:InformationalVersion=${{ needs.prepare.outputs.informational_version }}
|
||||||
|
|
||||||
- name: Optimize and Guard macOS Payload
|
- name: Optimize and Guard macOS Payload
|
||||||
run: |
|
run: |
|
||||||
arch="${{ matrix.arch }}"
|
arch="${{ matrix.arch }}"
|
||||||
publishDir="publish/macos-${arch}-app"
|
publishDir="publish/macos-${arch}-app"
|
||||||
|
|
||||||
pwsh ./LanMountainDesktop/scripts/Optimize-PublishPayload.ps1 \
|
pwsh ./desktop/LanMountainDesktop/scripts/Optimize-PublishPayload.ps1 \
|
||||||
-PublishDir "$publishDir" \
|
-PublishDir "$publishDir" \
|
||||||
-RuntimeIdentifier "osx-${arch}" \
|
-RuntimeIdentifier "osx-${arch}" \
|
||||||
-AssertClean
|
-AssertClean
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ dotnet test LanMountainDesktop.slnx -c Debug
|
|||||||
AirApp 本地包生成:
|
AirApp 本地包生成:
|
||||||
|
|
||||||
```powershell
|
```powershell
|
||||||
./scripts/Pack-PluginPackages.ps1
|
./scripts/Pack-AirAppPackages.ps1
|
||||||
```
|
```
|
||||||
|
|
||||||
## 4. 改动前后必做检查
|
## 4. 改动前后必做检查
|
||||||
|
|||||||
Reference in New Issue
Block a user