Skip to content

Commit 63cedca

Browse files
committed
Add release pipeline
1 parent 4da0de3 commit 63cedca

2 files changed

Lines changed: 33 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
on:
2+
push:
3+
tags:
4+
- "v[0-9]+.[0-9]+.[0-9]+"
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
timeout-minutes: 15
9+
steps:
10+
- name: Checkout
11+
uses: actions/checkout@v2
12+
- name: Verify commit exists in origin/main
13+
run: |
14+
git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/*
15+
git branch --remote --contains | grep origin/main
16+
- name: Set VERSION variable from tag
17+
run: echo "VERSION=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_ENV
18+
- name: Build
19+
run: dotnet build --configuration Release /p:Version=${VERSION}
20+
- name: Test
21+
run: dotnet test --configuration Release /p:Version=${VERSION} --no-build
22+
- name: Pack
23+
run: dotnet pack --configuration Release /p:Version=${VERSION} --no-build --output .
24+
- name: Push
25+
run: dotnet nuget push NuGet.Workflow.${VERSION}.nupkg --source https://api.nuget.org/v3/index.json --api-key ${NUGET_API_KEY}
26+
env:
27+
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}

Xeofd.MongoDbExtensions/Xeofd.MongoDbExtensions.csproj

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@
1111
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
1212
</PropertyGroup>
1313

14+
<PropertyGroup>
15+
<PackageId>NuGet.Workflow</PackageId>
16+
<RepositoryType>git</RepositoryType>
17+
<RepositoryUrl>https://github.com/xeofd/Xeofd.MongoDbExtension</RepositoryUrl>
18+
</PropertyGroup>
19+
1420
<ItemGroup>
1521
<PackageReference Include="Microsoft.Extensions.Configuration" Version="9.0.6" />
1622
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="9.0.6" />

0 commit comments

Comments
 (0)