-
Notifications
You must be signed in to change notification settings - Fork 0
89 lines (75 loc) · 2.76 KB
/
release.yml
File metadata and controls
89 lines (75 loc) · 2.76 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
name: release
on:
push:
tags:
- "v*"
workflow_dispatch:
inputs:
version:
description: "Release version (example: v1.2.0). Optional for manual runs."
required: false
type: string
permissions:
contents: write
jobs:
build-release:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: "9.0.x"
- name: Determine release version
id: vars
shell: pwsh
run: |
$version = "${{ github.ref_name }}"
if ("${{ github.event_name }}" -eq "workflow_dispatch" -and -not [string]::IsNullOrWhiteSpace("${{ inputs.version }}")) {
$version = "${{ inputs.version }}"
}
if ([string]::IsNullOrWhiteSpace($version)) {
throw "Release version could not be determined."
}
"version=$version" | Out-File -FilePath $env:GITHUB_OUTPUT -Append -Encoding utf8
- name: Verify bundled BasicUtilities
shell: pwsh
run: |
if (-not (Test-Path "lib/BasicUtilities.dll")) {
throw "Missing required dependency: lib/BasicUtilities.dll"
}
- name: Build and test
shell: pwsh
run: ./scripts/release/build.ps1 -Configuration Release
- name: Publish binaries
shell: pwsh
run: ./scripts/release/publish.ps1 -Runtime win-x64 -Configuration Release -OutputRoot artifacts/publish
- name: Package release
shell: pwsh
run: ./scripts/release/package.ps1 -Runtime win-x64 -Version "${{ steps.vars.outputs.version }}" -Repository "${{ github.repository }}" -PublishRoot artifacts/publish -OutputRoot artifacts/release
- name: Setup WiX
shell: pwsh
run: |
dotnet tool install --global wix
"$env:USERPROFILE\\.dotnet\\tools" | Out-File -FilePath $env:GITHUB_PATH -Append -Encoding utf8
- name: Build MSI installer
shell: pwsh
run: ./scripts/release/msi.ps1 -Runtime win-x64 -Version "${{ steps.vars.outputs.version }}" -PublishRoot artifacts/publish -OutputRoot artifacts/release
- name: Upload workflow artifacts
uses: actions/upload-artifact@v4
with:
name: release-win-x64-${{ steps.vars.outputs.version }}
path: |
artifacts/release/*.zip
artifacts/release/*.txt
artifacts/release/*.msi
retention-days: 30
- name: Attach files to GitHub release
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v2
with:
files: |
artifacts/release/*.zip
artifacts/release/*.txt
artifacts/release/*.msi