Skip to content

Commit 90142e4

Browse files
committed
chore: Add GitHub Actions workflows for release management, build enhancements, and dependency updates.
1 parent b26d86c commit 90142e4

4 files changed

Lines changed: 189 additions & 10 deletions

File tree

.github/dependabot.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,46 @@
11
version: 2
22
updates:
3+
# GitHub Actions
4+
- package-ecosystem: github-actions
5+
directory: /
6+
schedule:
7+
interval: weekly
8+
day: sunday
9+
timezone: Europe/Zurich
10+
time: "01:30"
11+
labels:
12+
- dependencies/github-actions
13+
314
- package-ecosystem: "nuget"
415
directory: "/"
516
schedule:
617
interval: "weekly"
18+
19+
# .NET SDK
20+
- package-ecosystem: dotnet-sdk
21+
directory: /
22+
schedule:
23+
interval: weekly
24+
day: sunday
25+
timezone: Europe/Zurich
26+
time: "02:00"
27+
labels:
28+
- dependencies/dotnet-sdk
29+
groups:
30+
dotnet-next:
31+
update-types:
32+
- major
33+
- minor
34+
dotnet-updates:
35+
update-types:
36+
- patch
37+
38+
# NuGet
39+
- package-ecosystem: nuget
40+
directory: /
41+
schedule:
42+
interval: daily
43+
timezone: Europe/Zurich
44+
time: "03:00"
45+
labels:
46+
- dependencies/nuget

.github/release-drafter.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name-template: "v$RESOLVED_VERSION"
2+
tag-template: "v$RESOLVED_VERSION"
3+
change-template: "- $TITLE by @$AUTHOR (#$NUMBER)"
4+
no-changes-template: "- No changes"
5+
6+
prerelease: true
7+
prerelease-identifier: rc
8+
include-pre-releases: true
9+
10+
categories:
11+
- title: "📚 Documentation"
12+
labels:
13+
- "documentation"
14+
- title: "🚀 New Features"
15+
labels:
16+
- "enhancement"
17+
- title: "🐛 Bug Fixes"
18+
labels:
19+
- "bug"
20+
- title: "🚨 Security Updates"
21+
labels:
22+
- "security"
23+
- title: "🔄 Dependency Updates"
24+
collapse-after: 3
25+
labels:
26+
- "dependencies/github-actions"
27+
- "dependencies/containers"
28+
- "dependencies/dotnet-sdk"
29+
- "dependencies/nuget"
30+
31+
version-resolver:
32+
major:
33+
labels:
34+
- "major"
35+
minor:
36+
labels:
37+
- "minor"
38+
patch:
39+
labels:
40+
- "patch"
41+
default: patch
42+
template: |
43+
$CHANGES
44+
45+
## 👨🏼‍💻 Contributors
46+
47+
$CONTRIBUTORS
48+
autolabeler:
49+
- label: "dependencies/github-actions"
50+
files:
51+
- ".github/**/*"
52+
- label: "dependencies/dotnet-sdk"
53+
files:
54+
- "global.json"
55+
- label: "dependencies/nuget"
56+
files:
57+
- "Directory.Packages.props"
58+
- label: "documentation"
59+
files:
60+
- "docs/**/*"

.github/workflows/build.yml

Lines changed: 49 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,70 @@
1-
name: dotnet build
1+
name: Build
22

3-
on: [push]
3+
on:
4+
pull_request:
5+
types:
6+
- opened
7+
- synchronize
8+
- reopened
9+
push:
10+
branches:
11+
- main
12+
workflow_dispatch:
13+
14+
env:
15+
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
16+
DOTNET_NOLOGO: true
417

518
jobs:
619
build:
720
runs-on: ubuntu-latest
8-
strategy:
9-
matrix:
10-
dotnet-version: [ '7.0.x' ]
1121
steps:
1222
- uses: actions/checkout@v3
1323
with:
1424
fetch-depth: '0'
15-
- name: Setup .NET Core SDK ${{ matrix.dotnet-version }}
25+
- name: Setup .NET Core SDK
1626
uses: actions/setup-dotnet@v3
1727
with:
18-
dotnet-version: ${{ matrix.dotnet-version }}
28+
dotnet-version: |
29+
9.x
30+
1931
- name: Restore .NET Packages
2032
run: dotnet restore
33+
2134
- name: Build .NET Solution
2235
run: dotnet build --configuration Release --no-restore
36+
37+
- name: Test .NET Solution
38+
run: dotnet test --configuration Release --no-build --filter="Category=UnitTest|Category=IntegrationTest" --logger "trx;LogFilePrefix=test-results"
39+
40+
- uses: actions/upload-artifact@v4
41+
if: success() || failure()
42+
with:
43+
name: test-results
44+
path: "**/test-results*.trx"
45+
2346
- name: Pack .NET Solution
24-
run: dotnet pack --no-build --output pack/
47+
run: dotnet pack --configuration Release --no-build --output pack/
48+
if: ${{ github.event_name == 'release' && github.ref_type == 'tag' || github.event.release.tag_name }}
49+
2550
- name: Publish .NET Solution to GitHub Packages
2651
continue-on-error: true
27-
run: dotnet nuget push pack/* --api-key ${{ secrets.GITHUB_TOKEN }} --source "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json"
52+
run: dotnet nuget push pack/*.nupkg --api-key ${{ secrets.GITHUB_TOKEN }} --source "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json"
53+
if: ${{ github.event_name == 'release' && github.ref_type == 'tag' || github.event.release.tag_name }}
54+
55+
- name: Store .NET Package
56+
uses: actions/upload-artifact@v4
57+
with:
58+
name: nuget
59+
if-no-files-found: error
60+
retention-days: 7
61+
path: pack/*.nupkg
62+
if: ${{ github.event_name == 'release' && github.ref_type == 'tag' || github.event.release.tag_name }}
63+
2864
- name: Publish .NET Solution to NuGet.org
2965
continue-on-error: true
30-
run: dotnet nuget push pack/* --api-key ${{ secrets.NUGET_ORG_KEY }} --source nuget
66+
env:
67+
apikey: ${{ secrets.NUGET_ORG_KEY }}
68+
run: dotnet nuget push pack/*.nupkg --api-key ${{ secrets.NUGET_ORG_KEY }} --source nuget
69+
if: ${{ env.apikey != '' && github.event_name == 'release' && github.ref_type == 'tag' || github.event.release.tag_name }}
3170

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Release Drafter
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request_target:
8+
types:
9+
- edited
10+
- opened
11+
- reopened
12+
- synchronize
13+
workflow_dispatch:
14+
inputs:
15+
release-type:
16+
type: choice
17+
default: prerelease
18+
description: Release Type
19+
options:
20+
- release
21+
- prerelease
22+
23+
concurrency:
24+
group: ${{ github.event_name == 'pull_request' && format('pr-{0}', github.event.number) || github.ref }}
25+
cancel-in-progress: ${{ github.ref != 'refs/heads/main' && github.ref_type != 'tag' }}
26+
27+
jobs:
28+
update_release_draft:
29+
name: "Update Release Draft"
30+
permissions:
31+
contents: write
32+
pull-requests: write
33+
runs-on: ubuntu-latest
34+
steps:
35+
- name: "Draft Release"
36+
uses: release-drafter/release-drafter@v6.1.0
37+
with:
38+
prerelease: ${{ github.event.inputs.release-type != 'release' }}
39+
env:
40+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)