-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (36 loc) · 1.18 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
name: Publish NuGet Package
on:
push:
tags:
- 'v*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Setup .NET SDK
uses: actions/setup-dotnet@v3
with:
global-json-file: 'global.json'
- name: Restore dependencies
run: dotnet restore
working-directory: ImageSize
- name: Build
run: dotnet build --no-restore
working-directory: ImageSize
- name: Test
run: dotnet test --no-build --verbosity normal
working-directory: ImageSize
- name: Extract version
id: get_version
run: echo "::set-output name=version::$(echo ${GITHUB_REF#refs/tags/v})"
- name: Pack
run: dotnet pack -c Release -o out /p:PackageVersion=${{ steps.get_version.outputs.version }}
working-directory: ImageSize
- name: Push to NuGet
run: dotnet nuget push ImageSize/ImageSize/bin/Release/*.nupkg -k ${GITHUB_TOKEN} -s https://nuget.pkg.github.com/dorucioclea/index.json --skip-duplicate --no-symbols true
working-directory: ImageSize
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}