-
Notifications
You must be signed in to change notification settings - Fork 0
94 lines (91 loc) · 3.92 KB
/
Copy pathrelease.yml
File metadata and controls
94 lines (91 loc) · 3.92 KB
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
name: Release
on:
push:
tags: ['v*']
permissions:
contents: write
jobs:
release:
runs-on: windows-latest
timeout-minutes: 20
steps:
- name: Check out tagged source
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Install .NET SDK
uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
with:
global-json-file: global.json
- name: Verify tag matches package version
shell: pwsh
env:
RELEASE_TAG: ${{ github.ref_name }}
run: |
$project = [xml](Get-Content -LiteralPath Directory.Build.props -Raw)
$version = $project.SelectSingleNode('/Project/PropertyGroup/VersionPrefix').InnerText
if ($env:RELEASE_TAG -ne "v$version") {
throw "Tag '$env:RELEASE_TAG' does not match VersionPrefix '$version'."
}
- name: Build and verify release
shell: pwsh
run: .\build.ps1 -Configuration Release -BuildMsi $true
- name: Verify installed application lifecycle
shell: pwsh
env:
GH_TOKEN: ${{ github.token }}
run: ./tests/installer-smoke.ps1 -SetupPath (Get-ChildItem artifacts/win-x64/*-setup.exe).FullName
- name: Verify application tests with one available CPU
shell: pwsh
env:
DOTNET_PROCESSOR_COUNT: '1'
run: dotnet test tests/ResoDrive.App.Tests -c Release --no-build --no-restore
- name: Verify populated application window and process recovery
shell: pwsh
run: ./tests/process-smoke.ps1 -AppPath artifacts/win-x64/resodrive/resodrive.exe
- name: Preserve installer diagnostics
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a
with:
name: installer-smoke-logs
path: ${{ runner.temp }}/resodrive-installer-smoke/*.log
if-no-files-found: ignore
- name: Preserve release artifacts
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: resodrive-${{ github.ref_name }}
path: |
artifacts/win-x64/*.zip
artifacts/win-x64/*.zip.sha256
artifacts/win-x64/*.msi
artifacts/win-x64/*.msi.sha256
artifacts/win-x64/*.exe
artifacts/win-x64/*.exe.sha256
if-no-files-found: error
- name: Stage GitHub release for desktop acceptance
shell: pwsh
env:
GH_TOKEN: ${{ github.token }}
RELEASE_TAG: ${{ github.ref_name }}
run: |
$releaseDirectory = 'artifacts\win-x64'
$versionedSetup = Get-ChildItem -LiteralPath $releaseDirectory -File -Filter 'resodrive-win-x64-*-setup.exe'
if (@($versionedSetup).Count -ne 1) {
throw "Expected one versioned setup bundle, found $(@($versionedSetup).Count)."
}
$stableSetup = Join-Path $releaseDirectory 'ResoDrive-Setup.exe'
$stableChecksum = "$stableSetup.sha256"
Copy-Item -LiteralPath $versionedSetup.FullName -Destination $stableSetup
$hash = (Get-FileHash -LiteralPath $stableSetup -Algorithm SHA256).Hash.ToLowerInvariant()
Set-Content -LiteralPath $stableChecksum -Value "$hash ResoDrive-Setup.exe" -Encoding ascii
$assets = Get-ChildItem -LiteralPath $releaseDirectory -File |
Where-Object Name -Match '\.(zip|msi|exe)(\.sha256)?$' |
Sort-Object Name
if ($assets.Count -ne 8) {
throw "Expected eight release files, found $($assets.Count)."
}
gh release create $env:RELEASE_TAG $assets.FullName `
--draft --verify-tag --notes-file RELEASE_NOTES.md --title "ResoDrive $env:RELEASE_TAG"
if ($LASTEXITCODE -ne 0) {
throw "GitHub release creation failed with exit code $LASTEXITCODE."
}