-
Notifications
You must be signed in to change notification settings - Fork 4
45 lines (35 loc) · 1.13 KB
/
Release.yml
File metadata and controls
45 lines (35 loc) · 1.13 KB
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
name: Snapshot
on:
push:
tags:
- "v*.*.*"
jobs:
build:
runs-on: windows-latest
env:
dotnet-version: '9.0.x'
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup .NET Core SDK ${{ env.dotnet-version }}
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.dotnet-version }}
- name: Test
run: dotnet test -c Release
- name: Create version number
shell: pwsh
run: |
$TAG = $env:GITHUB_REF -replace 'refs/tags/', ''
$VERSION = $TAG -replace '^v', ''
echo "VERSION=$VERSION" >> $env:GITHUB_ENV
- name: Pack
shell: pwsh
run: |
# Use the snapshot version from the previous step
dotnet pack --configuration Release /p:PackageVersion=${{ env.VERSION }}
- name: Publish
shell: pwsh
run: dotnet nuget push "**/*.nupkg" --api-key ${{ secrets.NEXUS_NUGET_APIKEY }} --source "https://www.hec.usace.army.mil/nexus/repository/consequences-nuget-public/" --skip-duplicate