Skip to content

Commit efe58f4

Browse files
committed
tidy cpack action and workflow
1 parent c6f4eb3 commit efe58f4

File tree

13 files changed

+160
-91
lines changed

13 files changed

+160
-91
lines changed
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
name: 'OpenZiti Tunneler Build Action'
2-
description: 'Builds ziti-edge-tunnel binary and install package for Linux'
3-
author: 'NetFoundry'
1+
name: OpenZiti Tunneler Build Action
2+
description: Builds ziti-edge-tunnel binary and Linux package
3+
author: NetFoundry
44
inputs:
55
arch:
6-
description: 'The cmake preset used by entrypoint.sh when running cmake'
6+
description: The cmake preset used by entrypoint.sh when running cmake
77
required: false
88
config:
9-
description: 'The cmake build configuration used by entrypoint.sh when running cmake'
9+
description: The cmake build configuration used by entrypoint.sh when running cmake
1010
required: false
1111
runs:
12-
using: 'docker'
13-
image: 'Dockerfile'
12+
using: docker
13+
image: Dockerfile
1414
args:
1515
- ${{ inputs.arch }}
1616
- ${{ inputs.config }}
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# use ziti-builder:v1 (Ubuntu Bionic 18.04 LTS) for older glibc (2.27)
22
FROM openziti/ziti-builder:v1
33

4-
COPY ./entrypoint.sh /root/
5-
RUN chmod +x /root/entrypoint.sh
4+
COPY --chmod=0755 ./entrypoint.sh /root/
65
ENTRYPOINT [ "/root/entrypoint.sh" ]

.github/actions/openziti-tunnel-build-action/gh-release/entrypoint.sh

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -44,26 +44,34 @@ fi
4444
for SAFE in \
4545
/github/workspace \
4646
/__w/ziti-tunnel-sdk-c/ziti-tunnel-sdk-c \
47-
/mnt ; do
48-
git config --global --add safe.directory ${SAFE}
47+
/mnt \
48+
/usr/local/vcpkg
49+
do
50+
git config --global --add safe.directory ${SAFE}
51+
done
52+
53+
for CACHE in \
54+
/github/workspace/vcpkg_cache/{archives,downloads,installed}
55+
do
56+
mkdir -p ${CACHE}
4957
done
5058

5159
(
52-
cd "${VCPKG_ROOT}"
53-
git checkout master
54-
git pull
55-
./bootstrap-vcpkg.sh -disableMetrics
60+
cd "${VCPKG_ROOT}"
61+
git checkout master
62+
git pull
63+
./bootstrap-vcpkg.sh -disableMetrics
5664
)
5765

5866
cmake -E make_directory ./build
5967
cmake \
60-
--preset "${cmake_preset}" \
61-
-DCMAKE_BUILD_TYPE="${cmake_config}" \
62-
-DVCPKG_OVERLAY_PORTS=./.github/actions/openziti-tunnel-build-action/gh-release/vcpkg-overlays \
63-
-S . \
64-
-B ./build
68+
--preset "${cmake_preset}" \
69+
-DCMAKE_BUILD_TYPE="${cmake_config}" \
70+
-DVCPKG_OVERLAY_PORTS=./.github/actions/openziti-tunnel-build-action/gh-release/vcpkg-overlays \
71+
-S . \
72+
-B ./build
6573
cmake \
66-
--build ./build \
67-
--config "${cmake_config}" \
68-
--target bundle \
69-
--verbose
74+
--build ./build \
75+
--config "${cmake_config}" \
76+
--target bundle \
77+
--verbose

.github/actions/openziti-tunnel-build-action/redhat-8/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ ENV VCPKG_FORCE_SYSTEM_BINARIES=yes
4444

4545
RUN cd /usr/local \
4646
&& git clone https://github.com/microsoft/vcpkg \
47-
&& ./vcpkg/bootstrap-vcpkg.sh -disableMetrics
47+
&& chmod -R ugo+rwX /usr/local/vcpkg
4848

4949
WORKDIR /github/workspace
5050
COPY ./entrypoint.sh /root/

.github/actions/openziti-tunnel-build-action/redhat-8/entrypoint.sh

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,23 @@ fi
3232
for SAFE in \
3333
/github/workspace \
3434
/__w/ziti-tunnel-sdk-c/ziti-tunnel-sdk-c \
35-
/mnt ; do
36-
git config --global --add safe.directory ${SAFE}
35+
/mnt \
36+
/usr/local/vcpkg
37+
do
38+
git config --global --add safe.directory ${SAFE}
39+
done
40+
41+
for CACHE in \
42+
/github/workspace/vcpkg_cache/{archives,downloads,installed}
43+
do
44+
mkdir -p ${CACHE}
3745
done
3846

3947
(
40-
cd "${VCPKG_ROOT}"
41-
git checkout master
42-
git pull
43-
./bootstrap-vcpkg.sh -disableMetrics
48+
cd "${VCPKG_ROOT}"
49+
git checkout master
50+
git pull
51+
./bootstrap-vcpkg.sh -disableMetrics
4452
)
4553

4654
cmake -E make_directory ./build

.github/actions/openziti-tunnel-build-action/redhat-9/Dockerfile

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
ARG CMAKE_VERSION="3.26.3"
22

3-
FROM rockylinux:9
3+
FROM quay.io/almalinuxorg/almalinux:9.6-20250611
44

55
ARG CMAKE_VERSION
66

@@ -13,7 +13,8 @@ ENV PATH="/usr/local/:${PATH}"
1313
ENV GIT_DISCOVERY_ACROSS_FILESYSTEM=1
1414
ENV TZ=UTC
1515

16-
RUN dnf install -y \
16+
RUN dnf update --assumeyes --nobest \
17+
&& dnf install --assumeyes --nobest \
1718
"@Development Tools" \
1819
dnf-plugins-core \
1920
iproute \
@@ -25,15 +26,15 @@ RUN dnf install -y \
2526
perl-FindBin perl-IPC-Cmd perl-File-Compare perl-File-Copy \
2627
libatomic \
2728
&& dnf config-manager --set-enabled crb \
28-
&& dnf install -y \
29+
&& dnf install --assumeyes --nobest \
2930
doxygen \
3031
graphviz \
3132
git \
3233
json-c-devel \
3334
protobuf-c-devel \
3435
openssl-devel \
3536
ninja-build \
36-
&& dnf clean all
37+
&& dnf clean all
3738

3839
RUN curl -sSfL https://cmake.org/files/v${CMAKE_VERSION%.*}/cmake-${CMAKE_VERSION}-linux-$(uname -m).sh -o cmake.sh \
3940
&& (bash cmake.sh --skip-license --prefix=/usr/local) \
@@ -42,12 +43,15 @@ RUN curl -sSfL https://cmake.org/files/v${CMAKE_VERSION%.*}/cmake-${CMAKE_VERSIO
4243
ENV GIT_CONFIG_GLOBAL="/tmp/ziti-builder-gitconfig"
4344

4445
ENV VCPKG_ROOT=/usr/local/vcpkg
46+
ENV VCPKG_BINARY_SOURCES="clear;files,/github/workspace/vcpkg_cache/archives,readwrite"
47+
ENV VCPKG_DOWNLOADS=/github/workspace/vcpkg_cache/downloads
48+
ENV VCPKG_INSTALLED_DIR=/github/workspace/vcpkg_cache/installed
49+
4550
# this must be set on arm. see https://learn.microsoft.com/en-us/vcpkg/users/config-environment#vcpkg_force_system_binaries
4651
ENV VCPKG_FORCE_SYSTEM_BINARIES=yes
4752

4853
RUN cd /usr/local \
4954
&& git clone https://github.com/microsoft/vcpkg \
50-
&& ./vcpkg/bootstrap-vcpkg.sh -disableMetrics \
5155
&& chmod -R ugo+rwX /usr/local/vcpkg
5256

5357
WORKDIR /github/workspace

.github/actions/openziti-tunnel-build-action/redhat-9/entrypoint.sh

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,23 @@ fi
3232
for SAFE in \
3333
/github/workspace \
3434
/__w/ziti-tunnel-sdk-c/ziti-tunnel-sdk-c \
35-
/mnt ; do
36-
git config --global --add safe.directory ${SAFE}
35+
/mnt \
36+
/usr/local/vcpkg
37+
do
38+
git config --global --add safe.directory ${SAFE}
39+
done
40+
41+
for CACHE in \
42+
/github/workspace/vcpkg_cache/{archives,downloads,installed}
43+
do
44+
mkdir -p ${CACHE}
3745
done
3846

3947
(
40-
cd "${VCPKG_ROOT}"
41-
git checkout master
42-
git pull
43-
./bootstrap-vcpkg.sh -disableMetrics
48+
cd "${VCPKG_ROOT}"
49+
git checkout master
50+
git pull
51+
./bootstrap-vcpkg.sh -disableMetrics
4452
)
4553

4654
(

.github/actions/openziti-tunnel-build-action/ubuntu-20.04/Dockerfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,8 @@ ENV VCPKG_ROOT=/usr/local/vcpkg
5858
ENV VCPKG_FORCE_SYSTEM_BINARIES=yes
5959

6060
RUN cd /usr/local \
61-
&& git config --global advice.detachedHead false \
6261
&& git clone https://github.com/microsoft/vcpkg \
63-
&& ./vcpkg/bootstrap-vcpkg.sh -disableMetrics
62+
&& chmod -R ugo+rwX /usr/local/vcpkg
6463

6564
COPY ./entrypoint.sh /root/
6665
ENTRYPOINT [ "/root/entrypoint.sh" ]

.github/actions/openziti-tunnel-build-action/ubuntu-20.04/entrypoint.sh

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,23 @@ fi
3535
for SAFE in \
3636
/github/workspace \
3737
/__w/ziti-tunnel-sdk-c/ziti-tunnel-sdk-c \
38-
/mnt ; do
39-
git config --global --add safe.directory ${SAFE}
38+
/mnt \
39+
/usr/local/vcpkg
40+
do
41+
git config --global --add safe.directory ${SAFE}
42+
done
43+
44+
for CACHE in \
45+
/github/workspace/vcpkg_cache/{archives,downloads,installed}
46+
do
47+
mkdir -p ${CACHE}
4048
done
4149

4250
(
43-
cd "${VCPKG_ROOT}"
44-
git checkout master
45-
git pull
46-
./bootstrap-vcpkg.sh -disableMetrics
51+
cd "${VCPKG_ROOT}"
52+
git checkout master
53+
git pull
54+
./bootstrap-vcpkg.sh -disableMetrics
4755
)
4856

4957
[[ -d ./build ]] && rm -r ./build

.github/actions/openziti-tunnel-build-action/ubuntu-22.04/Dockerfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,8 @@ ENV VCPKG_ROOT=/usr/local/vcpkg
6363
ENV VCPKG_FORCE_SYSTEM_BINARIES=yes
6464

6565
RUN cd /usr/local \
66-
&& git config --global advice.detachedHead false \
6766
&& git clone https://github.com/microsoft/vcpkg \
68-
&& ./vcpkg/bootstrap-vcpkg.sh -disableMetrics
67+
&& chmod -R ugo+rwX /usr/local/vcpkg
6968

7069
COPY ./entrypoint.sh /root/
7170
ENTRYPOINT [ "/root/entrypoint.sh" ]

0 commit comments

Comments
 (0)