-
Notifications
You must be signed in to change notification settings - Fork 0
88 lines (87 loc) · 2.72 KB
/
nuget.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
name: NuGet
on:
push:
tags:
- '**'
jobs:
package:
runs-on: windows-latest
env:
DOTNET_NOLOGO: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
fetch-depth: 0
- name: Pre-build Install
uses: actions/setup-dotnet@v1.8.0
with:
dotnet-version: '5.0.202'
- name: Build package
run: scripts\pack
- name: Save package
uses: actions/upload-artifact@v2.2.3
with:
name: Fornax.Seo.nupkg
path: ${{ github.workspace }}/release/*.nupkg
retention-days: 30
if-no-files-found: error
publish:
needs: package
runs-on: ubuntu-20.04
env:
DOTNET_NOLOGO: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
fetch-depth: 0
- name: Pre-build Install
uses: actions/setup-dotnet@v1.8.0
with:
dotnet-version: '5.0.202'
- name: Cache packages
uses: actions/cache@v2.1.6
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('src/Fornax.Seo/Directory.Build.props') }}
restore-keys: |-
${{ runner.os }}-nuget-
${{ runner.os }}-
- name: Collect release info
run: |-
echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
echo -e $(scripts/changelog) > release_notes.txt
- name: Retrieve package
uses: actions/download-artifact@v2.0.9
id: fetch
with:
name: Fornax.Seo.nupkg
path: ${{ github.workspace }}/release
- name: Prepare release
uses: ncipollo/release-action@v1
with:
artifacts: ${{ steps.fetch.outputs.download-path }}/*.nupkg
bodyFile: release_notes.txt
name: ${{ env.RELEASE_VERSION }}
draft: true
allowUpdates: true
artifactErrorsFailBuild: true
replacesArtifacts: true
token: ${{ secrets.GITHUB_TOKEN }}
- name: Publish release
run: |-
dotnet nuget push release/Fornax.Seo.*.nupkg -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json --skip-duplicate
CI=true scripts/gendocs
- name: Publish docs
uses: peaceiris/actions-gh-pages@v3.8.0
with:
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
enable_jekyll: false
publish_dir: './output'
publish_branch: api
user_name: 'Fornax.Seo [action]'
user_email: 'Fornax.Seo@users.noreply.github.com'
commit_message: '${{ github.event.head_commit.message }}'