-
Notifications
You must be signed in to change notification settings - Fork 1
52 lines (51 loc) · 1.72 KB
/
TheAnswer.Myget.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
name: WrapThat.TheAnswer.Myget
on:
push:
branches:
- 'main'
workflow_dispatch:
inputs:
logLevel:
description: 'Log level'
required: true
default: 'warning'
tags:
description: 'Test scenario tags'
defaults:
run:
shell: pwsh
jobs:
publish:
name: Build, pack & publish
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-version: '6.0.x'
- name: Install dependencies
run: dotnet restore
- name: Build
run: dotnet build --configuration Release --no-restore --verbosity normal
# Publish
# Create the NuGet package in the package folder
- name: Pack
run: dotnet pack --configuration Release --no-build --output package
# Publish the NuGet package as an artifact, so they can be used in the following jobs
#- uses: actions/upload-artifact@v3
# with:
# name: nuget
# if-no-files-found: error
# retention-days: 7
# path: ${{ package}}/*.nupkg
- name: Publish nupkg and snupkg to NuGet.org
run: |
foreach($file in (Get-ChildItem package -Recurse -Include *.nupkg)) {
dotnet nuget push $file --api-key "${{ secrets.WRAPTHATMYGET }}" --source https://www.myget.org/F/hermit/api/v3/index.json --skip-duplicate
}
foreach($file in (Get-ChildItem "package" -Recurse -Include *.snupkg)) {
dotnet nuget push $file --api-key "${{ secrets.WRAPTHATMYGET }}" --source https://www.myget.org/F/hermit/api/v3/index.json --skip-duplicate
}