-
Notifications
You must be signed in to change notification settings - Fork 3
102 lines (84 loc) · 2.52 KB
/
publish.yml
File metadata and controls
102 lines (84 loc) · 2.52 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
name: Publish NuGet.org
on:
push:
branches:
- master
paths-ignore:
- '.github/workflows/**'
- '**.md'
- '**.docx'
- '**.bat'
- '**.vssettings'
workflow_dispatch: # ручной запуск сценария
env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_NOLOGO: true
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: 10.0.x
- name: Cache NuGet
uses: actions/cache@v5
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
restore-keys: |
${{ runner.os }}-nuget
- name: Building
run: |
dotnet build MathCore -c Release
dotnet build Tests/MathCore.Tests -c Release
- name: Test
run: dotnet test Tests/MathCore.Tests -c Release --no-build
- name: Packing
run: dotnet pack MathCore -c Release --no-build -v q -o ${{ github.workspace }}/ReleasePack --include-symbols
- name: Upload build artifacts
uses: actions/upload-artifact@v6.0.0
with:
name: Release
path: ${{ github.workspace }}/ReleasePack
retention-days: 1
nuget:
name: NuGet
needs: [build]
runs-on: ubuntu-latest
steps:
- name: Get artifact
uses: actions/download-artifact@v7
id: download
with:
name: Release
path: ${{ github.workspace }}/ReleasePack
- name: Upload to NuGet
run: dotnet nuget push "**/*.nupkg" -k ${{ secrets.NuGetApiKey }} --skip-duplicate -s https://api.nuget.org/v3/index.json
github:
name: GitHub
needs: [build]
runs-on: ubuntu-latest
steps:
- name: Get artifact
uses: actions/download-artifact@v7
id: download
with:
name: Release
path: ${{ github.workspace }}/ReleasePack
- name: Upload to GitHub
run: dotnet nuget push "**/*.nupkg" --skip-duplicate -s https://nuget.pkg.github.com/Infarh/index.json -k ${{secrets.GITHUB_TOKEN}}
clean:
name: Clean artifact
needs: [nuget, github]
runs-on: ubuntu-latest
steps:
- name: Delete artefact
uses: geekyeggo/delete-artifact@v5
with:
name: Release