Skip to content

misc: enable trimming for windows publish. #2

misc: enable trimming for windows publish.

misc: enable trimming for windows publish. #2

Workflow file for this run

name: Publish Demo
on:
push:
branches: [ "action/publish" ]
pull_request:
branches: [ "action/publish" ]
jobs:
windows:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/[email protected]
- name: Make upload directory
run: mkdir upload
- name: Publish win-x64
run: dotnet publish demo/Ursa.Demo.Desktop -r win-x64 -c Release --sc /p:PublishSingleFile=true /p:PublishTrimmed=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/Ursa.Demo.Desktop.win-x64.zip
- name: Enable Native AOT in .csproj
run: |
sed -i 's#<!--<PublishAot>true</PublishAot>-->#<PublishAot>true</PublishAot>#' demo/Ursa.Demo.Desktop/Ursa.Demo.Desktop.csproj
sed -i 's#<!--<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>-->#<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>#' demo/Ursa.Demo.Desktop/Ursa.Demo.Desktop.csproj
- name: Publish win-x64 AOT
run: dotnet publish demo/Ursa.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/Ursa.Demo.Desktop.win-x64.NativeAOT.zip
- name: Upload a Build Artifact
uses: actions/[email protected]
with:
name: windows
path: ./upload
linux:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/[email protected]
- name: Make upload directory
run: mkdir upload
- name: Publish linux-x64
run: dotnet publish demo/Ursa.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/Ursa.Demo.Desktop.linux-x64.zip ./publish/linux64 -x "*.pdb"
- name: Upload a Build Artifact
uses: actions/[email protected]
with:
name: linux
path: ./upload
android:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/[email protected]
- name: CD Android
run: cd ./demo/Ursa.Demo.Android
- name: Restore Dependencies
run: dotnet restore
- name: Publish Android
run: dotnet publish demo/Ursa.Demo.Android -c Release -f net8.0-android --no-restore -o ./publish
- name: Upload a Build Artifact
uses: actions/[email protected]
with:
name: android
path: ./publish/*Signed.apk