-
-
Notifications
You must be signed in to change notification settings - Fork 5
171 lines (171 loc) · 6.9 KB
/
build-nightly.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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
name: Nightly
on:
push:
branches:
- develop
jobs:
# buildAvaloniaLinuxX64:
# name: Build Avalonia Linux X64
# runs-on: windows-2022
# steps:
# - name: Checkout
# uses: actions/checkout@v4
# - name: Prepare Env
# uses: microsoft/setup-msbuild@v2
# - name: Build
# env:
# DOTNET_NOLOGO: true
# run: |
# dotnet publish LRReader.Avalonia.Desktop\LRReader.Avalonia.Desktop.csproj -nologo -v:minimal /p:Configuration=Release /p:PublishProfile=linux-x64
# - name: Upload Artifacts
# uses: actions/upload-artifact@v4
# with:
# name: LRReader.Avalonia.Desktop.Linux-X64
# path: LRReader.Avalonia.Desktop/publish/linux-x64
# buildAvaloniaMacOSX64:
# name: Build Avalonia macOS X64
# runs-on: windows-2022
# steps:
# - name: Checkout
# uses: actions/checkout@v4
# - name: Prepare Env
# uses: microsoft/setup-msbuild@v2
# - name: Build
# env:
# DOTNET_NOLOGO: true
# run: |
# dotnet publish LRReader.Avalonia.Desktop\LRReader.Avalonia.Desktop.csproj -nologo -v:minimal /p:Configuration=Release /p:PublishProfile=macos-x64
# - name: Upload Artifacts
# uses: actions/upload-artifact@v4
# with:
# name: LRReader.Avalonia.Desktop.macOS-X64
# path: LRReader.Avalonia.Desktop/publish/macos-x64
# buildAvaloniaWinX64:
# name: Build Avalonia Windows X64
# runs-on: windows-2022
# steps:
# - name: Checkout
# uses: actions/checkout@v4
# - name: Prepare Env
# uses: microsoft/setup-msbuild@v2
# - name: Build
# env:
# DOTNET_NOLOGO: true
# run: |
# dotnet publish LRReader.Avalonia.Desktop\LRReader.Avalonia.Desktop.csproj -nologo -v:minimal /p:Configuration=Release /p:PublishProfile=win-x64
# - name: Upload Artifacts
# uses: actions/upload-artifact@v4
# with:
# name: LRReader.Avalonia.Desktop.Win-X64
# path: LRReader.Avalonia.Desktop/publish/win-x64
buildUWP:
name: Sideload
runs-on: windows-2022
permissions:
packages: read
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
- name: Prepare Env
uses: microsoft/setup-msbuild@v2
- name: Auth nuget registry
run: dotnet nuget update source --username ${{ github.actor }} --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text guerra24
- name: Prepare nuget cache
uses: actions/cache@v4
with:
path: ~/.nuget/packages
key: nuget-uwp-${{ hashFiles('LRReader.Shared/packages.lock.json', 'LRReader.UWP/packages.lock.json') }}
restore-keys: |
nuget-uwp-
- name: Build
env:
CERT_PASSWORD: ${{ secrets.CERT_PASSWORD }}
CERT_GPG: ${{ secrets.CERT_GPG }}
CERT_BASE64: ${{ secrets.CERT_BASE64 }}
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
run: |
Move-Item -Path "./Util/Package.appxmanifest" -Destination "$(Get-Location)/LRReader.UWP/Package.appxmanifest" -Force
[IO.File]::WriteAllBytes("./Cert.pfx.gpg", [Convert]::FromBase64String("${env:CERT_BASE64}"))
& "C:\Program Files\Git\usr\bin\gpg.exe" --quiet --batch --yes --decrypt --passphrase="${env:CERT_GPG}" --output Cert.pfx Cert.pfx.gpg
Invoke-Expression "./Util/Version.ps1"
Invoke-Expression "./Util/ConfigureAppCenter.ps1"
MSBuild LRReader.UWP\LRReader.UWP.csproj -nologo -r -v:minimal /p:RestoreLockedMode=true /p:Nightly=true /p:Configuration=Release /p:UapAppxPackageBuildMode="SideloadOnly" /p:AppxPackageSigningEnabled=true /p:PackageCertificateThumbprint="" /p:PackageCertificateKeyFile="..\Cert.pfx" /p:PackageCertificatePassword="${env:CERT_PASSWORD}" /p:GenerateAppInstallerFile=True /p:AppInstallerUri="https://s3.guerra24.net/projects/lrr/nightly"
Remove-Item -Path "./Cert.pfx.gpg","./Cert.pfx"
Invoke-Expression "./Util/CleanInstaller.ps1"
- name: Prepare for upload
run: ./Util/PrepareForUpload.ps1
- name: Setup sentry-cli
uses: matbour/setup-sentry-cli@v2
with:
version: 2.39.1
token: ${{ secrets.SENTRY_TOKEN }}
organization: ${{ secrets.SENTRY_ORG }}
project: ${{ secrets.SENTRY_PROJECT }}
- name: Upload Symbols
run: |
Set-Location "./LRReader.UWP/AppPackages/LRReader.UWP"
Get-ChildItem *.appxsym -File | Rename-Item -NewName { [IO.Path]::ChangeExtension($_.name, "zip") }
foreach ($file in $(Get-ChildItem *.zip -File)) { sentry-cli debug-files upload --wait $file }
Remove-Item $(Get-ChildItem *.zip -File)
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
- name: Upload to S3
env:
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
run: aws s3 sync LRReader.UWP/AppPackages s3://${env:AWS_S3_BUCKET}/projects/lrr/nightly --no-progress --acl public-read --follow-symlinks --delete
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: LRReader.UWP
path: LRReader.UWP/AppPackages
buildInstaller:
name: Installer
runs-on: windows-2022
permissions:
packages: read
strategy:
matrix:
arch: [x64, ARM64]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Prepare Env
uses: microsoft/setup-msbuild@v2
- name: Auth nuget registry
run: dotnet nuget update source --username ${{ github.actor }} --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text guerra24
- name: Prepare nuget cache
uses: actions/cache@v4
with:
path: ~/.nuget/packages
key: nuget-installer-${{ hashFiles('LRReader.UWP.Installer/packages.lock.json') }}
restore-keys: |
nuget-installer-
- name: Build
env:
APP_VERSION: Nightly
run: |
Invoke-Expression "./Util/ConfigureInstaller.ps1"
MSBuild LRReader.UWP.Installer\LRReader.UWP.Installer.csproj -nologo -r -v:minimal /p:RestoreLockedMode=true /p:Configuration=Release /p:Platform=${{ matrix.arch }}
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: Installer-${{ matrix.arch }}
path: LRReader.UWP.Installer/bin/${{ matrix.arch }}/Release/net472/LRReader.UWP.Installer.exe
purgeUWPCache:
name: Purge UWP Nightly cache
needs: buildUWP
runs-on: ubuntu-20.04
steps:
- name: Purge cache
uses: jakejarvis/cloudflare-purge-action@master
env:
CLOUDFLARE_ZONE: ${{ secrets.CLOUDFLARE_ZONE }}
CLOUDFLARE_TOKEN: ${{ secrets.CLOUDFLARE_TOKEN }}
PURGE_URLS: '["https://s3.guerra24.net/projects/lrr/nightly/index.html", "https://s3.guerra24.net/projects/lrr/nightly/LRReader.UWP.appinstaller"]'