-
Notifications
You must be signed in to change notification settings - Fork 4
79 lines (72 loc) · 2.14 KB
/
release_unstable.yml
File metadata and controls
79 lines (72 loc) · 2.14 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
name: Release_Unstable
on:
push:
tags:
- "*.*.*-beta*"
- "*.*.*-rc*"
jobs:
build_artifact:
name: Build and upload artifact
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET SDK 6.0.x - 10.0.x
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
10.0.x
9.0.x
8.0.x
7.0.x
6.0.x
- name: Build with dotnet
run: dotnet build --configuration Release DisposeScope.sln -p:CheckEolTargetFramework=false
- name: Pack with dotnet
env:
VERSION: ${{ github.ref_name }}
run: dotnet pack DisposeScope.sln -p:PackageVersion=$VERSION -o ./nugetpkgs -c Release --no-build
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: nugetpkgs
path: ./nugetpkgs
release_nuget:
name: Release to Nuget
needs: build_artifact
runs-on: ubuntu-latest
steps:
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: nugetpkgs
path: .
- name: Debug downloaded artifacts
shell: bash
run: |
set -e
echo "PWD: $(pwd)"
echo "Top-level:"
ls -la
echo "NUPKG files:"
ls -la *.nupkg || true
- name: Release
shell: bash
run: |
set -e
shopt -s nullglob
# All non-library projects should have IsPackable=false, so we can push everything we packed.
files=( *.nupkg )
if [ ${#files[@]} -eq 0 ]; then
echo "No .nupkg files found in workspace root."
exit 1
fi
for file in "${files[@]}"; do
case "$file" in
*.snupkg|*symbols*.nupkg)
echo "Skipping: $file"
continue
;;
esac
echo "Pushing: $file"
dotnet nuget push "$file" -k "${{ secrets.NUGET_API_KEY }}" --skip-duplicate -s https://www.nuget.org/api/v2/package
done