Skip to content

Bump the efcore group with 4 updates #13

Bump the efcore group with 4 updates

Bump the efcore group with 4 updates #13

name: Preview Release
on:
pull_request:
types: [opened, synchronize, reopened]
branches: [ main, develop ]
env:
DOTNET_VERSION: '8.0.x'
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
jobs:
preview-release:
name: Build Preview Packages
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Generate version
id: version
run: |
# Base version from Directory.Build.props or default
BASE_VERSION="0.1.0"
# Create preview version: 0.1.0-preview.{PR#}.{run#}
PR_NUMBER=${{ github.event.pull_request.number }}
RUN_NUMBER=${{ github.run_number }}
PREVIEW_VERSION="${BASE_VERSION}-preview.${PR_NUMBER}.${RUN_NUMBER}"
echo "version=${PREVIEW_VERSION}" >> $GITHUB_OUTPUT
echo "Generated preview version: ${PREVIEW_VERSION}"
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore --configuration Release /p:Version=${{ steps.version.outputs.version }}
- name: Test
run: dotnet test --no-build --configuration Release --verbosity normal
- name: Pack NuGet packages
run: |
dotnet pack src/BenchLibrary.Core/BenchLibrary.Core.csproj \
--no-build \
--configuration Release \
--output ./nupkgs \
/p:PackageVersion=${{ steps.version.outputs.version }}
dotnet pack src/BenchLibrary.SixSigma/BenchLibrary.SixSigma.csproj \
--no-build \
--configuration Release \
--output ./nupkgs \
/p:PackageVersion=${{ steps.version.outputs.version }}
dotnet pack src/BenchLibrary.Data/BenchLibrary.Data.csproj \
--no-build \
--configuration Release \
--output ./nupkgs \
/p:PackageVersion=${{ steps.version.outputs.version }}
- name: Upload NuGet packages
uses: actions/upload-artifact@v4
with:
name: nuget-packages-preview
path: ./nupkgs/*.nupkg
retention-days: 7
- name: Publish to GitHub Packages
run: |
dotnet nuget push ./nupkgs/*.nupkg \
--source "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" \
--api-key ${{ secrets.GITHUB_TOKEN }} \
--skip-duplicate
continue-on-error: true
- name: Comment on PR with package info
uses: marocchino/sticky-pull-request-comment@v2
with:
header: preview-packages
message: |
## 📦 Preview Packages Published
**Version:** `${{ steps.version.outputs.version }}`
### Packages
| Package | Version |
|---------|---------|
| BenchLibrary.Core | ${{ steps.version.outputs.version }} |
| BenchLibrary.SixSigma | ${{ steps.version.outputs.version }} |
| BenchLibrary.Data | ${{ steps.version.outputs.version }} |
### Installation
```bash
# Add GitHub Packages source (one-time setup)
dotnet nuget add source "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" \
--name "github-${{ github.repository_owner }}" \
--username YOUR_GITHUB_USERNAME \
--password YOUR_GITHUB_TOKEN
# Install preview packages
dotnet add package BenchLibrary.Core --version ${{ steps.version.outputs.version }}
dotnet add package BenchLibrary.SixSigma --version ${{ steps.version.outputs.version }}
dotnet add package BenchLibrary.Data --version ${{ steps.version.outputs.version }}
```
### Download Artifacts
Preview packages are also available as [workflow artifacts](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}).
---
*Generated by PR #${{ github.event.pull_request.number }} • Run #${{ github.run_number }}*