Skip to content

Commit e4e171e

Browse files
author
machibuse
committed
Initial
0 parents  commit e4e171e

28 files changed

Lines changed: 944 additions & 0 deletions

.github/workflows/release.yaml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Build and Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
- "v*-beta*"
8+
- "v*-alpha*"
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@v4
17+
18+
- name: Set up .NET
19+
uses: actions/setup-dotnet@v3
20+
with:
21+
dotnet-version: '9.0.x'
22+
23+
# Remove the "V" from the tay for NUGET package version
24+
- name: Extract version from tag
25+
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
26+
27+
- name: Restore dependencies
28+
run: dotnet restore Source/Porticle.Grpc.sln
29+
30+
- name: Build project
31+
run: dotnet build Source/Porticle.Grpc.sln --configuration Release --no-restore
32+
33+
- name: Pack NuGet package
34+
run: dotnet pack Source/Porticle.Grpc.GuidMapper/Porticle.Grpc.GuidMapper.csproj --configuration Release --no-build --output ./nuget --property:PackageVersion=${{ env.VERSION }}
35+
36+
- name: Publish NuGet package
37+
run: dotnet nuget push ./nuget/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate
38+
39+
- name: Create GitHub Release
40+
uses: softprops/action-gh-release@v1
41+
with:
42+
tag_name: v${{ env.VERSION }}
43+
name: Release v${{ env.VERSION }}
44+
body: "Nuget Release für Porticle.Grpc.GuidMapper v${{ env.VERSION }}."
45+
files: ./nuget/*.nupkg
46+
draft: false
47+
prerelease: ${{ contains(env.VERSION, '-beta') || contains(env.VERSION, '-alpha') || contains(env.VERSION, '-rc') }}
48+
env:
49+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)