1+ name : Publish Simplified
2+
3+ permissions :
4+ contents : write
5+ packages : write
6+
7+ on :
8+ workflow_call :
9+ inputs :
10+ git_ref :
11+ type : string
12+ required : true
13+ channel :
14+ type : string
15+ required : true
16+
17+ env :
18+ VERBOSE : true
19+ CI : true
20+ DISABLE_MOLD : true
21+ DEBIAN_FRONTEND : noninteractive
22+ CONTAINER_TOOL : docker
23+ CARGO_PROFILE_RELEASE_LTO : fat
24+ CARGO_PROFILE_RELEASE_CODEGEN_UNITS : 1
25+ CARGO_NET_GIT_FETCH_WITH_CLI : true
26+ CHANNEL : ${{ inputs.channel }}
27+
28+ jobs :
29+ generate-publish-metadata :
30+ name : Generate Publish-related Metadata
31+ runs-on : ubuntu-24.04
32+ timeout-minutes : 5
33+ outputs :
34+ vector_version : ${{ steps.generate-publish-metadata.outputs.vector_version }}
35+ vector_build_desc : ${{ steps.generate-publish-metadata.outputs.vector_build_desc }}
36+ vector_release_channel : ${{ steps.generate-publish-metadata.outputs.vector_release_channel }}
37+ steps :
38+ - name : Checkout Vector
39+ uses : actions/checkout@v4
40+ with :
41+ ref : ${{ inputs.git_ref }}
42+ - name : Generate publish metadata
43+ id : generate-publish-metadata
44+ run : make ci-generate-publish-metadata
45+
46+ build-x86_64-unknown-linux-musl-packages :
47+ name : Build Vector for x86_64-unknown-linux-musl (.tar.gz)
48+ runs-on : ubuntu-24.04
49+ timeout-minutes : 120
50+ needs : generate-publish-metadata
51+ env :
52+ VECTOR_VERSION : ${{ needs.generate-publish-metadata.outputs.vector_version }}
53+ VECTOR_BUILD_DESC : ${{ needs.generate-publish-metadata.outputs.vector_build_desc }}
54+ CHANNEL : ${{ needs.generate-publish-metadata.outputs.vector_release_channel }}
55+ steps :
56+ - name : Checkout Vector
57+ uses : actions/checkout@v4
58+ with :
59+ ref : ${{ inputs.git_ref }}
60+ - name : Bootstrap runner environment (Ubuntu-specific)
61+ run : sudo -E bash scripts/environment/bootstrap-ubuntu-24.04.sh
62+ - name : Bootstrap runner environment (generic)
63+ run : bash scripts/environment/prepare.sh
64+ - name : Build Vector
65+ run : make package-x86_64-unknown-linux-musl
66+ - name : Stage package artifacts for publish
67+ uses : actions/upload-artifact@v4
68+ with :
69+ name : vector-${{ env.VECTOR_VERSION }}-x86_64-unknown-linux-musl
70+ path : target/artifacts/vector*
71+
72+ build-x86_64-unknown-linux-gnu-packages :
73+ name : Build Vector for x86_64-unknown-linux-gnu (.tar.gz)
74+ runs-on : ubuntu-24.04
75+ needs : generate-publish-metadata
76+ timeout-minutes : 120
77+ env :
78+ VECTOR_VERSION : ${{ needs.generate-publish-metadata.outputs.vector_version }}
79+ VECTOR_BUILD_DESC : ${{ needs.generate-publish-metadata.outputs.vector_build_desc }}
80+ CHANNEL : ${{ needs.generate-publish-metadata.outputs.vector_release_channel }}
81+ steps :
82+ - name : Checkout Vector
83+ uses : actions/checkout@v4
84+ with :
85+ ref : ${{ inputs.git_ref }}
86+ - name : Bootstrap runner environment (Ubuntu-specific)
87+ run : sudo -E bash scripts/environment/bootstrap-ubuntu-24.04.sh
88+ - name : Bootstrap runner environment (generic)
89+ run : bash scripts/environment/prepare.sh
90+ - name : Build Vector
91+ run : make package-x86_64-unknown-linux-gnu
92+ - name : Stage package artifacts for publish
93+ uses : actions/upload-artifact@v4
94+ with :
95+ name : vector-${{ env.VECTOR_VERSION }}-x86_64-unknown-linux-gnu
96+ path : target/artifacts/vector*
97+
98+ build-s390x-unknown-linux-gnu-packages :
99+ name : Build Vector for s390x-unknown-linux-gnu (.tar.gz)
100+ runs-on : ubuntu-24.04
101+ timeout-minutes : 120
102+ needs : generate-publish-metadata
103+ env :
104+ VECTOR_VERSION : ${{ needs.generate-publish-metadata.outputs.vector_version }}
105+ VECTOR_BUILD_DESC : ${{ needs.generate-publish-metadata.outputs.vector_build_desc }}
106+ CHANNEL : ${{ needs.generate-publish-metadata.outputs.vector_release_channel }}
107+ steps :
108+ - name : Checkout Vector
109+ uses : actions/checkout@v4
110+ with :
111+ ref : ${{ inputs.git_ref }}
112+ - name : Bootstrap runner environment (Ubuntu-specific)
113+ run : sudo -E bash scripts/environment/bootstrap-ubuntu-24.04.sh
114+ - name : Bootstrap runner environment (generic)
115+ run : bash scripts/environment/prepare.sh
116+ - name : Build Vector
117+ env :
118+ DOCKER_PRIVILEGED : " true"
119+ run : make package-s390x-unknown-linux-gnu
120+ - name : Stage package artifacts for publish
121+ uses : actions/upload-artifact@v4
122+ with :
123+ name : vector-${{ env.VECTOR_VERSION }}-s390x-unknown-linux-gnu
124+ path : target/artifacts/vector*
125+
126+ publish-docker-ghcr :
127+ name : Publish to GHCR
128+ runs-on : ubuntu-24.04
129+ timeout-minutes : 15
130+ needs :
131+ - generate-publish-metadata
132+ - build-x86_64-unknown-linux-gnu-packages
133+ - build-x86_64-unknown-linux-musl-packages
134+ - build-s390x-unknown-linux-gnu-packages
135+ env :
136+ VECTOR_VERSION : ${{ needs.generate-publish-metadata.outputs.vector_version }}
137+ VECTOR_BUILD_DESC : ${{ needs.generate-publish-metadata.outputs.vector_build_desc }}
138+ CHANNEL : ${{ needs.generate-publish-metadata.outputs.vector_release_channel }}
139+ steps :
140+ - name : Checkout Vector
141+ uses : actions/checkout@v4
142+ with :
143+ ref : ${{ inputs.git_ref }}
144+ - name : Login to GitHub Container Registry
145+ uses : docker/login-action@v3
146+ with :
147+ registry : ghcr.io
148+ username : ${{ github.actor }}
149+ password : ${{ secrets.GITHUB_TOKEN }}
150+ - name : Set up QEMU
151+ uses : docker/setup-qemu-action@v3.6.0
152+ with :
153+ platforms : linux/amd64,linux/s390x
154+ - name : Set up Docker Buildx
155+ id : buildx
156+ uses : docker/setup-buildx-action@v3.10.0
157+ with :
158+ version : latest
159+ install : true
160+ - name : Download staged package artifacts (x86_64-unknown-linux-gnu)
161+ uses : actions/download-artifact@v4
162+ with :
163+ name : vector-${{ env.VECTOR_VERSION }}-x86_64-unknown-linux-gnu
164+ path : target/artifacts
165+ - name : Download staged package artifacts (x86_64-unknown-linux-musl)
166+ uses : actions/download-artifact@v4
167+ with :
168+ name : vector-${{ env.VECTOR_VERSION }}-x86_64-unknown-linux-musl
169+ path : target/artifacts
170+ - name : Download staged package artifacts (s390x-unknown-linux-gnu)
171+ uses : actions/download-artifact@v4
172+ with :
173+ name : vector-${{ env.VECTOR_VERSION }}-s390x-unknown-linux-gnu
174+ path : target/artifacts
175+ - name : Build and publish Docker images
176+ env :
177+ PLATFORM : " linux/amd64,linux/s390x"
178+ # Publish to GHCR under your org
179+ REPOS : " ghcr.io/dnse-tech/vector"
180+ uses : nick-fields/retry@v3
181+ with :
182+ timeout_minutes : 15
183+ max_attempts : 3
184+ retry_wait_seconds : 60
185+ command : make release-docker
0 commit comments