-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (45 loc) · 1.81 KB
/
release.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
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Verify commit exists in origin/master
run: git branch --remote --contains | grep origin/master
- name: Set VERSION variable from tag
run: echo "VERSION=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_ENV
- name: Setup .NET Core SDK 3.1
uses: actions/[email protected]
with:
dotnet-version: 3.1.x
- name: Setup .NET Core SDK 6.0
uses: actions/[email protected]
with:
dotnet-version: 6.0.x
- name: Install dependencies
run: dotnet restore
- name: Build Core
run: dotnet build --configuration Release --no-restore PictSharp.Core /p:Version=${VERSION}
- name: Build ImageSharpAdaptor
run: dotnet build --configuration Release --no-restore PictSharp.ImageSharpAdaptor
- name: Test
run: dotnet test PictSharp.Tests --configuration Release /p:Version=${VERSION} --no-restore --verbosity normal
- name: Package PictSharp.Core
run: dotnet pack --configuration Release PictSharp.Core /p:Version=${VERSION} --no-build
- name: Package PictSharp.ImageSharpAdaptor
run: dotnet pack --configuration Release PictSharp.ImageSharpAdaptor /p:Version=${VERSION} --no-build
- name: Push to Github Repository
run: dotnet nuget push */bin/Release/*.nupkg --source https://nuget.pkg.github.com/pgodwin/index.json --api-key ${GITHUB_TOKEN}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Publish the package to nuget.org
run: dotnet nuget push */bin/Release/*.nupkg -k $NUGET_AUTH_TOKEN -s https://api.nuget.org/v3/index.json
env:
NUGET_AUTH_TOKEN: ${{ secrets.NUGET_TOKEN }}