Setup sentry #397
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"]' |