-
Notifications
You must be signed in to change notification settings - Fork 71
44 lines (41 loc) · 1.65 KB
/
Release.yml
File metadata and controls
44 lines (41 loc) · 1.65 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
name: Release
on:
release:
types: [published]
jobs:
CSharpMath:
runs-on: windows-latest
steps:
- uses: actions/checkout@v6
with:
submodules: 'recursive'
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: '10.x'
- name: Build GitHub Releases draft artifacts
env:
RELEASE_NOTES: |
# ${{ github.event.release.name }}
${{ github.event.release.body }}
run: |
# .NET Core MSBuild cannot parse , and ; correctly so we replace them with substitutions: https://github.com/dotnet/msbuild/issues/471#issuecomment-366268743
# PowerShell string replacement
$env:RELEASE_NOTES = $env:RELEASE_NOTES -replace ',','%2C' -replace ';','%3B'
dotnet workload restore
# -r for restore
dotnet msbuild -r -p:Configuration=Release -p:PackageVersion="${{ github.event.release.tag_name }}" -p:PackageReleaseNotes="$env:RELEASE_NOTES" CSharpMath.sln
shell: pwsh
- name: Upload to GitHub Releases
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref }}
file: .nupkgs/*
file_glob: true
overwrite: true
- name: Upload to NuGet
run: | # We use double quotes to avoid shell globbing: https://github.com/NuGet/Home/issues/4393#issuecomment-667618120
# Use --skip-duplicate since we want re-runs of this workflow to succeed in case of network issues
dotnet nuget push ".nupkgs/*.nupkg" -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json --skip-duplicate
shell: pwsh