Skip to content

Commit abce0bb

Browse files
committed
Introducing a GitHub Actions script for releasing the libraries to Nuget.org
1 parent b13714b commit abce0bb

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

.github/workflows/release.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: "Webhooks Release"
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
build:
9+
10+
runs-on: ubuntu-20.04
11+
12+
steps:
13+
- uses: actions/checkout@v3
14+
15+
- name: Set VERSION variable from tag
16+
run: |
17+
TAG=${{ github.event.release.tag_name }}
18+
echo "VERSION=${TAG#v}" >> $GITHUB_ENV
19+
20+
- name: Setup .NET 6.0
21+
uses: actions/setup-dotnet@v3
22+
with:
23+
dotnet-version: 6.0.x
24+
25+
- name: Add Deveel GitHub NuGet Source
26+
run: dotnet nuget add source "https://nuget.pkg.github.com/deveel/index.json" -n "Deveel GitHub" -u ${{ secrets.DEVEEL_NUGET_USER }} -p ${{ secrets.DEVEEL_NUGET_TOKEN }} --store-password-in-clear-text
27+
28+
- name: Restore dependencies
29+
run: dotnet restore
30+
31+
- name: Build
32+
run: dotnet build --no-restore -c Release /p:Version=$VERSION
33+
34+
- name: Test
35+
run: dotnet test --no-build --verbosity normal -c Release /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:Exclude="[*.XUnit]*"
36+
37+
- name: Collect to Codecov
38+
uses: codecov/codecov-action@v3
39+
with:
40+
token: ${{ secrets.OCM_CODECOV_TOKEN }}
41+
42+
- name: Pack
43+
run: dotnet pack --configuration Release --no-restore --no-build --include-symbols -p:PackageVersion=$VERSION --output ./nuget
44+
45+
- name: Push Packages to GitHub NuGet
46+
47+
run: dotnet nuget push ./nuget/**/*.nupkg --skip-duplicate --api-key ${{secrets.NUGET_API_KEY}} --source https://api.nuget.org/v3/index.json

0 commit comments

Comments
 (0)