-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use ziti-builder:v1 to generate GH release builds (#1015)
link release binaries with glibc 2.2.7
- Loading branch information
1 parent
1093493
commit 0cb7c78
Showing
4 changed files
with
100 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
.github/actions/openziti-tunnel-build-action/gh-release/Dockerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# use ziti-builder:v1 (basded on ubuntu focal) for older glibc (2.27) | ||
FROM openziti/ziti-builder:v1 | ||
|
||
COPY ./entrypoint.sh /root/ | ||
RUN chmod +x /root/entrypoint.sh | ||
ENTRYPOINT [ "/root/entrypoint.sh" ] |
74 changes: 74 additions & 0 deletions
74
.github/actions/openziti-tunnel-build-action/gh-release/entrypoint.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
#!/usr/bin/env bash | ||
# | ||
# Copyright 2024 NetFoundry Inc. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# https://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
|
||
set -euo pipefail | ||
|
||
# these commands must be in the entrypoint so they are run after workspace is mounted on Docker workdir | ||
echo "INFO: GIT_DISCOVERY_ACROSS_FILESYSTEM=${GIT_DISCOVERY_ACROSS_FILESYSTEM}" | ||
echo "INFO: WORKDIR=${PWD}" | ||
echo "INFO: $(git --version)" | ||
|
||
# if first positional is an expected arch string then set cmake preset, | ||
# else use ci-linux-x64 (which actually just uses native/host tools - e.g. not cross compile) | ||
if [ ${#} -ge 1 ]; then | ||
cmake_preset="${1}" | ||
else | ||
cmake_preset="ci-linux-x64" | ||
fi | ||
|
||
if [ ${#} -ge 2 ]; then | ||
cmake_config="${2}" | ||
else | ||
cmake_config="RelWithDebInfo" | ||
fi | ||
|
||
# workspace dir for each build env is added to "safe" dirs in global config e.g. | ||
# ~/.gitconfig so both runner and builder containers trust these dirs | ||
# owned by different UIDs from that of Git's EUID. This is made necessary | ||
# by newly-enforced directory boundaries in Git v2.35.2 | ||
# ref: https://lore.kernel.org/git/xmqqv8veb5i6.fsf@gitster.g/ | ||
for SAFE in \ | ||
/github/workspace \ | ||
/__w/ziti-tunnel-sdk-c/ziti-tunnel-sdk-c \ | ||
/mnt ; do | ||
git config --global --add safe.directory ${SAFE} | ||
done | ||
|
||
export VCPKG_ROOT="${PWD}/vcpkg" | ||
# ${VCPKG_ROOT}/packages will have been populated from outside of the container, by a different user. tell git it's ok. | ||
git config --global --add safe.directory "${VCPKG_ROOT}" | ||
|
||
if [ ! -d "${VCPKG_ROOT}/ports" ]; then | ||
# the packages/ directory may have been populated from cache by now | ||
# but git clone refuses to clone into a non-empty directory, so get | ||
# vcpkg without using clone | ||
git init "${VCPKG_ROOT}" | ||
(cd "${VCPKG_ROOT}"; git remote add -f origin https://github.com/microsoft/vcpkg; git checkout master) | ||
"${VCPKG_ROOT}/bootstrap-vcpkg.sh" -disableMetrics | ||
fi | ||
|
||
cmake -E make_directory ./build | ||
cmake \ | ||
--preset "${cmake_preset}" \ | ||
-DCMAKE_BUILD_TYPE="${cmake_config}" \ | ||
-S . \ | ||
-B ./build | ||
cmake \ | ||
--build ./build \ | ||
--config "${cmake_config}" \ | ||
--target bundle \ | ||
--verbose |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters