-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (44 loc) · 1.53 KB
/
main.yaml
File metadata and controls
48 lines (44 loc) · 1.53 KB
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
on:
push:
branches:
- main
tags:
- "*"
pull_request:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0 # needed for gitversion, checks out all branches and tags
- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v0.9.7
with:
versionSpec: '5.x'
- name: Use GitVersion
id: gitversion # step id used as reference for output values
uses: gittools/actions/gitversion/execute@v0.9.7
- name: Build solution
run: dotnet build --configuration Release src/ScriptVerifier.sln
- name: Create the package
run: dotnet pack --configuration Release --no-build src/ScriptVerifier.sln -o Artifacts/Packages
- name: Upload Artifact
uses: actions/upload-artifact@v2
if: startsWith(github.ref, 'refs/tags/v')
with:
name: nupkg
path: 'Artifacts/Packages/**/*.nupkg'
- name: Publish to nuget.org
run: dotnet nuget push Artifacts/Packages/**/*.nupkg --api-key ${{secrets.NUGET_ORG_API_KEY}} -s https://api.nuget.org/v3/index.json --skip-duplicate
if: startsWith(github.ref, 'refs/tags/v')
- name: Publish to github packages
run: |
for f in Artifacts/Packages/*.nupkg
do
echo "Uploading package: $f"
curl -vX PUT -u "user:${{secrets.GITHUB_TOKEN}}" -F package=@$f https://nuget.pkg.github.com/vescon/
done
shell: bash
if: startsWith(github.ref, 'refs/tags/v')