-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (46 loc) · 1.56 KB
/
pack.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
# thanks to https://github.com/SierraSoftworks/sierralib.api.views/blob/master/.github/workflows/package.yml for helping me figure this out
# GitHub's own documentation was a bit lacking.
name: Publish to NuGet
on:
release:
types: [created]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout the project
uses: actions/checkout@master
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: '8.0.x'
- name: Setup nuget
uses: nuget/setup-nuget@v1
with:
nuget-version: 'latest'
- name: Test the package
run: dotnet test
env:
RELEASE_VERSION: ${{ github.event.release.tag_name }}
- name: Pack the thing up
run: |
cd CSharp.Nixill/
dotnet pack -o out
env:
RELEASE_VERSION: ${{ github.event.release.tag_name }}
- name: Push to github release
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./CSharp.Nixill/out/Nixill.${{ github.event.release.tag_name }}.nupkg
asset_name: Nixill.${{ github.event.release.tag_name }}.nupkg
asset_content_type: application/zip
- name: Push to nuget.org
run: |
cd CSharp.Nixill
for f in ./out/*.nupkg
do
dotnet nuget push $f --api-key ${{ secrets.NUGET_TOKEN }} --source https://api.nuget.org/v3/index.json
done