From b30f3f23e67b5423298fd536f9d843e43b962c1c Mon Sep 17 00:00:00 2001 From: John Campion Jr Date: Sat, 25 Oct 2025 17:52:40 -0400 Subject: [PATCH] chore: initial release-please setup --- .github/workflows/dotnet-core.yml | 22 ------------ .github/workflows/dotnet-test.yml | 32 +++++++++++++++++ .github/workflows/publish-nuget.yml | 48 ++++++++++++++++++++++++++ .github/workflows/publish-packages.yml | 28 --------------- .github/workflows/release-please.yml | 20 +++++++++++ .release-please-manifest.json | 3 ++ FluentEmail.sln | 9 +++-- release-please-config.json | 33 ++++++++++++++++++ 8 files changed, 142 insertions(+), 53 deletions(-) delete mode 100644 .github/workflows/dotnet-core.yml create mode 100644 .github/workflows/dotnet-test.yml create mode 100644 .github/workflows/publish-nuget.yml delete mode 100644 .github/workflows/publish-packages.yml create mode 100644 .github/workflows/release-please.yml create mode 100644 .release-please-manifest.json create mode 100644 release-please-config.json diff --git a/.github/workflows/dotnet-core.yml b/.github/workflows/dotnet-core.yml deleted file mode 100644 index 091598b..0000000 --- a/.github/workflows/dotnet-core.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: Build & Test - -on: - pull_request: - branches: [main] - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - name: Setup .NET Core - uses: actions/setup-dotnet@v1 - with: - dotnet-version: 6.0.x - - name: Install dependencies - run: dotnet restore - - name: Build - run: dotnet build --configuration Release --no-restore - - name: Test - run: dotnet test --no-restore --verbosity normal diff --git a/.github/workflows/dotnet-test.yml b/.github/workflows/dotnet-test.yml new file mode 100644 index 0000000..b89d75e --- /dev/null +++ b/.github/workflows/dotnet-test.yml @@ -0,0 +1,32 @@ +name: .NET Tests + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + build: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [windows-latest, ubuntu-latest, macos-latest] + + steps: + - name: Checkout 🛎️ + uses: actions/checkout@v5 + + - name: Setup DotNet ✨ + uses: actions/setup-dotnet@v5 + with: + dotnet-version: "9.0.x" + + - name: Install dependencies 📦️ + run: dotnet restore + + - name: Build 🔨 + run: dotnet build --no-restore -c Release + + - name: Test ✅ + run: dotnet test --verbosity normal diff --git a/.github/workflows/publish-nuget.yml b/.github/workflows/publish-nuget.yml new file mode 100644 index 0000000..3e579c9 --- /dev/null +++ b/.github/workflows/publish-nuget.yml @@ -0,0 +1,48 @@ +# Note this will only work with Release-Please if you have given it a PAT. +# The default GITHUB_TOKEN does not have permission to run workflows on releases +name: Publish to NuGet + +on: + release: + types: [published] + workflow_dispatch: + +permissions: + id-token: write # Required for OIDC + contents: read + +jobs: + release: + runs-on: ubuntu-latest + steps: + - name: Checkout 🛎️ + uses: actions/checkout@v5 + + - name: Setup DotNet ✨ + uses: actions/setup-dotnet@v5 + with: + dotnet-version: "9.0.x" + + - name: Install dependencies 📦️ + run: dotnet restore + + - name: Build 🔨 + run: dotnet build --no-restore -c Release + + # If not using true + - name: Pack NuGet 🏗️ + run: | + dotnet pack --no-build -v normal --include-symbols -o nupkg + + # Get a short-lived NuGet API key + - name: NuGet login (OIDC → temp API key) + uses: NuGet/login@v1 + id: login + with: + user: ${{secrets.NUGET_USER}} + + - name: Push NuGet 🚀 + run: | + dotnet nuget push **/*.nupkg -k ${{steps.login.outputs.NUGET_API_KEY}} -s https://api.nuget.org/v3/index.json --skip-duplicate + +# dotnet nuget push **/*.nupkg -k ${{secrets.NUGET_API_KEY}} -s https://f.feedz.io/jcamp/nuget-test/nuget/index.json --skip-duplicate diff --git a/.github/workflows/publish-packages.yml b/.github/workflows/publish-packages.yml deleted file mode 100644 index 086fce9..0000000 --- a/.github/workflows/publish-packages.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: Publish Packages - -on: - push: - branches: [main] - workflow_dispatch: - - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - name: Setup .NET Core - uses: actions/setup-dotnet@v1 - with: - dotnet-version: 6.0.x - - name: Setup NuGet - uses: NuGet/setup-nuget@v1 - - - name: Install dependencies - run: dotnet restore - - name: Build - run: dotnet build --configuration Release --no-restore - - - name: Publish jcamp.FluentEmail.* - run: nuget push **\*.nupkg -Source 'https://api.nuget.org/v3/index.json' -ApiKey ${{secrets.NUGET_API_KEY}} diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml new file mode 100644 index 0000000..896fee8 --- /dev/null +++ b/.github/workflows/release-please.yml @@ -0,0 +1,20 @@ +on: + push: + branches: + - main + workflow_dispatch: + +permissions: + contents: write + issues: write + pull-requests: write + +name: release-please + +jobs: + release-please: + runs-on: ubuntu-latest + steps: + - uses: googleapis/release-please-action@v4 + with: + token: ${{ secrets.JCAMP_GH_TOKEN }} diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 0000000..573f090 --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1,3 @@ +{ + ".": "3.8.0" +} diff --git a/FluentEmail.sln b/FluentEmail.sln index 90b18b8..2ac42f3 100644 --- a/FluentEmail.sln +++ b/FluentEmail.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 18 -VisualStudioVersion = 18.0.11121.172 d18.0 +VisualStudioVersion = 18.0.11121.172 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{6DC215BD-05EF-49A6-ADBE-8AE399952EEC}" ProjectSection(SolutionItems) = preProject @@ -53,8 +53,11 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FluentEmail.Postmark", "src EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "GitHub Actions", "GitHub Actions", "{1B6987D8-3785-4A78-8637-40E321CC2877}" ProjectSection(SolutionItems) = preProject - .github\workflows\dotnet-core.yml = .github\workflows\dotnet-core.yml - .github\workflows\publish-packages.yml = .github\workflows\publish-packages.yml + .release-please-manifest.json = .release-please-manifest.json + .github\workflows\dotnet-test.yml = .github\workflows\dotnet-test.yml + .github\workflows\publish-nuget.yml = .github\workflows\publish-nuget.yml + release-please-config.json = release-please-config.json + .github\workflows\release-please.yml = .github\workflows\release-please.yml EndProjectSection EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FluentEmail.MailPace", "src\Senders\FluentEmail.MailPace\FluentEmail.MailPace.csproj", "{B7A5D5CF-9804-41CA-BF0A-16D5252CE7A9}" diff --git a/release-please-config.json b/release-please-config.json new file mode 100644 index 0000000..1be44f7 --- /dev/null +++ b/release-please-config.json @@ -0,0 +1,33 @@ +{ + "packages": { + ".": { + "changelog-path": "CHANGELOG.md", + "release-type": "simple", + "draft": false, + "prerelease": false + } + }, + "plugins": ["sentence-case"], + "changelog-sections": [ + { "type": "feat", "section": "✨ Features" }, + { "type": "feature", "section": "✨ Features" }, + { "type": "fix", "section": "🐛 Bug Fixes" }, + { "type": "perf", "section": "⚡️Performance Improvements" }, + { "type": "revert", "section": "⏪️ Reverts" }, + { "type": "docs", "section": "📝 Documentation" }, + { "type": "style", "section": "🎨 Styles" }, + { "type": "chore", "section": "🏡 Miscellaneous Chores" }, + { "type": "refactor", "section": "♻️ Code Refactoring", "hidden": true }, + { "type": "test", "section": "✅ Tests", "hidden": true }, + { "type": "build", "section": "📦️ Build System", "hidden": true }, + { "type": "ci", "section": "🤖 Continuous Integration", "hidden": true } + ], + "extra-files": [ + { + "type": "xml", + "path": "src/Directory.Build.props", + "xpath": "//project/propertygroup/version" + } + ], + "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json" +}