8787 name : artifacts-plan-dist-manifest
8888 path : plan-dist-manifest.json
8989
90- # Build and packages all the platform-specific things
90+ # Build and packages all the platform-specific things (OSS)
9191 build-local-artifacts :
9292 name : build-local-artifacts (${{ join(matrix.targets, ', ') }})
9393 # Let the initial task tell us to not run (currently very blunt)
@@ -165,6 +165,7 @@ jobs:
165165 ${{ steps.cargo-dist.outputs.paths }}
166166 ${{ env.BUILD_MANIFEST_NAME }}
167167
168+ # Enterprise build (manual via cargo + tar.gz)
168169 build-enterprise-artifacts :
169170 name : build-enterprise-artifacts (${{ join(matrix.targets, ', ') }})
170171 needs :
@@ -177,7 +178,6 @@ jobs:
177178 container : ${{ matrix.container && matrix.container.image || null }}
178179 env :
179180 GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
180- BUILD_MANIFEST_NAME : target/distrib/enterprise-${{ join(matrix.targets, '-') }}-dist-manifest.json
181181 steps :
182182 - name : enable windows longpaths
183183 run : |
@@ -193,34 +193,48 @@ jobs:
193193 curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
194194 echo "$HOME/.cargo/bin" >> $GITHUB_PATH
195195 fi
196- - name : Install dist
197- run : ${{ matrix.install_dist.run }}
198- - name : Fetch local artifacts
199- uses : actions/download-artifact@v6
200- with :
201- pattern : artifacts-*
202- path : target/distrib/
203- merge-multiple : true
204196 - name : Install dependencies
205197 run : |
206198 ${{ matrix.packages_install }}
207- - name : Build enterprise artifacts
208- run : |
209- dist build ${{ needs.plan.outputs.tag-flag }} --features enterprise --print=linkage --output-format=json ${{ matrix.dist_args }} > dist-manifest.json
210- echo "dist ran successfully"
211- - id : rename-enterprise
212- name : Rename artifacts with enterprise suffix
199+ - id : build-enterprise
200+ name : Build enterprise artifacts
213201 shell : bash
202+ env :
203+ RELEASE_TAG : ${{ needs.plan.outputs.tag }}
214204 run : |
215205 set -euo pipefail
216206 mkdir -p renamed
217- mapfile -t files < <(dist print-upload-files-from-manifest --manifest dist-manifest.json)
218- for f in "${files[@]}"; do
219- base="$(basename "$f")"
220- new_base="$(echo "$base" | sed 's/^unleash-edge/unleash-edge-enterprise/')"
221- cp "$f" "renamed/$new_base"
207+
208+ # RELEASE_TAG is something like "unleash-edge-v1.2.3"
209+ tag="${RELEASE_TAG:-}"
210+ version="$tag"
211+ if [[ "$tag" == unleash-edge-v* ]]; then
212+ # Strip "unleash-edge-" so we keep "v1.2.3" (and any suffix)
213+ version="${tag#unleash-edge-}"
214+ fi
215+ if [[ -z "$version" ]]; then
216+ version="dev"
217+ fi
218+
219+ # Build and package for each target in this matrix entry
220+ for target in ${{ join(matrix.targets, ' ') }}; do
221+ echo "Building enterprise binary for $target"
222+ cargo build --release --bin unleash-edge --features enterprise --target "$target"
223+
224+ bin_path="target/$target/release/unleash-edge"
225+ if [[ "$target" == *"windows"* ]]; then
226+ bin_path="$bin_path.exe"
227+ fi
228+
229+ archive="renamed/unleash-edge-enterprise-${version}-${target}.tar.xz"
230+ tar -cJf "$archive" -C "$(dirname "$bin_path")" "$(basename "$bin_path")"
231+
232+ if command -v sha256sum >/dev/null 2>&1; then
233+ sha256sum "$archive" > "${archive}.sha256"
234+ else
235+ shasum -a 256 "$archive" > "${archive}.sha256"
236+ fi
222237 done
223- cp dist-manifest.json "$BUILD_MANIFEST_NAME"
224238
225239 echo "paths<<EOF" >> "$GITHUB_OUTPUT"
226240 for f in renamed/*; do
@@ -232,8 +246,7 @@ jobs:
232246 with :
233247 name : artifacts-enterprise-build-local-${{ join(matrix.targets, '_') }}
234248 path : |
235- ${{ steps.rename-enterprise.outputs.paths }}
236- ${{ env.BUILD_MANIFEST_NAME }}
249+ ${{ steps.build-enterprise.outputs.paths }}
237250
238251 # Build and package all the platform-agnostic(ish) things
239252 build-global-artifacts :
0 commit comments