-
Notifications
You must be signed in to change notification settings - Fork 23
67 lines (55 loc) · 1.59 KB
/
dotnet.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
name: Build, Pack & Publish
on:
push:
branches:
- '*'
tags:
- 'v*'
pull_request:
branches:
- '*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
submodules: true
- name: Install .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.*
source-url: https://api.nuget.org/v3/index.json
env:
NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
- name: Download libraries
run: ./download_package.sh
- name: Build
run: dotnet build src/PDFiumCore -c Release
- name: Pack
run: dotnet pack src/PDFiumCore -c Release -o ./artifacts
- name: Unit tests
run: dotnet test src/PDFiumCore.Tests -c Release
- name: Export artifacts
uses: actions/upload-artifact@v2
with:
path: |
artifacts/*.nupkg
artifacts/*.snupkg
- name: Get tag name
if: startsWith(github.ref, 'refs/tags/')
uses: olegtarasov/[email protected]
id: tagName
- name: Create release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
name: "PDFiumCore ${{ steps.tagName.outputs.tag }} Released"
files: |
artifacts/*.nupkg
artifacts/*.snupkg
- name: Push Nuget packages
if: startsWith(github.ref, 'refs/tags/')
run: dotnet nuget push artifacts/*.nupkg --api-key ${{ secrets.ORG_NUGET_AUTH_TOKEN }} --skip-duplicate