-
Notifications
You must be signed in to change notification settings - Fork 3
46 lines (42 loc) · 1.37 KB
/
Copy pathnuget.yaml
File metadata and controls
46 lines (42 loc) · 1.37 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
46
name: 'NuGet'
on:
release:
types: [published]
jobs:
build:
runs-on: ubuntu-latest
env:
BUILD_CONFIG: 'Release'
steps:
# - name: Dump env
# run: env | sort
# - name: Dump GitHub context
# env:
# GITHUB_CONTEXT: ${{ toJson(github) }}
# run: echo "$GITHUB_CONTEXT"
- uses: actions/checkout@v7
- name: Setup .NET
uses: actions/setup-dotnet@v6
with:
dotnet-version: 8.0.x
- name: Set VERSION variable from tag
run: |
assemblyversion=$(echo ${{ github.event.release.tag_name }} | cut -d- -f1 | cut -dv -f2)
echo "ASSEMBLYVERSION=${assemblyversion}" >> $GITHUB_ENV
version=$(echo ${{ github.event.release.tag_name }} | cut -dv -f2)
echo "VERSION=${version}" >> $GITHUB_ENV
- name: Build
working-directory: ./src
run: dotnet build --configuration Release /p:AssemblyVersion=${ASSEMBLYVERSION} /p:Version=${VERSION}
- name: Test
working-directory: ./src
run: dotnet test --no-build
- name: Pack
working-directory: ./src
run: dotnet pack --configuration Release /p:Version=${VERSION} --no-build --output .
- uses: actions/upload-artifact@v7
if: success() || failure()
with:
name: nuget-artifact
path: '**/*.nupkg'
retention-days: 1