-
Notifications
You must be signed in to change notification settings - Fork 22
38 lines (30 loc) · 907 Bytes
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
name: Release
on:
create:
branches:
- 'release/*'
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up .NET Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: '9.x.x' # You can adjust the version if needed
- name: Build
run: |
version=$(echo "${{ github.ref }}" | sed 's/refs\/heads\/release\///')
echo $version
dotnet restore
dotnet build --configuration Release -p:Version=$version
- name: Push
run: |
packages=$(find . -name '*.nupkg')
echo ${{ steps.extract-version.outputs.version }}
for package in $packages; do
dotnet nuget push $package --source https://api.nuget.org/v3/index.json --api-key $NUGET_API_KEY
done
env:
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}