Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 14 additions & 7 deletions .claude/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,38 @@
"attribution": {
"commit": "",
"pr": ""
},
},
"permissions": {
"allow": [
"Bash(cd:*)",
"Bash(dotnet:*)",
"Bash(dotnet test:*)",
"Bash(mkdir:*)",
"Bash(rmdir:*)",
"Bash(cp:*)",
"Bash(mv:*)",
"Bash(rm:*)",
"Bash(ls:*)",
"Bash(cat:*)",
"Skill(update-config)",
"Skill(update-config:*)",
"Bash(xargs grep:*)",
"Bash(dotnet test:*)",
"Bash(gh pr:*)",
"Bash(gh run:*)",
"Bash(gh api:*)",
"Bash(gh issue *)",
"Bash(gh repo *)",
"Bash(git checkout:*)",
"Bash(git add:*)",
"Bash(git commit:*)",
"Bash(git merge:*)",
"Bash(git rm:*)",
"Bash(git branch:*)",
"Bash(git log:*)"
"Bash(git log:*)",
"Bash(git push:*)",
"Bash(git fetch:*)",
"Bash(git pull:*)",
"Skill(update-config)",
"Skill(update-config:*)"
],
"additionalDirectories": [
]
"additionalDirectories": []
}
}
96 changes: 74 additions & 22 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ env:

permissions:
contents: write
pull-requests: write
security-events: write

jobs:
Expand Down Expand Up @@ -77,7 +78,7 @@ jobs:

- name: Compute pre-release version
id: preversion
if: github.event_name == 'pull_request'
if: github.ref != 'refs/heads/master'
run: |
VERSION="${{ steps.version.outputs.version }}"
PRE_BASE="${VERSION}-pre"
Expand Down Expand Up @@ -146,11 +147,11 @@ jobs:
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3

publish:
release:
needs: [build, security]
runs-on: ubuntu-latest
if: github.event_name == 'push' || github.event_name == 'pull_request'
environment: ${{ github.ref == 'refs/heads/master' && 'release' || 'prerelease' }}
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
environment: release

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -183,24 +184,8 @@ jobs:
fi

VERSION="${MAJOR_MINOR}.${PATCH}"

if [ "${{ github.ref }}" != "refs/heads/master" ]; then
PRE_BASE="${VERSION}-pre"
LATEST_PRE=$(git tag -l "${PRE_BASE}.*" --sort=-v:refname | head -1)

if [ -z "$LATEST_PRE" ]; then
COUNTER=1
else
COUNTER=$(echo "$LATEST_PRE" | sed "s/.*-pre\.\([0-9]*\)/\1/")
COUNTER=$((COUNTER + 1))
fi

VERSION="${PRE_BASE}.${COUNTER}"
fi

echo "version=$VERSION" >> "$GITHUB_OUTPUT"
echo "previous_tag=$LATEST_TAG" >> "$GITHUB_OUTPUT"
echo "Computed version: $VERSION"

- name: Push to NuGet
run: |
Expand All @@ -210,7 +195,6 @@ jobs:
done

- name: Create GitHub Release
if: github.ref == 'refs/heads/master'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
Expand All @@ -224,8 +208,76 @@ jobs:
$NOTES_FLAG \
./artifacts/*.nupkg

- name: Comment released version on merged PR
if: always()
continue-on-error: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
PR_NUMBER=$(echo "${{ github.event.head_commit.message }}" | grep -oP 'Merge pull request #\K\d+' | head -1)
if [ -n "$PR_NUMBER" ]; then
gh pr comment "$PR_NUMBER" --body "Released as **v${{ steps.version.outputs.version }}** — https://github.com/${{ github.repository }}/releases/tag/${{ steps.version.outputs.version }}"
else
echo "No PR number found in commit message — skipping PR comment."
fi

prerelease:
needs: [build, security]
runs-on: ubuntu-latest
if: github.ref != 'refs/heads/master' && github.event_name == 'pull_request'
environment: prerelease

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 10.0.x

- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: nuget-packages
path: ./artifacts/

- name: Compute pre-release version
id: version
run: |
LATEST_TAG=$(git tag -l "${MAJOR_MINOR}.*" --sort=-v:refname \
| grep -E "^${MAJOR_MINOR}\.[0-9]+$" \
| head -1)

if [ -z "$LATEST_TAG" ]; then
PATCH=0
else
PATCH=$(echo "$LATEST_TAG" | sed "s/${MAJOR_MINOR}\.\([0-9]*\)/\1/")
PATCH=$((PATCH + 1))
fi

PRE_BASE="${MAJOR_MINOR}.${PATCH}-pre"
LATEST_PRE=$(git tag -l "${PRE_BASE}.*" --sort=-v:refname | head -1)

if [ -z "$LATEST_PRE" ]; then
COUNTER=1
else
COUNTER=$(echo "$LATEST_PRE" | sed "s/.*-pre\.\([0-9]*\)/\1/")
COUNTER=$((COUNTER + 1))
fi

VERSION="${PRE_BASE}.${COUNTER}"
echo "version=$VERSION" >> "$GITHUB_OUTPUT"

- name: Push to NuGet
run: |
for pkg in ./artifacts/*.nupkg; do
echo "Pushing $pkg..."
dotnet nuget push "$pkg" --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate || true
done

- name: Create GitHub Pre-release
if: github.ref != 'refs/heads/master'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
Expand Down
46 changes: 0 additions & 46 deletions plan/feature.md

This file was deleted.

41 changes: 0 additions & 41 deletions plan/plan.md

This file was deleted.

Loading