-
Notifications
You must be signed in to change notification settings - Fork 187
83 lines (69 loc) · 2.85 KB
/
release.yml
File metadata and controls
83 lines (69 loc) · 2.85 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
name: Release
on:
push:
tags:
- 'v*'
permissions:
contents: write
jobs:
release:
runs-on: windows-latest
name: Build and Release ${{ github.ref_name }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 # Required for GitVersion to compute version from tags
- name: Install .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: 10.0.x
- name: Install InnoSetup
run: choco install innosetup --no-progress -y
- name: Build and Package
run: ./build.ps1 --target Clean Pack --configuration Release
- name: Install nuget-license tool
run: dotnet tool install --global nuget-license
- name: Update usedComponents.json
shell: pwsh
run: |
# Generate updated component list (packages already restored by build)
$output = nuget-license -i src/LogExpert.sln -o JsonPretty
Set-Content -Path "src/Solution Items/usedComponents.json" -Value $output -Encoding UTF8
- name: Commit generated files to Development
shell: pwsh
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
# Save generated files before switching branches (checkout would overwrite them)
$tempComponents = [System.IO.Path]::GetTempFileName()
$tempHashes = [System.IO.Path]::GetTempFileName()
Copy-Item "src/Solution Items/usedComponents.json" $tempComponents
Copy-Item "src/PluginRegistry/PluginHashGenerator.Generated.cs" $tempHashes
# Switch to Development and apply both updates
git fetch origin Development
git checkout Development
Copy-Item $tempComponents "src/Solution Items/usedComponents.json"
Copy-Item $tempHashes "src/PluginRegistry/PluginHashGenerator.Generated.cs"
git add "src/Solution Items/usedComponents.json"
git add "src/PluginRegistry/PluginHashGenerator.Generated.cs"
git diff --staged --quiet
if ($LASTEXITCODE -ne 0) {
git commit -m "chore: update plugin hashes and usedComponents.json for ${{ github.ref_name }} [skip ci]"
git push origin Development
} else {
Write-Host "No changes to commit"
}
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
files: |
bin/LogExpert-Setup-*.exe
bin/LogExpert.*.zip
bin/LogExpert.ColumnizerLib.*.nupkg
bin/SftpFileSystem.x64.*.zip
bin/SftpFileSystem.x86.*.zip
bin/chocolatey/logexpert.*.nupkg
generate_release_notes: true
draft: false
prerelease: ${{ contains(github.ref_name, '-') }}