feat: separate pack & publish action.
(cherry picked from commit 0f88c9d28d0b35ecb30b632ef63c41a453f46b23)
This commit is contained in:
parent
1813952747
commit
71e84bfb30
36
.github/workflows/pack.yml
vendored
36
.github/workflows/pack.yml
vendored
@ -1,4 +1,4 @@
|
|||||||
name: Pack
|
name: Pack Nuget
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
@ -7,8 +7,8 @@ on:
|
|||||||
branches: [ "action/pack" ]
|
branches: [ "action/pack" ]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
nuget_desktop:
|
nuget:
|
||||||
runs-on: windows-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4.1.1
|
uses: actions/checkout@v4.1.1
|
||||||
@ -25,34 +25,8 @@ jobs:
|
|||||||
- name: Nuget Semi.Avalonia.TreeDataGrid
|
- name: Nuget Semi.Avalonia.TreeDataGrid
|
||||||
run: dotnet pack ./src/Semi.Avalonia.TreeDataGrid -o ./nugets
|
run: dotnet pack ./src/Semi.Avalonia.TreeDataGrid -o ./nugets
|
||||||
|
|
||||||
- name: Desktop
|
|
||||||
run: dotnet publish ./demo/Semi.Avalonia.Demo.Desktop -r win-x64 -c Release /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true --self-contained true
|
|
||||||
|
|
||||||
- name: Upload a Build Artifact
|
- name: Upload a Build Artifact
|
||||||
uses: actions/upload-artifact@v4.3.1
|
uses: actions/upload-artifact@v4.3.1
|
||||||
with:
|
with:
|
||||||
name: nuget_desktop
|
name: nugets
|
||||||
path: |
|
path: ./nugets
|
||||||
./nugets
|
|
||||||
./**/publish/*.exe
|
|
||||||
|
|
||||||
android:
|
|
||||||
runs-on: windows-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4.1.1
|
|
||||||
|
|
||||||
- name: CD Android
|
|
||||||
run: cd ./demo/Semi.Avalonia.Demo.Android
|
|
||||||
|
|
||||||
- name: Restore Dependencies
|
|
||||||
run: dotnet restore
|
|
||||||
|
|
||||||
- name: Build
|
|
||||||
run: dotnet publish ./demo/Semi.Avalonia.Demo.Android -c Release -f net8.0-android --no-restore
|
|
||||||
|
|
||||||
- name: Upload a Build Artifact
|
|
||||||
uses: actions/upload-artifact@v4.3.1
|
|
||||||
with:
|
|
||||||
name: android
|
|
||||||
path: ./**/publish/*Signed.apk
|
|
||||||
|
92
.github/workflows/publish.yml
vendored
Normal file
92
.github/workflows/publish.yml
vendored
Normal file
@ -0,0 +1,92 @@
|
|||||||
|
name: Publish Demo
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ "action/publish" ]
|
||||||
|
pull_request:
|
||||||
|
branches: [ "action/publish" ]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
windows:
|
||||||
|
runs-on: windows-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4.1.1
|
||||||
|
|
||||||
|
- name: Make upload directory
|
||||||
|
run: mkdir upload
|
||||||
|
|
||||||
|
- name: Publish win-x64
|
||||||
|
run: dotnet publish demo/Semi.Avalonia.Demo.Desktop -r win-x64 -c Release --sc /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true -o ./publish/win64
|
||||||
|
|
||||||
|
- name: Zip win-x64
|
||||||
|
run: |
|
||||||
|
$files = Get-ChildItem -Path ./publish/win64/* -Recurse -Exclude *.pdb
|
||||||
|
Compress-Archive -Path $files.FullName -DestinationPath ./upload/Semi.Avalonia.Demo.Desktop.win-x64.zip
|
||||||
|
|
||||||
|
- name: Enable Native AOT in .csproj
|
||||||
|
run: |
|
||||||
|
sed -i 's#<!--<PublishAot>true</PublishAot>-->#<PublishAot>true</PublishAot>#' demo/Semi.Avalonia.Demo.Desktop/Semi.Avalonia.Demo.Desktop.csproj
|
||||||
|
sed -i 's#<!--<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>-->#<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>#' demo/Semi.Avalonia.Demo.Desktop/Semi.Avalonia.Demo.Desktop.csproj
|
||||||
|
|
||||||
|
- name: Publish win-x64 AOT
|
||||||
|
run: dotnet publish demo/Semi.Avalonia.Demo.Desktop -r win-x64 -c Release -o ./publish/win64-aot
|
||||||
|
|
||||||
|
- name: Zip win-x64 AOT
|
||||||
|
run: |
|
||||||
|
$files = Get-ChildItem -Path ./publish/win64-aot/* -Recurse -Exclude *.pdb
|
||||||
|
Compress-Archive -Path $files.FullName -DestinationPath ./upload/Semi.Avalonia.Demo.Desktop.win-x64.NativeAOT.zip
|
||||||
|
|
||||||
|
- name: Upload a Build Artifact
|
||||||
|
uses: actions/upload-artifact@v4.3.1
|
||||||
|
with:
|
||||||
|
name: windows
|
||||||
|
path: ./upload
|
||||||
|
|
||||||
|
linux:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4.1.1
|
||||||
|
|
||||||
|
- name: Make upload directory
|
||||||
|
run: mkdir upload
|
||||||
|
|
||||||
|
- name: Publish linux-x64
|
||||||
|
run: dotnet publish demo/Semi.Avalonia.Demo.Desktop -r linux-x64 -c Release --sc /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true -o ./publish/linux64
|
||||||
|
|
||||||
|
- name: Zip linux-x64
|
||||||
|
run: zip -j -r ./upload/Semi.Avalonia.Demo.Desktop.linux-x64.zip ./publish/linux64 -x "*.pdb"
|
||||||
|
|
||||||
|
- name: Publish linux-x64 DRM
|
||||||
|
run: dotnet publish demo/Semi.Avalonia.Demo.Drm -r linux-x64 -c Release --sc /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true -o ./publish/drm
|
||||||
|
|
||||||
|
- name: Zip linux-x64 DRM
|
||||||
|
run: zip -j -r ./upload/Semi.Avalonia.Demo.Drm.linux-x64.zip ./publish/drm -x "*.pdb"
|
||||||
|
|
||||||
|
- name: Upload a Build Artifact
|
||||||
|
uses: actions/upload-artifact@v4.3.1
|
||||||
|
with:
|
||||||
|
name: linux
|
||||||
|
path: ./upload
|
||||||
|
|
||||||
|
android:
|
||||||
|
runs-on: windows-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4.1.1
|
||||||
|
|
||||||
|
- name: CD Android
|
||||||
|
run: cd ./demo/Semi.Avalonia.Demo.Android
|
||||||
|
|
||||||
|
- name: Restore Dependencies
|
||||||
|
run: dotnet restore
|
||||||
|
|
||||||
|
- name: Publish Android
|
||||||
|
run: dotnet publish demo/Semi.Avalonia.Demo.Android -c Release -f net8.0-android --no-restore -o ./publish
|
||||||
|
|
||||||
|
- name: Upload a Build Artifact
|
||||||
|
uses: actions/upload-artifact@v4.3.1
|
||||||
|
with:
|
||||||
|
name: android
|
||||||
|
path: ./publish/*Signed.apk
|
@ -5,10 +5,8 @@
|
|||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
<BuiltInComInteropSupport>true</BuiltInComInteropSupport>
|
<BuiltInComInteropSupport>true</BuiltInComInteropSupport>
|
||||||
<!-- Uncomment below to enable Native AOT compilation-->
|
<!-- Uncomment below to enable Native AOT compilation-->
|
||||||
<!--
|
<!--<PublishAot>true</PublishAot>-->
|
||||||
<PublishAot>true</PublishAot>
|
<!--<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>-->
|
||||||
<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>
|
|
||||||
-->
|
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0'))">
|
<PropertyGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0'))">
|
||||||
|
@ -5,10 +5,8 @@
|
|||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
<BuiltInComInteropSupport>true</BuiltInComInteropSupport>
|
<BuiltInComInteropSupport>true</BuiltInComInteropSupport>
|
||||||
<!-- Uncomment below to enable Native AOT compilation-->
|
<!-- Uncomment below to enable Native AOT compilation-->
|
||||||
<!--
|
<!--<PublishAot>true</PublishAot>-->
|
||||||
<PublishAot>true</PublishAot>
|
<!--<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>-->
|
||||||
<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>
|
|
||||||
-->
|
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0'))">
|
<PropertyGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0'))">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user