-
Notifications
You must be signed in to change notification settings - Fork 2k
459 lines (445 loc) · 17 KB
/
publish.yml
File metadata and controls
459 lines (445 loc) · 17 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
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
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
name: Publish
permissions:
contents: read
on:
workflow_call:
inputs:
git_ref:
type: string
required: true
# channel is the dir/namespace packages are organized into.
# Options are release/nightly/custom.
channel:
type: string
required: true
env:
VERBOSE: true
CI: true
DISABLE_MOLD: true
DEBIAN_FRONTEND: noninteractive
CONTAINER_TOOL: docker
CARGO_PROFILE_RELEASE_LTO: fat
CARGO_PROFILE_RELEASE_CODEGEN_UNITS: 1
CHANNEL: ${{ inputs.channel }}
jobs:
generate-publish-metadata:
name: Generate Publish-related Metadata
runs-on: ubuntu-24.04
timeout-minutes: 5
outputs:
vector_version: ${{ steps.generate-publish-metadata.outputs.vector_version }}
vector_build_desc: ${{ steps.generate-publish-metadata.outputs.vector_build_desc }}
vector_release_channel: ${{ steps.generate-publish-metadata.outputs.vector_release_channel }}
steps:
- name: Checkout Vector
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: ${{ inputs.git_ref }}
- name: Generate publish metadata
id: generate-publish-metadata
run: make ci-generate-publish-metadata
build-linux-packages:
name: Build Vector for ${{ matrix.target }}
runs-on: release-builder-linux
timeout-minutes: 60
needs: generate-publish-metadata
env:
VECTOR_VERSION: ${{ needs.generate-publish-metadata.outputs.vector_version }}
VECTOR_BUILD_DESC: ${{ needs.generate-publish-metadata.outputs.vector_build_desc }}
CHANNEL: ${{ needs.generate-publish-metadata.outputs.vector_release_channel }}
strategy:
matrix:
include:
- target: x86_64-unknown-linux-musl # .tar.gz
- target: x86_64-unknown-linux-gnu # .tar.gz, .deb, .rpm
- target: aarch64-unknown-linux-musl # .tar.gz
- target: aarch64-unknown-linux-gnu # .tar.gz, .deb, .rpm
- target: armv7-unknown-linux-gnueabihf # .tar.gz, .deb, .rpm
- target: armv7-unknown-linux-musleabihf # .tar.gz
- target: arm-unknown-linux-gnueabi # .tar.gz, .deb
- target: arm-unknown-linux-musleabi # .tar.gz
steps:
- name: Checkout Vector
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: ${{ inputs.git_ref }}
- name: Bootstrap runner environment (Ubuntu-specific)
run: sudo -E bash scripts/environment/bootstrap-ubuntu-24.04.sh
- name: Bootstrap runner environment (generic)
run: bash scripts/environment/prepare.sh --modules=rustup,cross,cargo-deb
- name: Build Vector
run: make package-${{ matrix.target }}-all
- name: Stage package artifacts for publish
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: vector-${{ env.VECTOR_VERSION }}-${{ matrix.target }}
path: target/artifacts/vector*
build-apple-darwin-packages:
name: Build Vector for ${{ matrix.architecture }}-apple-darwin (.tar.gz)
runs-on: ${{ matrix.runner }}
timeout-minutes: 90
needs: generate-publish-metadata
env:
VECTOR_VERSION: ${{ needs.generate-publish-metadata.outputs.vector_version }}
VECTOR_BUILD_DESC: ${{ needs.generate-publish-metadata.outputs.vector_build_desc }}
CHANNEL: ${{ needs.generate-publish-metadata.outputs.vector_release_channel }}
strategy:
matrix:
include:
# Refer to https://docs.github.com/en/actions/using-github-hosted-runners/using-larger-runners/about-larger-runners#about-macos-larger-runners.
# and to https://github.com/actions/runner-images
- architecture: arm64
runner: macos-14-xlarge
steps:
- name: Verify Runner Architecture
run: |
ARCH=$(uname -m)
echo "Detected architecture: $ARCH"
if [ "$ARCH" != "${{ matrix.architecture }}" ]; then
echo "Error: Expected ${{ matrix.architecture }} architecture, but got $ARCH!"
exit 1
fi
- name: Checkout Vector
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: ${{ inputs.git_ref }}
- name: Bootstrap runner environment (macOS-specific)
run: |
bash scripts/environment/bootstrap-macos.sh
bash scripts/environment/prepare.sh --modules=rustup
- name: Build Vector
env:
TARGET: "${{ matrix.architecture }}-apple-darwin"
NATIVE_BUILD: true
run: |
export PATH="$HOME/.cargo/bin:$PATH"
make package
- name: Stage package artifacts for publish
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: vector-${{ env.VECTOR_VERSION }}-${{ matrix.architecture }}-apple-darwin
path: target/artifacts/vector*
build-x86_64-pc-windows-msvc-packages:
name: Build Vector for x86_64-pc-windows-msvc (.zip)
runs-on: windows-2025-8core
timeout-minutes: 90
needs: generate-publish-metadata
env:
VECTOR_VERSION: ${{ needs.generate-publish-metadata.outputs.vector_version }}
VECTOR_BUILD_DESC: ${{ needs.generate-publish-metadata.outputs.vector_build_desc }}
CHANNEL: ${{ needs.generate-publish-metadata.outputs.vector_release_channel }}
RUSTFLAGS: "-D warnings -Ctarget-feature=+crt-static"
RELEASE_BUILDER: "true"
steps:
- name: Checkout Vector
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: ${{ inputs.git_ref }}
- name: Bootstrap runner environment (Windows-specific)
run: .\scripts\environment\bootstrap-windows-2025.ps1
- name: Install Wix
shell: bash
run: |
mkdir -p /c/wix
cd /c/wix
curl -sSfL https://github.com/wixtoolset/wix3/releases/download/wix3141rtm/wix314-binaries.zip > wix-binaries.zip
unzip -o wix-binaries.zip
rm wix-binaries.zip
- name: Build Vector
shell: bash
run: |
export FEATURES="default-msvc"
export ARCHIVE_TYPE="zip"
export KEEP_SYMBOLS="true"
export RUST_LTO=""
export TARGET="x86_64-pc-windows-msvc"
export NATIVE_BUILD="true"
make package
- name: Build MSI package
shell: bash
run: |
export PATH="/c/wix:$PATH"
./scripts/package-msi.sh
- name: Stage package artifacts for publish
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: vector-${{ env.VECTOR_VERSION }}-x86_64-pc-windows-msvc
path: target/artifacts/vector*
deb-verify:
name: Verify DEB Packages
runs-on: ubuntu-24.04
timeout-minutes: 5
needs:
- generate-publish-metadata
- build-linux-packages
env:
VECTOR_VERSION: ${{ needs.generate-publish-metadata.outputs.vector_version }}
DD_PKG_VERSION: "latest"
strategy:
matrix:
container:
- ubuntu:20.04
- ubuntu:22.04
- ubuntu:24.04
- debian:11
- debian:12
- debian:13
container:
image: ${{ matrix.container }}
steps:
- run: |
apt-get update && \
apt-get install -y \
ca-certificates \
curl \
git \
systemd \
make
- name: Install dd-pkg for linting
run: |
curl -sSL "https://dd-package-tools.s3.amazonaws.com/dd-pkg/${DD_PKG_VERSION}/dd-pkg_Linux_x86_64.tar.gz" | tar -xz -C /usr/local/bin dd-pkg
- name: Fix Git safe directories issue when in containers (actions/checkout#760)
run: git config --global --add safe.directory /__w/vector/vector
- name: Checkout Vector
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: ${{ inputs.git_ref }}
- name: Download staged package artifacts (x86_64-unknown-linux-gnu)
uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
with:
name: vector-${{ env.VECTOR_VERSION }}-x86_64-unknown-linux-gnu
path: target/artifacts
- name: Verify install of DEB package.
run: |
./scripts/verify-install.sh target/artifacts/vector_${{ env.VECTOR_VERSION }}-1_amd64.deb
rpm-verify:
name: Verify RPM Packages
runs-on: ubuntu-24.04
timeout-minutes: 5
needs:
- generate-publish-metadata
- build-linux-packages
env:
VECTOR_VERSION: ${{ needs.generate-publish-metadata.outputs.vector_version }}
DD_PKG_VERSION: "latest"
strategy:
matrix:
container:
- "quay.io/centos/centos:stream9"
- "amazonlinux:2023"
- "fedora:39"
- "fedora:40"
container:
image: ${{ matrix.container }}
steps:
- run: |
yum update -y
yum install -y \
ca-certificates \
git \
systemd \
tar \
make
# conflicts with curl-minimal on some distros and --allowerased is not
# supported on some distros
if ! command -v curl &> /dev/null ; then
yum install -y curl
fi
- name: Install dd-pkg for linting
run: |
curl -sSL "https://dd-package-tools.s3.amazonaws.com/dd-pkg/${DD_PKG_VERSION}/dd-pkg_Linux_x86_64.tar.gz" | tar -xz -C /usr/local/bin dd-pkg
- name: Fix Git safe directories issue when in containers (actions/checkout#760)
run: git config --global --add safe.directory /__w/vector/vector
- name: Checkout Vector
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: ${{ inputs.git_ref }}
- name: Download staged package artifacts (x86_64-unknown-linux-gnu)
uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
with:
name: vector-${{ env.VECTOR_VERSION }}-x86_64-unknown-linux-gnu
path: target/artifacts
- name: Verify install of RPM package.
run: |
./scripts/verify-install.sh target/artifacts/vector-${{ env.VECTOR_VERSION }}-1.x86_64.rpm
macos-verify:
name: Verify macOS Package
runs-on: ${{ matrix.runner }}
timeout-minutes: 5
needs:
- generate-publish-metadata
- build-apple-darwin-packages
env:
VECTOR_VERSION: ${{ needs.generate-publish-metadata.outputs.vector_version }}
strategy:
matrix:
include:
# Refer to https://github.com/actions/runner-images
- target: arm64-apple-darwin
runner: macos-14
steps:
- name: Checkout Vector
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: ${{ inputs.git_ref }}
- name: Download staged package artifacts (${{ matrix.target }})
uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
with:
name: vector-${{ env.VECTOR_VERSION }}-${{ matrix.target }}
path: target/artifacts
- name: Verify macOS package
run: |
tar -xvf target/artifacts/vector-${{ env.VECTOR_VERSION }}-${{ matrix.target }}.tar.gz \
&& vector-${{ matrix.target }}/bin/vector --version
publish-docker:
name: Publish to Docker
runs-on: ubuntu-24.04
timeout-minutes: 15
# Elevated permission required to push Docker images to GitHub Container Registry
permissions:
packages: write
needs:
- generate-publish-metadata
- build-linux-packages
- deb-verify
env:
VECTOR_VERSION: ${{ needs.generate-publish-metadata.outputs.vector_version }}
VECTOR_BUILD_DESC: ${{ needs.generate-publish-metadata.outputs.vector_build_desc }}
CHANNEL: ${{ needs.generate-publish-metadata.outputs.vector_release_channel }}
steps:
- name: Checkout Vector
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: ${{ inputs.git_ref }}
- name: Login to DockerHub
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3.7.0
with:
username: ${{ secrets.CI_DOCKER_USERNAME }}
password: ${{ secrets.CI_DOCKER_PASSWORD }}
- name: Login to GitHub Container Registry
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3.7.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3.7.0
with:
platforms: all
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0
with:
version: latest
install: true
- name: Download all Linux package artifacts
uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
with:
pattern: vector-${{ env.VECTOR_VERSION }}-*-linux-*
path: target/artifacts
merge-multiple: true
- name: Build and publish Docker images
env:
PLATFORM: "linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6"
REPOS: "timberio/vector,ghcr.io/vectordotdev/vector"
uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2
with:
timeout_minutes: 15
max_attempts: 3
retry_wait_seconds: 60
command: make release-docker
publish-s3:
name: Publish to S3
runs-on: ubuntu-24.04
timeout-minutes: 10
needs:
- generate-publish-metadata
- build-linux-packages
- build-apple-darwin-packages
- build-x86_64-pc-windows-msvc-packages
- deb-verify
- rpm-verify
- macos-verify
env:
VECTOR_VERSION: ${{ needs.generate-publish-metadata.outputs.vector_version }}
CHANNEL: ${{ needs.generate-publish-metadata.outputs.vector_release_channel }}
steps:
- name: Checkout Vector
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: ${{ inputs.git_ref }}
- name: Download all package artifacts
uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
with:
pattern: vector-${{ env.VECTOR_VERSION }}-*
path: target/artifacts
merge-multiple: true
- name: Publish artifacts to S3
env:
AWS_ACCESS_KEY_ID: ${{ secrets.CI_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.CI_AWS_SECRET_ACCESS_KEY }}
run: make release-s3
publish-github:
name: Publish release to GitHub
# We only publish to GitHub for versioned releases, not nightlies.
if: inputs.channel == 'release'
runs-on: ubuntu-24.04
timeout-minutes: 10
# Elevated permission required to create GitHub releases and upload release assets
permissions:
contents: write
needs:
- generate-publish-metadata
- build-linux-packages
- build-apple-darwin-packages
- build-x86_64-pc-windows-msvc-packages
- deb-verify
- rpm-verify
- macos-verify
- generate-sha256sum
env:
VECTOR_VERSION: ${{ needs.generate-publish-metadata.outputs.vector_version }}
steps:
- name: Checkout Vector
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: ${{ inputs.git_ref }}
- name: Download all package artifacts
uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
with:
pattern: vector-${{ env.VECTOR_VERSION }}-*
path: target/artifacts
merge-multiple: true
- name: Publish release to GitHub
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: make release-github
generate-sha256sum:
name: Generate SHA256 checksums
runs-on: ubuntu-24.04
timeout-minutes: 5
needs:
- generate-publish-metadata
- build-linux-packages
- build-apple-darwin-packages
- build-x86_64-pc-windows-msvc-packages
env:
VECTOR_VERSION: ${{ needs.generate-publish-metadata.outputs.vector_version }}
steps:
- name: Checkout Vector
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: ${{ inputs.git_ref }}
- name: Download all package artifacts
uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
with:
pattern: vector-${{ env.VECTOR_VERSION }}-*
path: target/artifacts
merge-multiple: true
- name: Generate SHA256 checksums for artifacts
run: make sha256sum
- name: Stage checksum for publish
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: vector-${{ env.VECTOR_VERSION }}-SHA256SUMS
path: target/artifacts/vector-${{ env.VECTOR_VERSION }}-SHA256SUMS