-
Notifications
You must be signed in to change notification settings - Fork 3
51 lines (48 loc) · 1.75 KB
/
deploy.yml
File metadata and controls
51 lines (48 loc) · 1.75 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
47
48
49
50
51
name: Deploy
on:
release:
types: [published]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.x
- name: Retore Workload
run: dotnet workload restore
- name: Restore dependencies
run: dotnet restore
- name: Prepare assembly version
id: version
run: |
VERSION=${{ github.event.release.name }}
echo "assembly=${VERSION%-*}.${{ github.run_number }}" >> "$GITHUB_OUTPUT"
- name: Update project version
uses: vers-one/dotnet-project-version-updater@v1.7
with:
file: "**/*.csproj"
version: ${{ github.event.release.name }}
- name: Update assembly version
uses: vers-one/dotnet-project-version-updater@v1.7
with:
file: "**/AssemblyInfo.cs"
version: ${{ steps.version.outputs.assembly }}
- name: Build Library
run: dotnet build ./Float.Core/Float.Core.csproj --configuration Release --no-restore
- name: Pack
run: dotnet pack --configuration Release --no-restore
- name: Archive artifact
uses: actions/upload-artifact@v4
with:
name: Float.Core.${{ github.event.release.name }}.nupkg
path: ./Float.Core/bin/Release/Float.Core.${{ github.event.release.name }}.nupkg
if-no-files-found: error
- name: Deploy to NuGet
env:
FLOAT_NUGET_TOKEN: ${{ secrets.FLOAT_NUGET_TOKEN }}
run: dotnet nuget push ./Float.Core/bin/Release/Float.Core.${{ github.event.release.name }}.nupkg --api-key "${FLOAT_NUGET_TOKEN}" --source https://api.nuget.org/v3/index.json