-
Notifications
You must be signed in to change notification settings - Fork 3
46 lines (44 loc) · 1.65 KB
/
dotnet.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
name: .NET
on:
push:
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x
- name: Build
run: dotnet build codesign
- name: Test (MachO)
run: dotnet test Melanzana.MachO.Tests
- name: Test (CodeSign)
run: dotnet test Melanzana.CodeSign.Tests
- name: Create NuGet packages
run: |
dotnet pack -c Release Melanzana.Streams -o nuget/
dotnet pack -c Release Melanzana.MachO -o nuget/
dotnet pack -c Release Melanzana.CodeSign -o nuget/
- name: Get version information
uses: dotnet/nbgv@master
id: nbgv
- name: Publish NuGet packages as artifacts
uses: actions/upload-artifact@v3
with:
name: melanzana-${{ steps.nbgv.outputs.SemVer2 }}
path: nuget/
- name: Publish NuGet packages to GitHub NuGet feed
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
run: |
dotnet nuget add source --username USERNAME --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json"
dotnet nuget push "nuget/*.nupkg" --api-key ${{ secrets.GITHUB_TOKEN }} --source "github"
- name: Publish NuGet packages to NuGet.org feed
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
run: |
dotnet nuget push "nuget/*.nupkg" -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json