Skip to content

Commit 6b67669

Browse files
committed
Merge branch 'develop'
2 parents 2703593 + 846d549 commit 6b67669

File tree

4 files changed

+43
-99
lines changed

4 files changed

+43
-99
lines changed

.github/workflows/ci.yml

Lines changed: 42 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,18 +44,56 @@ jobs:
4444
- name: Run tests
4545
run: dotnet test --configuration $BUILD_CONFIG --no-restore --no-build --verbosity normal
4646

47+
- name: Get tag for current commit
48+
id: get_tag
49+
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')
50+
run: |
51+
TAG=$(git tag --points-at HEAD | grep -E '^[0-9]+\.[0-9]+\.[0-9]+$' | head -n 1)
52+
echo "tag=$TAG" >> $GITHUB_OUTPUT
53+
echo "Found tag: $TAG"
54+
4755
- name: Pack NuGet package
48-
if: startsWith(github.ref, 'refs/tags/')
56+
if: steps.get_tag.outputs.tag != ''
4957
run: dotnet pack $SOLUTION --configuration $BUILD_CONFIG --no-build --output ./artifacts
5058

5159
- name: Publish to NuGet
52-
if: startsWith(github.ref, 'refs/tags/')
60+
if: steps.get_tag.outputs.tag != ''
5361
run: dotnet nuget push ./artifacts/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate
5462

63+
- name: Extract release notes from CHANGELOG.md
64+
if: steps.get_tag.outputs.tag != ''
65+
id: extract_notes
66+
run: |
67+
VERSION="${{ steps.get_tag.outputs.tag }}"
68+
echo "Extracting notes for version: $VERSION"
69+
70+
NOTES=$(awk -v ver="v$VERSION" '
71+
$0 ~ "^## "ver"$" {flag=1; next}
72+
flag && $0 ~ "^## " {flag=0}
73+
flag
74+
' <(sed "s/\r$//" CHANGELOG.md) | awk '!/^Release Date:/')
75+
NOTES=$(echo "$NOTES" | sed '/./,$!d' | tac | sed '/./,$!d' | tac)
76+
77+
if [ -z "$NOTES" ]; then
78+
echo "Did not find notes with 'v' prefix, trying without."
79+
NOTES=$(awk -v ver="$VERSION" '
80+
$0 ~ "^## "ver"$" {flag=1; next}
81+
flag && $0 ~ "^## " {flag=0}
82+
flag
83+
' <(sed "s/\r$//" CHANGELOG.md) | awk '!/^Release Date:/')
84+
NOTES=$(echo "$NOTES" | sed '/./,$!d' | tac | sed '/./,$!d' | tac)
85+
fi
86+
87+
# Set output
88+
echo "notes<<EOF" >> $GITHUB_OUTPUT
89+
echo "$NOTES" >> $GITHUB_OUTPUT
90+
echo "EOF" >> $GITHUB_OUTPUT
91+
5592
- name: Create GitHub Release
56-
if: startsWith(github.ref, 'refs/tags/')
93+
if: steps.get_tag.outputs.tag != ''
5794
uses: softprops/action-gh-release@v1
5895
with:
59-
generate_release_notes: true
96+
tag_name: ${{ steps.get_tag.outputs.tag }}
97+
body: ${{ steps.extract_notes.outputs.notes }}
6098
env:
6199
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Directory.Build.props

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
<Copyright>Copyright © Stephen Denne 2024, 2025</Copyright>
88
<Company>Datacute</Company>
99
<PackageProjectUrl>https://github.com/datacute/EmbeddedResourcePropertyGenerator</PackageProjectUrl>
10+
<PackageReleaseNotes>See full release notes and changelog: $(PackageProjectUrl)/blob/main/CHANGELOG.md</PackageReleaseNotes>
1011
<CheckEolTargetFramework>false</CheckEolTargetFramework>
1112
</PropertyGroup>
1213

@@ -15,6 +16,4 @@
1516
<PackageOutputPath>$(MSBuildThisFileDirectory)\artifacts</PackageOutputPath>
1617
</PropertyGroup>
1718

18-
<Import Project="releasenotes.props" />
19-
2019
</Project>

EmbeddedResourceProperty.sln

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
1313
ProjectSection(SolutionItems) = preProject
1414
CHANGELOG.md = CHANGELOG.md
1515
Directory.Build.props = Directory.Build.props
16-
releasenotes.props = releasenotes.props
1716
version.props = version.props
1817
LICENSE = LICENSE
1918
README.md = README.md

releasenotes.props

Lines changed: 0 additions & 92 deletions
This file was deleted.

0 commit comments

Comments
 (0)