-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (54 loc) · 1.92 KB
/
dotnetcore.yml
File metadata and controls
67 lines (54 loc) · 1.92 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
name: "Build and publish Nuget package"
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
env:
NETCORE_VERSION: '10.0.x'
PRIVATE_NUGET_PATH: 'https://nuget.pkg.github.com/bigbadjock/index.json'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup .NET Core ${{ env.NETCORE_VERSION }}
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ env.NETCORE_VERSION }}
- name: Create NuGet config for GitHub Packages
run: |
cat <<EOF > ./nuget.config
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<clear />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
<add key="bigbadjock-github" value="https://nuget.pkg.github.com/bigbadjock/index.json" />
</packageSources>
<packageSourceCredentials>
<bigbadjock-github>
<add key="Username" value="bigbadjock" />
<add key="ClearTextPassword" value="${{ secrets.NUGET_TOKEN }}" />
</bigbadjock-github>
</packageSourceCredentials>
</configuration>
EOF
- name: Restore
run: dotnet restore ./SilverCodeAPI.sln
- name: Build
run: dotnet build ./SilverCodeAPI.sln --configuration Release --no-restore
- name: Pack
run: dotnet pack ./SilverCodeAPI.sln --configuration Release -o finalpackage --no-build
- name: Publish
uses: actions/upload-artifact@v4.0.0
with:
name: REST-Parser
path: finalpackage
- name: Push Nupkg to GitHub Packages
uses: tanaka-takayoshi/nuget-publish-to-github-packages-action@v2.1
with:
nupkg-path: './finalpackage/*.nupkg'
repo-owner: bigbadjock
gh-user: bigbadjock
token: ${{secrets.GITHUB_TOKEN}}