-
Notifications
You must be signed in to change notification settings - Fork 0
102 lines (92 loc) · 3.86 KB
/
Copy pathrelease.yml
File metadata and controls
102 lines (92 loc) · 3.86 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
95
96
97
98
99
100
101
102
name: Release
# Triggered when a v* tag is pushed. Builds the UI DLL against the
# real strong-named ACT reference (extracted from ACTv3.zip on the
# runner), generates release notes from commits since the previous
# tag, then creates a DRAFT GitHub release with the DLL attached.
#
# The release stays a draft so the maintainer can review the
# auto-generated notes before clicking Publish. To publish:
#
# gh release edit vX.Y.Z --draft=false
on:
push:
tags: ['v*']
permissions:
contents: write
jobs:
release:
# windows-latest because the UI assembly targets net48 and
# references Advanced Combat Tracker.exe — neither builds on
# Linux without Mono.
runs-on: windows-latest
steps:
- uses: actions/checkout@v6
with:
# Full history so we can diff against the previous tag.
fetch-depth: 0
# ACT is strong-named, so a hand-rolled stub assembly can't
# produce a UI DLL that loads at runtime. Use the real
# ACTv3.zip from the upstream GitHub release instead — it
# contains the exe with the right name/version/public-key-token
# and weighs ~1.3MB.
- name: Fetch ACT for build reference
shell: pwsh
run: |
$url = "https://github.com/EQAditu/AdvancedCombatTracker/releases/latest/download/ACTv3.zip"
Invoke-WebRequest -Uri $url -OutFile ACTv3.zip -UseBasicParsing
Expand-Archive -Path ACTv3.zip -DestinationPath C:\ACT -Force
if (-not (Test-Path "C:\ACT\Advanced Combat Tracker.exe")) {
throw "ACT exe not found in extracted zip"
}
"ACT_INSTALL_DIR=C:\ACT" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Setup .NET SDK
uses: actions/setup-dotnet@v5
with:
global-json-file: global.json
- name: Build UI assembly (Release)
run: dotnet build src/EQ2Lexicon.ACTPlugin.csproj -c Release
- name: Generate release notes
shell: pwsh
run: |
$tag = $env:GITHUB_REF -replace '^refs/tags/', ''
# Previous tag by creation date, excluding this one. Empty
# string if this is the first ever tag.
$prev = (git tag --sort=-creatordate | Where-Object { $_ -ne $tag } | Select-Object -First 1)
if ($prev) {
$range = "$prev..$tag"
$header = "## Changes since $prev"
} else {
$range = $tag
$header = "## All commits"
}
# %s = subject, %h = short hash. Skip merge commits.
$log = (git log --no-merges "--pretty=format:- %s (``%h``)" $range) -join "`n"
# Built as an array join rather than a here-string because
# PowerShell here-strings require the closing token at
# column 0, which conflicts with YAML's |-block-scalar
# indentation rules. Double-backticks `` produce a single
# literal backtick in the output (PowerShell escape).
$notes = @(
$header
""
$log
""
"## Install"
""
"Download ``EQ2Lexicon.ACTPlugin.dll`` from the assets below and place it in"
"``%APPDATA%\Advanced Combat Tracker\Plugins\``. In ACT: Options -> Plugins ->"
"Browse -> select the DLL -> Add/Enable Plugin."
) -join "`n"
$notes | Out-File -FilePath RELEASE_NOTES.md -Encoding utf8
Write-Host "Generated notes:"
Get-Content RELEASE_NOTES.md
- name: Create draft release with DLL attached
uses: softprops/action-gh-release@v3
with:
tag_name: ${{ github.ref_name }}
name: ${{ github.ref_name }}
body_path: RELEASE_NOTES.md
# Draft so the maintainer reviews notes before publishing.
draft: true
prerelease: false
files: src/bin/Release/net48/EQ2Lexicon.ACTPlugin.dll