This repository was archived by the owner on Jul 9, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
70 lines (56 loc) · 2.29 KB
/
main.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
name: New Relic Telemetry SDK for .NET
on:
pull_request:
branches: [ main ]
push:
branches: [ main ]
tags:
- 'v*.*.*' # v1.0.0
- 'v*.*.*-*' # v1.0.0-alpha
- '*_v*.*.*' # SomePrefix_v1.0.0
- '*_v*.*.*-*' # SomePrefix_v1.0.0-alpha
workflow_dispatch: # Allows team members to manually kick off a build
jobs:
build-test:
name: Build Test Deploy
runs-on: windows-2019
env:
artifact_staging_path: ${{ github.workspace }}\artifactstaging
solution_file_path: ${{ github.workspace }}\NewRelic.sln
telemetrysdk_path: ${{ github.workspace }}\src\NewRelic.Telemetry\bin\Release\
DOTNET_NOLOGO: true
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Add msbuild to PATH
uses: microsoft/[email protected]
- name: Setup Nuget Add to Path
uses: nuget/[email protected]
with:
nuget-version: '5.x'
- name: Restore
run: dotnet restore ${{ env.solution_file_path }}
shell: powershell
- name: Build
run: dotnet build ${{ env.solution_file_path }} --configuration Release --no-restore -p:Deterministic=true
shell: powershell
- name: Unit Tests - TelemetrySDK
run: dotnet test ${{ github.workspace }}\tests\NewRelic.Telemetry.Tests --no-build --no-restore --configuration Release --logger trx
shell: powershell
- name: Archive the artifacts
uses: actions/upload-artifact@v2
with:
name: my-artifact-${{ github.run_id }}
path: |
${{ env.telemetrysdk_path }}
# This step will only run on a build of master or a tag is created.
- name: Publish Packages to MyGet
if: ${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags') }}
run: |
foreach ($file in Get-ChildItem -Path "${{ env.telemetrysdk_path }}\*" -File -Include *.nupkg) {
nuget push $file.fullname -ApiKey ${{ secrets.MYGET_APIKEY }} -Source https://www.myget.org/F/newrelic/api/v2/package -NoSymbols }
foreach ($file in Get-ChildItem -Path "${{ env.telemetrysdk_path }}\*" -File -Include *.snupkg) {
nuget push $file.fullname -ApiKey ${{ secrets.MYGET_APIKEY }} -Source https://www.myget.org/F/newrelic/api/v3/index.json }
shell: powershell