-
Notifications
You must be signed in to change notification settings - Fork 79
118 lines (97 loc) · 4.28 KB
/
publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
name: Publish Demo
on:
workflow_dispatch:
inputs:
platform:
description: 'Platform to publish'
required: true
default: 'all'
type: choice
options:
- 'windows'
- 'linux'
- 'android'
- 'all'
include_aot:
description: 'Include Windows AOT packaging'
required: true
default: true
type: boolean
include_drm:
description: 'Include Linux DRM packaging'
required: true
default: true
type: boolean
jobs:
windows:
if: ${{ github.event.inputs.platform == 'windows' || github.event.inputs.platform == 'all' }}
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
if: ${{ github.event.inputs.include_aot == true }}
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
if: ${{ github.event.inputs.include_aot == true }}
run: dotnet publish demo/Semi.Avalonia.Demo.Desktop -r win-x64 -c Release -o ./publish/win64-aot
- name: Zip win-x64 AOT
if: ${{ github.event.inputs.include_aot == true }}
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:
if: ${{ github.event.inputs.platform == 'linux' || github.event.inputs.platform == 'all' }}
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
if: ${{ github.event.inputs.include_drm == true }}
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
if: ${{ github.event.inputs.include_drm == true }}
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:
if: ${{ github.event.inputs.platform == 'android' || github.event.inputs.platform == 'all' }}
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 -p:RuntimeIdentifier=android-arm64
- name: Upload a Build Artifact
uses: actions/upload-artifact@v4.3.1
with:
name: android
path: ./publish/*Signed.apk