forked from ClassIsland/ClassIsland
-
Notifications
You must be signed in to change notification settings - Fork 0
155 lines (133 loc) · 5.68 KB
/
build_release.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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
name: Build
on:
push:
jobs:
build_app:
runs-on: windows-latest # For a list of available runner types, refer to
# https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on
env:
Solution_Name: ClassIsland.sln # Replace with your solution name, i.e. MyWpfApp.sln.
# Test_Project_Path: your-test-project-path # Replace with the path to your test project, i.e. MyWpfApp.Tests\MyWpfApp.Tests.csproj.
Wap_Project_Directory: ClassIsland/ClassIsland # Replace with the Wap project directory relative to the solution, i.e. MyWpfApp.Package.
Wap_Project_Path: ClassIsland/ClassIsland/ClassIsland.csproj # Replace with the path to your Wap project, i.e. MyWpf.App.Package\MyWpfApp.Package.wapproj.
strategy:
matrix:
trim_assets: [true, false]
name: Build (AssetsTrimmed ${{ matrix.trim_assets }})
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: List files
run: ls
# Install the .NET Core workload
- name: Install .NET Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
# Add MSBuild to the PATH: https://github.com/microsoft/setup-msbuild
- name: Setup MSBuild.exe
uses: microsoft/[email protected]
- name: Build application
env:
trim_assets: ${{ matrix.trim_assets }}
run: |
ls
pwsh -ep Bypass -c ./tools/publish.ps1 $env:trim_assets
- name: Upload APP to artifacts
uses: actions/upload-artifact@v4
with:
name: out_app_assetsTrimmed_${{ matrix.trim_assets }}
path: ./out/*.zip
build_nupkg:
runs-on: windows-latest # For a list of available runner types, refer to
# https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on
env:
Solution_Name: ClassIsland.sln # Replace with your solution name, i.e. MyWpfApp.sln.
# Test_Project_Path: your-test-project-path # Replace with the path to your test project, i.e. MyWpfApp.Tests\MyWpfApp.Tests.csproj.
Wap_Project_Directory: ClassIsland/ClassIsland # Replace with the Wap project directory relative to the solution, i.e. MyWpfApp.Package.
Wap_Project_Path: ClassIsland/ClassIsland/ClassIsland.csproj # Replace with the path to your Wap project, i.e. MyWpf.App.Package\MyWpfApp.Package.wapproj.
name: Build Nuget Packages
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: List files
run: ls
# Install the .NET Core workload
- name: Install .NET Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
# Add MSBuild to the PATH: https://github.com/microsoft/setup-msbuild
- name: Setup MSBuild.exe
uses: microsoft/[email protected]
- name: Build Nuget packages
env:
is_release: ${{ startsWith(github.ref, 'refs/tags/') }}
run: |
ls
pwsh -ep Bypass -c ./tools/publish-nupkg.ps1 $env:is_release
- name: Upload Nuget packages to GitHub registry
if: ${{ github.event_name != 'pull_request' }}
env:
GHPKG_KEY: ${{ secrets.GHPKG_KEY }}
run: |
dotnet nuget add source --username HelloWRC --password $env:GHPKG_KEY --store-password-in-clear-text --name github "https://nuget.pkg.github.com/ClassIsland/index.json"
dotnet nuget push .\out\*.nupkg -k $env:GHPKG_KEY --source "github" --skip-duplicate
- name: Upload Nuget Packages to artifacts
if: ${{ !matrix.trim_assets }}
uses: actions/upload-artifact@v4
with:
name: out_nupkgs
path: ./out/*.nupkg
publish:
runs-on: windows-latest
if: ${{ startsWith(github.ref, 'refs/tags/') }}
needs: [build_app, build_nupkg]
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: ./out_artifacts
- name: Pre publish
run: |
pwsh -ep Bypass -c ./tools/pre-publish.ps1
# - name: Sentry Release
# uses: getsentry/[email protected]
# env:
# SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
# SENTRY_ORG: classisland
# SENTRY_PROJECT: classisland
# SENTRY_URL: ${{ vars.SENTRY_URL }}
# with:
# environment: production
- name: Upload APP to release
uses: ncipollo/release-action@v1
with:
artifacts: ./out/ClassIsland.zip,./out/*.zip
draft: true
bodyFile: ./out/checksums.md
token: ${{ secrets.GITHUB_TOKEN }}
- name: Upload Nuget packages to NuGet Gallery
if: ${{ github.event_name != 'pull_request' }}
env:
NUGET_KEY: ${{ secrets.NUGET_KEY }}
run: |
ls
cd out
dotnet nuget push *.nupkg -k $env:NUGET_KEY -s https://api.nuget.org/v3/index.json --skip-duplicate
- name: Upload to AppCenter
env:
APPCENTER_TOKEN: ${{ secrets.APPCENTER_TOKEN }}
run: |
$env:app_ver = (git describe --abbrev=0 --tags)
Write-Host "Uploading to AppCenter..." -ForegroundColor Cyan
pwsh -ep Bypass -c .\tools\pre-appcenter-upload.ps1
pwsh -ep Bypass -c .\tools\appcenter-upload.ps1 $env:APPCENTER_TOKEN $env:app_ver