-
-
Notifications
You must be signed in to change notification settings - Fork 3
86 lines (77 loc) · 3.04 KB
/
desktop-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
name: Build and create release
on:
push:
branches:
- release/desktop
jobs:
build-and-release:
runs-on: windows-latest
name: Build and release application
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
global-json-file: global.json
- name: Create application config
run: 'echo "$APPCONFIG" > WoWsShipBuilder.Desktop/Infrastructure/StaticConfiguration/ApplicationOptions.json'
shell: bash
env:
APPCONFIG: ${{secrets.SHIPBUILDER_APPCONFIG}}
- name: Restore dependencies
run: dotnet restore dirs.proj
- name: Build application
run: dotnet build dirs.proj --no-restore -c Release
- name: Store current application version
uses: actions/upload-artifact@v4
with:
name: buildInfo
path: WoWsShipBuilder.Desktop\buildInfo.txt
- name: Store current application version as environment variable
run: echo ("CURRENT_TAG=v" + (Get-Content -Path .\WoWsShipBuilder.Desktop\buildInfo.txt -First 1)) >> $env:GITHUB_ENV
- name: Test application
run: dotnet test dirs.proj --no-build -c Release --verbosity normal
- name: Extract certificate
run: |
$certB64 = '${{ secrets.WOWSSB_CERT }}'
[IO.File]::WriteAllBytes(".\wowssb.pfx", [Convert]::FromBase64String([char[]]$certB64))
- name: Create Velopack Release
run: |
dotnet tool install -g vpk
vpk download github -o releases --repoUrl ${{ github.server_url }}/${{ github.repository }}
installer\BuildVelopackRelease.ps1 -skipBuild -signingCert wowssb.pfx -signingPassword '${{ secrets.WOWSSB_CERT_KEY }}'
vpk upload github -o releases --repoUrl ${{ github.server_url }}/${{ github.repository }} --publish --releaseName ${{ env.CURRENT_TAG }} --tag ${{ env.CURRENT_TAG }} --token ${{ secrets.GITHUB_TOKEN }}
shell: pwsh
- name: Cleanup certificate
run: Remove-Item .\wowssb.pfx
- name: Release
uses: ncipollo/release-action@v1
with:
allowUpdates: true
bodyFile: ReleaseNotes.md
tag: ${{ env.CURRENT_TAG }}
token: ${{ secrets.GITHUB_TOKEN }}
sentry-notify:
runs-on: ubuntu-latest
name: Create release on sentry
needs: build-and-release
steps:
- uses: actions/checkout@v4
- name: Download version info
uses: actions/download-artifact@v3
with:
name: buildInfo
path: buildInfo
- name: Process release version
run: echo "RELEASE_VERSION=$(head -n 1 buildInfo/buildInfo.txt)" >> $GITHUB_ENV
- name: Create Sentry release
uses: getsentry/action-release@v1
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_RELEASE_AUTH }}
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
with:
environment: production
version: ${{ env.RELEASE_VERSION }}