forked from agc93/nexus-uploader
-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (47 loc) · 1.39 KB
/
build.yml
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
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: Nexus Uploader CI Build
on:
push:
branches: [ master ]
paths-ignore:
- "docs/**"
- ".github/workflows/docs.yml"
tags:
- 'v*.*.*'
pull_request:
branches: [ master ]
paths-ignore:
- "docs/**"
- ".github/workflows/docs.yml"
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.x.x
7.x.x
8.x.x
- name: Build
run: >-
dotnet build src/BUTR.NexusUploader.sln --configuration Release;
shell: pwsh
- name: Pack
run: >-
dotnet pack src/BUTR.NexusUploader.sln --configuration Release -o "./packages";
shell: pwsh
- name: Push to NuGet
run: dotnet nuget push "./packages/*.nupkg" -k ${{secrets.NUGET_TOKEN}} -s https://www.nuget.org
shell: pwsh
- name: Push to GPR
run: |
for f in ./packages/*.nupkg
do
curl -vX PUT -u "vslee:${{secrets.GITHUB_TOKEN}}" -F package=@$f https://nuget.pkg.github.com/BUTR/
done
shell: bash