Skip to content

Commit 3657e64

Browse files
chore: initial release-please setup (#34)
1 parent 985766c commit 3657e64

File tree

8 files changed

+142
-53
lines changed

8 files changed

+142
-53
lines changed

.github/workflows/dotnet-core.yml

Lines changed: 0 additions & 22 deletions
This file was deleted.

.github/workflows/dotnet-test.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: .NET Tests
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
build:
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
matrix:
14+
os: [windows-latest, ubuntu-latest, macos-latest]
15+
16+
steps:
17+
- name: Checkout 🛎️
18+
uses: actions/checkout@v5
19+
20+
- name: Setup DotNet ✨
21+
uses: actions/setup-dotnet@v5
22+
with:
23+
dotnet-version: "9.0.x"
24+
25+
- name: Install dependencies 📦️
26+
run: dotnet restore
27+
28+
- name: Build 🔨
29+
run: dotnet build --no-restore -c Release
30+
31+
- name: Test ✅
32+
run: dotnet test --verbosity normal
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Note this will only work with Release-Please if you have given it a PAT.
2+
# The default GITHUB_TOKEN does not have permission to run workflows on releases
3+
name: Publish to NuGet
4+
5+
on:
6+
release:
7+
types: [published]
8+
workflow_dispatch:
9+
10+
permissions:
11+
id-token: write # Required for OIDC
12+
contents: read
13+
14+
jobs:
15+
release:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Checkout 🛎️
19+
uses: actions/checkout@v5
20+
21+
- name: Setup DotNet ✨
22+
uses: actions/setup-dotnet@v5
23+
with:
24+
dotnet-version: "9.0.x"
25+
26+
- name: Install dependencies 📦️
27+
run: dotnet restore
28+
29+
- name: Build 🔨
30+
run: dotnet build --no-restore -c Release
31+
32+
# If not using <GeneratePackageOnBuild>true</GeneratePackageOnBuild>
33+
- name: Pack NuGet 🏗️
34+
run: |
35+
dotnet pack --no-build -v normal --include-symbols -o nupkg
36+
37+
# Get a short-lived NuGet API key
38+
- name: NuGet login (OIDC → temp API key)
39+
uses: NuGet/login@v1
40+
id: login
41+
with:
42+
user: ${{secrets.NUGET_USER}}
43+
44+
- name: Push NuGet 🚀
45+
run: |
46+
dotnet nuget push **/*.nupkg -k ${{steps.login.outputs.NUGET_API_KEY}} -s https://api.nuget.org/v3/index.json --skip-duplicate
47+
48+
# dotnet nuget push **/*.nupkg -k ${{secrets.NUGET_API_KEY}} -s https://f.feedz.io/jcamp/nuget-test/nuget/index.json --skip-duplicate

.github/workflows/publish-packages.yml

Lines changed: 0 additions & 28 deletions
This file was deleted.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
on:
2+
push:
3+
branches:
4+
- main
5+
workflow_dispatch:
6+
7+
permissions:
8+
contents: write
9+
issues: write
10+
pull-requests: write
11+
12+
name: release-please
13+
14+
jobs:
15+
release-please:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: googleapis/release-please-action@v4
19+
with:
20+
token: ${{ secrets.JCAMP_GH_TOKEN }}

.release-please-manifest.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
".": "3.8.0"
3+
}

FluentEmail.sln

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio Version 18
4-
VisualStudioVersion = 18.0.11121.172 d18.0
4+
VisualStudioVersion = 18.0.11121.172
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{6DC215BD-05EF-49A6-ADBE-8AE399952EEC}"
77
ProjectSection(SolutionItems) = preProject
@@ -53,8 +53,11 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FluentEmail.Postmark", "src
5353
EndProject
5454
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "GitHub Actions", "GitHub Actions", "{1B6987D8-3785-4A78-8637-40E321CC2877}"
5555
ProjectSection(SolutionItems) = preProject
56-
.github\workflows\dotnet-core.yml = .github\workflows\dotnet-core.yml
57-
.github\workflows\publish-packages.yml = .github\workflows\publish-packages.yml
56+
.release-please-manifest.json = .release-please-manifest.json
57+
.github\workflows\dotnet-test.yml = .github\workflows\dotnet-test.yml
58+
.github\workflows\publish-nuget.yml = .github\workflows\publish-nuget.yml
59+
release-please-config.json = release-please-config.json
60+
.github\workflows\release-please.yml = .github\workflows\release-please.yml
5861
EndProjectSection
5962
EndProject
6063
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FluentEmail.MailPace", "src\Senders\FluentEmail.MailPace\FluentEmail.MailPace.csproj", "{B7A5D5CF-9804-41CA-BF0A-16D5252CE7A9}"

release-please-config.json

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"packages": {
3+
".": {
4+
"changelog-path": "CHANGELOG.md",
5+
"release-type": "simple",
6+
"draft": false,
7+
"prerelease": false
8+
}
9+
},
10+
"plugins": ["sentence-case"],
11+
"changelog-sections": [
12+
{ "type": "feat", "section": "✨ Features" },
13+
{ "type": "feature", "section": "✨ Features" },
14+
{ "type": "fix", "section": "🐛 Bug Fixes" },
15+
{ "type": "perf", "section": "⚡️Performance Improvements" },
16+
{ "type": "revert", "section": "⏪️ Reverts" },
17+
{ "type": "docs", "section": "📝 Documentation" },
18+
{ "type": "style", "section": "🎨 Styles" },
19+
{ "type": "chore", "section": "🏡 Miscellaneous Chores" },
20+
{ "type": "refactor", "section": "♻️ Code Refactoring", "hidden": true },
21+
{ "type": "test", "section": "✅ Tests", "hidden": true },
22+
{ "type": "build", "section": "📦️ Build System", "hidden": true },
23+
{ "type": "ci", "section": "🤖 Continuous Integration", "hidden": true }
24+
],
25+
"extra-files": [
26+
{
27+
"type": "xml",
28+
"path": "src/Directory.Build.props",
29+
"xpath": "//project/propertygroup/version"
30+
}
31+
],
32+
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json"
33+
}

0 commit comments

Comments
 (0)