-
-
Notifications
You must be signed in to change notification settings - Fork 155
236 lines (202 loc) Β· 6.23 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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
ο»Ώname: 'Build'
env:
VERSION: 5.0.2
PACKAGE_SUFFIX: '-pre.1'
# PACKAGE_SUFFIX: ''
ASM_VERSION: 5.0.0
DOC_INSTANCE: wrs/pq
DOC_ARTIFACT: webHelpPQ2-all.zip
DOC_ALGOLIA_ARTIFACT: algolia-indexes-PQ.zip
DOC_DOCKER_VERSION: 241.15989
# Gives the workflow permissions to clone the repo and create a page deployment
permissions:
id-token: write
pages: write
on:
push:
branches:
- master
pull_request:
branches:
- master
workflow_dispatch:
jobs:
test:
name: π§ͺ Unit Tests - ${{ matrix.name }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
name: Linux x64
- os: windows-latest
name: Windows x64
- os: windows-latest
name: Windows x86
runtime: win-x86
- os: macos-latest
name: MacOS ARM64
fail-fast: false
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.0.x
8.0.x
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install Python dependencies
run: pip install pyarrow pandas
# only run this step if matrix.runtime is empty
- name: 'test on ${{ matrix.runtime }}'
if: matrix.arch == ''
run: dotnet test src/Parquet.sln -c release
# only run this step if matrix.arch is not empty
- name: 'test on ${{ matrix.runtime }}'
if: matrix.arch != ''
run: dotnet test src/Parquet.sln -c release -r ${{ matrix.runtime }}
build:
runs-on: 'ubuntu-latest'
name: 'ποΈ Build NuGet'
steps:
- run: |
echo head_ref: ${{ github.head_ref }}
echo run id: ${{ github.run_id }}
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.0.x
8.0.x
- name: Build Library
run: |
envsubst < src/Parquet/Globals.cs > g.tmp && mv g.tmp src/Parquet/Globals.cs
cat src/Parquet/Globals.cs
dotnet build src/Parquet.sln -c release /p:Version=${{ env.VERSION }}${{ env.PACKAGE_SUFFIX }} /p:FileVersion=$VERSION /p:AssemblyVersion=$ASM_VERSION
- name: collect artifacts
run: |
mkdir artifacts
cp src/Parquet/bin/Release/*.nupkg artifacts/
cp docs/rn/${{ env.VERSION }}.md artifacts/release-notes.md
- uses: actions/upload-artifact@v4
name: upload artifacts
with:
name: bin
path: artifacts/*
floor-build:
runs-on: ubuntu-latest
name: 'π€ Build Floor'
strategy:
matrix:
rid:
- linux-x64
- linux-musl-x64
- linux-musl-arm64
- win-x64
- osx-x64
- osx-arm64
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
8.0.x
- name: Build
env:
LATEST_NET_ONLY: true
run: |
envsubst < src/Parquet/Globals.cs > g.tmp && mv g.tmp src/Parquet/Globals.cs
dotnet restore src/Parquet.Floor/Parquet.Floor.csproj
dotnet publish src/Parquet.Floor/Parquet.Floor.csproj -c release -r ${{ matrix.rid }} -o floor-pub/${{ matrix.rid }} /p:Version=${{ env.VERSION }}${{ env.PACKAGE_SUFFIX }} /p:FileVersion=${{ env.VERSION }} /p:AssemblyVersion=${{ env.ASM_VERSION }}
mkdir -p floor-dist
zip -r -9 -j floor-dist/floor-${{ matrix.rid }}-${{ env.VERSION }}.zip floor-pub/${{ matrix.rid }}/* -x *.pdb *.xml
- uses: actions/upload-artifact@v4
name: upload binary
if: github.ref == 'refs/heads/master'
with:
name: floor-${{ matrix.rid }}
path: floor-dist/*.zip
if-no-files-found: error
compression-level: 9
retention-days: 1
wrs:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master'
name: 'π Writerside docs'
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Build Writerside docs
uses: JetBrains/writerside-github-action@v4
with:
instance: ${{ env.DOC_INSTANCE }}
artifact: ${{ env.DOC_INSTANCE }}
docker-version: ${{ env.DOC_DOCKER_VERSION }}
- name: π€ Unzip artifact
run: unzip -O UTF-8 artifacts/${{ env.DOC_ARTIFACT }} -d dir
- name: Setup Pages
uses: actions/configure-pages@v2
- name: Upload artifact to GH Pages
uses: actions/upload-pages-artifact@v1
with:
path: dir
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
release:
name: 'π Release library'
runs-on: ubuntu-latest
needs:
- test
- build
if: github.ref == 'refs/heads/master'
steps:
- name: β¬οΈ Download Library binaries
uses: actions/download-artifact@v4
with:
name: bin
path: bin
- name: print release notes
run: cat bin/release-notes.md
- name: π¦ Publish to NuGet
run: dotnet nuget push bin/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate
release-all:
name: 'π Make GitHub Release'
runs-on: ubuntu-latest
needs:
- release
- floor-build
if: github.ref == 'refs/heads/master'
steps:
- name: β¬οΈ Download Library binaries
uses: actions/download-artifact@v4
with:
name: bin
path: bin
- name: β¬οΈ Download Floor binaries
uses: actions/download-artifact@v4
with:
pattern: floor-*
path: floor
merge-multiple: true
- name: π view artifacts to be used
run: ls -R
working-directory: .
# https://github.com/softprops/action-gh-release
- name: π’ Create release
uses: softprops/action-gh-release@v1
if: ${{ !env.PACKAGE_SUFFIX }}
with:
tag_name: ${{ env.VERSION }}
name: ${{ env.VERSION }}
files: |
bin/*.nupkg
floor/*.zip
body_path: bin/release-notes.md