forked from neo-project/neo
-
-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (39 loc) · 1.17 KB
/
nuget.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
39
40
41
42
43
44
45
46
name: Release (nuget)
# Trigger the workflow on a release event when a new release is published
on:
release:
types: [published]
# Define environment variables
env:
DOTNET_VERSION: 9.0.x
CONFIGURATION: Release
jobs:
nuget-release:
runs-on: ubuntu-latest
steps:
# Step to set the application version from the release tag
- name: Set Application Version (Environment Variable)
run: |
APP_VERSION=$(echo '${{ github.event.release.tag_name }}' | cut -d 'v' -f 2)
echo "APP_VERSION=$APP_VERSION" >> $GITHUB_ENV
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Pack NuGet Packages
run: |
dotnet pack ./neo.sln \
--configuration Release \
--output ./sbin \
--verbosity normal \
-p:VersionPrefix=${{ env.APP_VERSION }}
- name: Publish to NuGet.org
run: |
dotnet nuget push ./sbin/*.nupkg \
--source https://api.nuget.org/v3/index.json \
--api-key ${{ secrets.NUGET_TOKEN }} \
--skip-duplicate