-
-
Notifications
You must be signed in to change notification settings - Fork 8
93 lines (74 loc) · 2.38 KB
/
ci.yml
File metadata and controls
93 lines (74 loc) · 2.38 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
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
89
90
91
92
93
name: CI
on: [push, pull_request]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
DOCS_PATH: ${{ secrets.DOCS_PATH }}
DOCS_BRANCH: ${{ secrets.DOCS_BRANCH }}
jobs:
can_document:
runs-on: ubuntu-latest
outputs:
value: ${{ steps.check_job.outputs.value }}
steps:
- name: Checks whether documentation can be built
id: check_job
run: |
echo "value: ${{ env.DOCS_PATH != null && github.ref == env.DOCS_BRANCH }}"
echo "value=${{ env.DOCS_PATH != null && github.ref == env.DOCS_BRANCH }}" >> "${GITHUB_OUTPUT}"
documentation:
needs: [can_document]
runs-on: ubuntu-latest
if: needs.can_document.outputs.value == 'true'
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: "14.x"
registry-url: 'https://registry.npmjs.org'
- name: Install Dependencies
run: |
cd $DOCS_PATH
npm install
- name: Deploy Doclet
run: |
cd $DOCS_PATH
npx pilet publish --fresh --url https://feed.piral.cloud/api/v1/pilet/anglesharp --api-key ${{ secrets.PIRAL_FEED_KEY }}
linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.0.x
7.0.x
8.0.x
- name: Build
run: dotnet build src/AngleSharp.Diffing.sln --configuration Release
- name: Test
run: dotnet test src/AngleSharp.Diffing.sln --configuration Release --no-build
windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Setup dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.0.x
7.0.x
8.0.x
- name: Build
run: dotnet build src/AngleSharp.Diffing.sln --configuration Release
- name: Test
run: dotnet test src/AngleSharp.Diffing.sln --configuration Release --no-build
- name: Publish to NuGet
if: github.ref == 'refs/heads/main'
run: |
if ($env:NUGET_API_KEY) {
dotnet pack src/AngleSharp.Diffing.sln --configuration Release --no-build --output nupkgs
dotnet nuget push "nupkgs/*.nupkg" --api-key $env:NUGET_API_KEY --source https://api.nuget.org/v3/index.json --skip-duplicate
}