Skip to content

Merge branch 'develop' #50

Merge branch 'develop'

Merge branch 'develop' #50

Workflow file for this run

# This workflow will build a .NET project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
name: NuGet - Prod
on:
push:
tags:
- "v**-prod"
env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_NOLOGO: true
NuGetDirectory: ${{ github.workspace}}/nuget
jobs:
build:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Fetch full history for release notes generation
- uses: actions/setup-dotnet@v3
with:
dotnet-version: "9.x"
- name: Install MAUI Workloads
run: dotnet workload install maui --ignore-failed-sources
- name: Semver Parse
id: version
uses: release-kit/semver@v1.0.10
- name: Get Previous Tag
id: previous_tag
run: |
# Get the previous production tag (excluding current one)
PREVIOUS_TAG=$(git tag --sort=-version:refname | grep -E "v.*-prod" | sed -n '2p')
if [ -z "$PREVIOUS_TAG" ]; then
# If no previous prod tag found, get the latest beta tag or first commit
PREVIOUS_TAG=$(git tag --sort=-version:refname | grep -E "v.*-beta" | head -n 1)
if [ -z "$PREVIOUS_TAG" ]; then
PREVIOUS_TAG=$(git rev-list --max-parents=0 HEAD)
fi
fi
echo "previous_tag=$PREVIOUS_TAG" >> $GITHUB_OUTPUT
echo "Previous tag: $PREVIOUS_TAG"
- name: Generate Release Notes
id: release_notes
run: |
# Generate release notes between tags
CURRENT_TAG="${{ github.ref_name }}"
PREVIOUS_TAG="${{ steps.previous_tag.outputs.previous_tag }}"
echo "Generating release notes between $PREVIOUS_TAG and $CURRENT_TAG"
# Create release notes with commit messages
echo "## What's Changed in $CURRENT_TAG" > release_notes.md
echo "" >> release_notes.md
# Get commits between tags
if [ "$PREVIOUS_TAG" != "" ] && git rev-parse --verify "$PREVIOUS_TAG" >/dev/null 2>&1; then
COMMITS=$(git log --pretty=format:"%s|%h" "$PREVIOUS_TAG..$CURRENT_TAG")
else
COMMITS=$(git log --pretty=format:"%s|%h")
fi
# Filter out common git cruft messages
COMMITS=$(echo "$COMMITS" | grep -v -i "^merge pull request\|^merge remote-tracking\|^merge branch\|^update .gitignore\|^update readme\|^initial commit\|^updated dependencies\|^version bump\|^bump version" || echo "$COMMITS")
# Categorize commits
echo "### 🚀 New Features" >> release_notes.md
FEATURES=$(echo "$COMMITS" | grep -i "^feat\|^add\|^new" || true)
if [ -n "$FEATURES" ]; then
echo "$FEATURES" | while IFS='|' read -r subject hash; do
echo "- $subject (\`$hash\`)" >> release_notes.md
done
else
echo "- No new features in this release" >> release_notes.md
fi
echo "" >> release_notes.md
echo "### 🐛 Bug Fixes" >> release_notes.md
FIXES=$(echo "$COMMITS" | grep -i "^fix\|^bug\|^patch" || true)
if [ -n "$FIXES" ]; then
echo "$FIXES" | while IFS='|' read -r subject hash; do
echo "- $subject (\`$hash\`)" >> release_notes.md
done
else
echo "- No bug fixes in this release" >> release_notes.md
fi
echo "" >> release_notes.md
echo "### 📝 Documentation & Other Changes" >> release_notes.md
OTHER=$(echo "$COMMITS" | grep -iv "^feat\|^add\|^new\|^fix\|^bug\|^patch" || true)
if [ -n "$OTHER" ]; then
echo "$OTHER" | while IFS='|' read -r subject hash; do
echo "- $subject (\`$hash\`)" >> release_notes.md
done
else
echo "- No other changes in this release" >> release_notes.md
fi
echo "" >> release_notes.md
echo "---" >> release_notes.md
echo "" >> release_notes.md
if [ "$PREVIOUS_TAG" != "" ]; then
echo "**Full Changelog**: https://github.com/${{ github.repository }}/compare/$PREVIOUS_TAG...$CURRENT_TAG" >> release_notes.md
else
echo "**Full Changelog**: https://github.com/${{ github.repository }}/commits/$CURRENT_TAG" >> release_notes.md
fi
# Show the generated release notes in the action log
echo "Generated release notes:"
cat release_notes.md
- name: Build Aurora Controls MAUI
run: dotnet build AuroraControlsMaui/AuroraControls.Maui.csproj
- name: Create the package
run: dotnet pack --configuration Release --output ${{ env.NuGetDirectory }} /p:AssemblyVersion=${{ steps.version.outputs.major }}.${{ steps.version.outputs.minor }}.${{ steps.version.outputs.patch }} /p:Version=${{ steps.version.outputs.major }}.${{ steps.version.outputs.minor }}.${{ steps.version.outputs.patch }} AuroraControlsMaui/AuroraControls.Maui.csproj
- name: Publish the package to GPR
run: dotnet nuget push ${{ env.NuGetDirectory }}/*.nupkg --api-key "${{secrets.GITHUB_TOKEN}}" --source https://nuget.pkg.github.com/theeightbot/index.json
- name: Publish the package to NuGet
run: dotnet nuget push ${{ env.NuGetDirectory }}/*.nupkg --api-key "${{ secrets.NUGET_APIKEY }}" --source https://api.nuget.org/v3/index.json
- name: Create GitHub Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# Create release with release notes
gh release create "${{ github.ref_name }}" \
--title "Aurora Controls MAUI ${{ github.ref_name }}" \
--notes-file release_notes.md \
--latest \
${{ env.NuGetDirectory }}/*.nupkg