Skip to content

Commit 6457c76

Browse files
committed
Create GitHub releases from release workflow
1 parent 98b2041 commit 6457c76

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

‎.github/workflows/release.yml‎

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
- "v*"
77

88
permissions:
9-
contents: read
9+
contents: write
1010

1111
jobs:
1212
pack:
@@ -38,6 +38,17 @@ jobs:
3838
- name: Pack
3939
run: for project in src/*/*.csproj; do dotnet pack "$project" --configuration Release --no-build --output artifacts/packages; done
4040

41+
- name: Create GitHub release
42+
env:
43+
GH_TOKEN: ${{ github.token }}
44+
TAG_NAME: ${{ github.ref_name }}
45+
run: |
46+
if gh release view "$TAG_NAME" > /dev/null 2>&1; then
47+
gh release upload "$TAG_NAME" artifacts/packages/*.nupkg --clobber
48+
else
49+
gh release create "$TAG_NAME" artifacts/packages/*.nupkg --title "$TAG_NAME" --generate-notes --verify-tag
50+
fi
51+
4152
- name: Publish packages
4253
if: ${{ env.NUGET_API_KEY != '' }}
4354
run: dotnet nuget push "artifacts/packages/*.nupkg" --source https://api.nuget.org/v3/index.json --api-key "$NUGET_API_KEY" --skip-duplicate

‎AGENTS.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ Rule format:
6464
- Build: `dotnet build ManagedCode.LlmTck.slnx --configuration Release --no-restore`
6565
- Test: `dotnet test tests/ManagedCode.LlmTck.Tests/ManagedCode.LlmTck.Tests.csproj --configuration Release --no-build --verbosity normal`
6666
- Pack: `for project in src/*/*.csproj; do dotnet pack "$project" --configuration Release --no-build --output artifacts/packages; done`
67+
- Release: push a `vX.Y.Z` tag only after `Directory.Build.props` has the matching package version; the release workflow must create the GitHub Release and attach package artifacts, because a passing `main` CI run is not a release.
6768
- Format check: `dotnet format ManagedCode.LlmTck.slnx --verify-no-changes`
6869
- Tool restore: `dotnet tool restore`
6970
- Coverage gate: production code line coverage must stay at or above 90%; measure with coverlet/reportgenerator when coverage expectations change.

0 commit comments

Comments
 (0)