Skip to content

Commit 936be6a

Browse files
committed
use same FRANKENPHP_VERSION and make sure to let pr's run the rpm generation too (version 0.0.0) to see issues
1 parent 838f2ad commit 936be6a

3 files changed

Lines changed: 28 additions & 2 deletions

File tree

.github/workflows/static.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,7 @@ jobs:
216216
targets: static-builder-gnu
217217
set: |
218218
${{ (github.event_name == 'pull_request' || matrix.platform == 'linux/arm64') && 'static-builder-gnu.args.NO_COMPRESS=1' || '' }}
219+
static-builder-gnu.args.BUILD_PACKAGES=1
219220
*.tags=
220221
*.platform=${{ matrix.platform }}
221222
*.cache-from=type=gha,scope=${{ needs.prepare.outputs.ref || github.ref }}-static-builder-gnu

build-packages.sh

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,29 @@ if [ ! -f "dist/$bin" ]; then
3131
exit 1
3232
fi
3333

34+
if [ -z "${FRANKENPHP_VERSION}" ]; then
35+
FRANKENPHP_VERSION="$(git rev-parse --verify HEAD)"
36+
export FRANKENPHP_VERSION
37+
elif [ -d ".git/" ]; then
38+
CURRENT_REF="$(git rev-parse --abbrev-ref HEAD)"
39+
export CURRENT_REF
40+
41+
if echo "${FRANKENPHP_VERSION}" | grep -F -q "."; then
42+
# Tag
43+
44+
# Trim "v" prefix if any
45+
FRANKENPHP_VERSION=${FRANKENPHP_VERSION#v}
46+
export FRANKENPHP_VERSION
47+
48+
git checkout "v${FRANKENPHP_VERSION}"
49+
else
50+
git checkout "${FRANKENPHP_VERSION}"
51+
fi
52+
fi
53+
3454
if [[ ! "${FRANKENPHP_VERSION}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
3555
echo "Error: FRANKENPHP_VERSION must be set to X.Y.Z (e.g. 1.5.1), got '${FRANKENPHP_VERSION}'"
36-
exit 1
56+
FRANKENPHP_VERSION=0.0.0
3757
fi
3858

3959
iteration="1"

static-builder-gnu.Dockerfile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ FROM centos:7
66
ARG FRANKENPHP_VERSION=''
77
ENV FRANKENPHP_VERSION=${FRANKENPHP_VERSION}
88

9+
ARG BUILD_PACKAGES=''
10+
911
ARG PHP_VERSION=''
1012
ENV PHP_VERSION=${PHP_VERSION}
1113

@@ -133,4 +135,7 @@ COPY --link caddy caddy
133135
COPY --link internal internal
134136

135137
RUN --mount=type=secret,id=github-token ./build-static.sh && \
136-
rm -Rf dist/static-php-cli/source/*
138+
rm -Rf dist/static-php-cli/source/* && \
139+
if [ "${BUILD_PACKAGES}" != "" ]; then \
140+
./build-packages.sh; \
141+
fi

0 commit comments

Comments
 (0)