-
Notifications
You must be signed in to change notification settings - Fork 29
75 lines (66 loc) · 2.75 KB
/
publish.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: Publish
on:
workflow_dispatch:
inputs:
feed:
description: NuGet feed
required: true
default: Staging
type: choice
options:
- Production
- Staging
jobs:
publish:
name: Test and publish
runs-on: ubuntu-latest
env:
BUILD_CONFIG: Release
WORKING_DIR: src/libp2p
steps:
- name: Check out repository
uses: actions/checkout@v4
with:
submodules: true
- name: Set up .NET
uses: actions/setup-dotnet@v3
- name: Install dependencies
working-directory: ${{ env.WORKING_DIR }}
run: dotnet restore
- name: Build
working-directory: ${{ env.WORKING_DIR }}
run: |
dotnet build -c ${{ env.BUILD_CONFIG }} --no-restore \
-p:Commit=${{ github.sha }} \
-p:VersionSuffix=preview.${{ github.run_number }}
- name: Test
working-directory: ${{ env.WORKING_DIR }}
env:
TEST_OPTS: -c ${{ env.BUILD_CONFIG }} --no-build
run: |
dotnet test Libp2p.Core.Tests ${{ env.PACK_OPTS }}
#dotnet test Libp2p.Protocols.Multistream.Tests ${{ env.PACK_OPTS }}
dotnet test Libp2p.Protocols.Noise.Tests ${{ env.PACK_OPTS }}
dotnet test Libp2p.Protocols.Pubsub.Tests ${{ env.PACK_OPTS }}
dotnet test Libp2p.Protocols.Quic.Tests ${{ env.PACK_OPTS }}
- name: Publish
working-directory: ${{ env.WORKING_DIR }}
env:
PACK_OPTS: -c ${{ env.BUILD_CONFIG }} --no-build -p:VersionSuffix=preview.${{ github.run_number }}
run: |
dotnet pack Libp2p ${{ env.PACK_OPTS }}
dotnet pack Libp2p.Core ${{ env.PACK_OPTS }}
dotnet pack Libp2p.Generators.Protobuf ${{ env.PACK_OPTS }}
dotnet pack Libp2p.Protocols.Identify ${{ env.PACK_OPTS }}
dotnet pack Libp2p.Protocols.IpTcp ${{ env.PACK_OPTS }}
dotnet pack Libp2p.Protocols.MDns ${{ env.PACK_OPTS }}
dotnet pack Libp2p.Protocols.Multistream ${{ env.PACK_OPTS }}
dotnet pack Libp2p.Protocols.Noise ${{ env.PACK_OPTS }}
dotnet pack Libp2p.Protocols.Ping ${{ env.PACK_OPTS }}
dotnet pack Libp2p.Protocols.Plaintext ${{ env.PACK_OPTS }}
dotnet pack Libp2p.Protocols.Pubsub ${{ env.PACK_OPTS }}
dotnet pack Libp2p.Protocols.Quic ${{ env.PACK_OPTS }}
dotnet pack Libp2p.Protocols.Yamux ${{ env.PACK_OPTS }}
dotnet nuget push **/*.nupkg \
-k ${{ github.event.inputs.feed == 'Production' && secrets.NUGET_API_KEY || secrets.NUGETTEST_API_KEY }} \
-s ${{ github.event.inputs.feed == 'Production' && 'https://api.nuget.org/v3/index.json' || 'https://apiint.nugettest.org/v3/index.json' }}