-
Notifications
You must be signed in to change notification settings - Fork 7
132 lines (108 loc) · 3.31 KB
/
build.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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
name: "CI"
on:
push:
pull_request:
workflow_dispatch:
jobs:
build_and_test:
name: Build & Test on ${{ matrix.OS_NAME }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: windows-latest
OS_NAME: win-x64
- os: ubuntu-latest
OS_NAME: linux-x64
- os: macos-latest
OS_NAME: osx-arm64
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.0.x
7.0.x
8.0.x
- name: Restore Dependencies
run: dotnet restore
- name: Build Project
run: dotnet build -c Release --no-restore
- name: Test Project
run: dotnet test --configuration Release --no-build --verbosity normal --logger:"console;verbosity=normal"
- name: Pack Project
run: dotnet pack src/DxFeed.Graal.Net -c Release
release:
needs: build_and_test
if: (startsWith(github.event.ref, 'refs/tags/'))
name: Release
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.0.x
7.0.x
8.0.x
- name: Publish
run: |
dotnet tool install -g dotnet-script
dotnet script publish.csx
shell: bash
- name: Upload
uses: softprops/action-gh-release@v1
with:
generate_release_notes: true
files: |
artifacts/Publish/DxFeed.Graal.Net.Tools/*.zip
artifacts/Publish/Samples/*.zip
token: ${{ secrets.GITHUB_TOKEN }}
- name: Pack NuGet
run: dotnet pack src/DxFeed.Graal.Net -c Release --property:PackageOutputPath=${{ github.workspace }}/artifacts/Packages
- name: Upload NuGet
run: |
nuget push artifacts/Packages/DxFeed.Graal.Net.${{ github.ref_name }}.nupkg \
-Source ${{ secrets.JFROG_PATH }}/${{ github.ref_name }} \
-ApiKey ${{ secrets.JFROG_API_KEY }}
shell: bash
build_and_upload_docs:
needs: release
if: (startsWith(github.event.ref, 'refs/tags/'))
name: Build & Upload Docs
runs-on: windows-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
8.0.x
- name: Restore Dependencies
run: dotnet restore
- name: Build Project
run: dotnet build -c Release --no-restore
- name: Install DocFX
run: dotnet tool update -g docfx
- name: Prepare Tag
id: prepare_tag
if: startsWith(github.ref, 'refs/tags/')
run: |
echo "DEPLOY_TAG_NAME=deploy-${TAG_NAME}" >> "${GITHUB_OUTPUT}"
- name: Build Doc
run: ./build_doc.cmd
- name: Upload Doc
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: artifacts/Documentation
tag_name: ${{ steps.prepare_tag.outputs.DEPLOY_TAG_NAME }}
commit_message: 'deploy: ${{ github.ref_name }}'
allow_empty_commit: true