Skip to content

Commit f01430d

Browse files
authoredNov 26, 2024··
Merge pull request #11 from ggtakec/update/support_os
Changed supported OS and PHP version and modified some codes
2 parents 2f5ce52 + 1e16047 commit f01430d

11 files changed

+171
-688
lines changed
 

‎.github/workflows/ci.yml

+6-16
Original file line numberDiff line numberDiff line change
@@ -58,23 +58,23 @@ jobs:
5858
#
5959
matrix:
6060
container:
61+
- ubuntu:24.04
6162
- ubuntu:22.04
6263
- ubuntu:20.04
6364
- debian:bookworm
6465
- debian:bullseye
65-
- debian:buster
6666
- rockylinux:9
6767
- rockylinux:8
68-
- centos:centos7
69-
- fedora:39
70-
- fedora:38
68+
- fedora:41
69+
- fedora:40
70+
- alpine:3.20
7171
- alpine:3.19
7272
- alpine:3.18
7373

7474
php:
75-
- PHP80
7675
- PHP81
7776
- PHP82
77+
- PHP83
7878

7979
container:
8080
image: ${{ matrix.container }}
@@ -91,19 +91,9 @@ jobs:
9191
NO_INTERACTION: 1
9292

9393
steps:
94-
# [NOTE]
95-
# actions/checkout@v3 uses nodejs v16 and will be deprecated.
96-
# However, @v4 does not work on centos7 depending on the glibc version,
97-
# so we will continue to use @v3.
98-
#
99-
- name: Checkout source code(other than centos7)
100-
if: matrix.container != 'centos:centos7'
94+
- name: Checkout source code
10195
uses: actions/checkout@v4
10296

103-
- name: Checkout source code(only centos7)
104-
if: matrix.container == 'centos:centos7'
105-
uses: actions/checkout@v3
106-
10797
#
10898
# Set environments from secrets
10999
#

‎.github/workflows/phpext_helper.sh

+47-79
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,7 @@ run_pre_create_package()
532532
run_create_package()
533533
{
534534
if ! RUN_AS_SUBPROCESS="true" /bin/sh -c "${SWITCH_PHP_COMMAND} ${CREATE_PACKAGE_TOOL} ${CREATE_PACKAGE_TOOL_OPT_AUTO} --buildnum ${CI_BUILD_NUMBER} ${CREATE_PACKAGE_TOOL_OPT}"; then
535-
PRNERR "Failed to create debian type packages"
535+
PRNERR "Failed to create ${CI_OSTYPE} packages"
536536
return 1
537537
fi
538538
return 0
@@ -828,12 +828,42 @@ if [ -n "${OPT_DEVELOPER_FULLNAME}" ]; then
828828
CI_DEVELOPER_FULLNAME="${OPT_DEVELOPER_FULLNAME}"
829829
elif [ -n "${ENV_DEVELOPER_FULLNAME}" ]; then
830830
CI_DEVELOPER_FULLNAME="${ENV_DEVELOPER_FULLNAME}"
831+
else
832+
# [NOTE]
833+
# If this variable is not set in a project that uses configure,
834+
# an attempt will be made to load the value from configure.ac etc.
835+
#
836+
if [ -f "${SRCTOP}/configure.custom" ]; then
837+
CI_DEVELOPER_FULLNAME=$(grep '^[[:space:]]*DEB_NAME[[:space:]]*=' "${SRCTOP}/configure.custom" | sed -e 's|^[[:space:]]*DEB_NAME[[:space:]]*=[[:space:]]*||g' -e 's|^[[:space:]]*||g' -e 's|[[:space:]]*$||g')
838+
fi
839+
if [ -z "${CI_DEVELOPER_FULLNAME}" ] && [ -f "${SRCTOP}/config.m4" ]; then
840+
CI_DEVELOPER_FULLNAME=$(grep '^[[:space:]]*custom_dev_name[[:space:]]*=' "${SRCTOP}/config.m4" | grep -v 'DEB_NAME' | sed -e 's|^[[:space:]]*custom_dev_name[[:space:]]*=[[:space:]]*||g' -e 's|^[[:space:]]*||g' -e 's|[[:space:]]*$||g' -e 's|"||g')
841+
fi
842+
if [ -z "${CI_DEVELOPER_FULLNAME}" ]; then
843+
PRNWARN "DEVELOPER_FULLNAME is not set in the options or environment variables. There is no choice but to set the default value."
844+
CI_DEVELOPER_FULLNAME="ANTPICKAX_DEVELOPER"
845+
fi
831846
fi
832847

833848
if [ -n "${OPT_DEVELOPER_EMAIL}" ]; then
834849
CI_DEVELOPER_EMAIL="${OPT_DEVELOPER_EMAIL}"
835850
elif [ -n "${ENV_DEVELOPER_EMAIL}" ]; then
836851
CI_DEVELOPER_EMAIL="${ENV_DEVELOPER_EMAIL}"
852+
else
853+
# [NOTE]
854+
# If this variable is not set in a project that uses configure,
855+
# an attempt will be made to load the value from configure.ac etc.
856+
#
857+
if [ -f "${SRCTOP}/configure.custom" ]; then
858+
CI_DEVELOPER_EMAIL=$(grep '^[[:space:]]*DEV_EMAIL[[:space:]]*=' "${SRCTOP}/configure.custom" | sed -e 's|^[[:space:]]*DEV_EMAIL[[:space:]]*=[[:space:]]*||g' -e 's|^[[:space:]]*||g' -e 's|[[:space:]]*$||g')
859+
fi
860+
if [ -z "${CI_DEVELOPER_EMAIL}" ] && [ -f "${SRCTOP}/config.m4" ]; then
861+
CI_DEVELOPER_EMAIL=$(grep '^[[:space:]]*custom_dev_email[[:space:]]*=' "${SRCTOP}/config.m4" | grep -v 'DEV_EMAIL' | sed -e 's|^[[:space:]]*custom_dev_email[[:space:]]*=[[:space:]]*||g' -e 's|^[[:space:]]*||g' -e 's|[[:space:]]*$||g' -e 's|"||g')
862+
fi
863+
if [ -z "${CI_DEVELOPER_EMAIL}" ]; then
864+
PRNWARN "DEVELOPER_EMAIL is not set in the options or environment variables. There is no choice but to set the default value."
865+
CI_DEVELOPER_EMAIL="antpickax-support@mail.yahoo.co.jp"
866+
fi
837867
fi
838868

839869
if [ -n "${OPT_FORCE_PUBLISH}" ]; then
@@ -901,13 +931,19 @@ elif [ -n "${ENV_PACKAGECLOUD_DOWNLOAD_REPO}" ]; then
901931
fi
902932

903933
#
904-
# Set environments for debian package
934+
# Set environments for debian/alpine package
905935
#
906936
if [ -n "${CI_DEVELOPER_FULLNAME}" ]; then
907-
export DEBEMAIL="${CI_DEVELOPER_FULLNAME}"
937+
export DEBFULLNAME="${CI_DEVELOPER_FULLNAME}"
938+
else
939+
PRNERR "\"CI_DEVELOPER_FULLNAME\" value is not set."
940+
exit 1
908941
fi
909942
if [ -n "${CI_DEVELOPER_EMAIL}" ]; then
910-
export DEBFULLNAME="${CI_DEVELOPER_EMAIL}"
943+
export DEBEMAIL="${CI_DEVELOPER_EMAIL}"
944+
else
945+
PRNERR "\"CI_DEVELOPER_EMAIL\" value is not set."
946+
exit 1
911947
fi
912948

913949
# [NOTE] for ubuntu/debian
@@ -1013,12 +1049,6 @@ elif [ "${IS_OS_DEBIAN}" -eq 1 ]; then
10131049
CREATE_PACKAGE_TOOL="${CREATE_PACKAGE_TOOL_DEBIAN}"
10141050
CREATE_PACKAGE_TOOL_OPT="${CREATE_PACKAGE_TOOL_OPT_DEBIAN}"
10151051

1016-
elif [ "${IS_OS_CENTOS}" -eq 1 ]; then
1017-
BUILD_MAKE_EXT_OPT="${BUILD_MAKE_EXT_OPT_DEBIAN}"
1018-
MAKE_TEST_OPT="${MAKE_TEST_OPT_DEBIAN}"
1019-
CREATE_PACKAGE_TOOL="${CREATE_PACKAGE_TOOL_RPM}"
1020-
CREATE_PACKAGE_TOOL_OPT="${CREATE_PACKAGE_TOOL_OPT_RPM}"
1021-
10221052
elif [ "${IS_OS_FEDORA}" -eq 1 ]; then
10231053
BUILD_MAKE_EXT_OPT="${BUILD_MAKE_EXT_OPT_RPM}"
10241054
MAKE_TEST_OPT="${MAKE_TEST_OPT_RPM}"
@@ -1160,7 +1190,6 @@ echo " SWITCH_PHP_COMMAND = ${SWITCH_PHP_COMMAND}"
11601190
echo ""
11611191
echo " IS_OS_UBUNTU = ${IS_OS_UBUNTU}"
11621192
echo " IS_OS_DEBIAN = ${IS_OS_DEBIAN}"
1163-
echo " IS_OS_CENTOS = ${IS_OS_CENTOS}"
11641193
echo " IS_OS_FEDORA = ${IS_OS_FEDORA}"
11651194
echo " IS_OS_ROCKY = ${IS_OS_ROCKY}"
11661195
echo " IS_OS_ALPINE = ${IS_OS_ALPINE}"
@@ -1227,7 +1256,7 @@ if [ "${CI_USE_PACKAGECLOUD_REPO}" -eq 1 ]; then
12271256
#
12281257
# Setup packagecloud.io repository
12291258
#
1230-
if [ "${IS_OS_CENTOS}" -eq 1 ] || [ "${IS_OS_FEDORA}" -eq 1 ] || [ "${IS_OS_ROCKY}" -eq 1 ]; then
1259+
if [ "${IS_OS_FEDORA}" -eq 1 ] || [ "${IS_OS_ROCKY}" -eq 1 ]; then
12311260
PC_REPO_ADD_SH="script.rpm.sh"
12321261
PC_REPO_ADD_SH_RUN="bash"
12331262
elif [ "${IS_OS_UBUNTU}" -eq 1 ] || [ "${IS_OS_DEBIAN}" -eq 1 ]; then
@@ -1247,7 +1276,7 @@ if [ "${CI_USE_PACKAGECLOUD_REPO}" -eq 1 ]; then
12471276
exit 1
12481277
fi
12491278
else
1250-
PRNWARN "OS is not debian/ubuntu nor centos/fedora/rocky nor alpine, then we do not know which download script use. Thus skip to setup packagecloud.io repository."
1279+
PRNWARN "OS is not debian/ubuntu nor fedora/rocky nor alpine, then we do not know which download script use. Thus skip to setup packagecloud.io repository."
12511280
fi
12521281
else
12531282
PRNINFO "Not set packagecloud.io repository."
@@ -1278,7 +1307,7 @@ PRNTITLE "Add PHP repositories"
12781307

12791308
if [ -n "${INSTALL_PHP_REPO}" ]; then
12801309
PRNINFO "PHP repositories"
1281-
if [ "${IS_OS_CENTOS}" -eq 1 ] || [ "${IS_OS_ROCKY}" -eq 1 ] || [ "${IS_OS_FEDORA}" -eq 1 ]; then
1310+
if [ "${IS_OS_ROCKY}" -eq 1 ] || [ "${IS_OS_FEDORA}" -eq 1 ]; then
12821311
if ({ RUNCMD "${INSTALLER_BIN}" "${INSTALL_CMD}" "${INSTALL_CMD_ARG}" "${INSTALL_AUTO_ARG}" "${INSTALL_QUIET_ARG}" "${INSTALL_PHP_REPO}" || echo > "${PIPEFAILURE_FILE}"; } | sed -e 's/^/ /g') && rm "${PIPEFAILURE_FILE}" >/dev/null 2>&1; then
12831312
PRNERR "Failed to add PHP repository."
12841313
exit 1
@@ -1414,28 +1443,7 @@ if [ "${CI_DO_PUBLISH}" -eq 1 ]; then
14141443
GEM_BIN="gem"
14151444
GEM_INSTALL_CMD="install"
14161445

1417-
if [ "${IS_OS_CENTOS}" -eq 1 ] && echo "${CI_OSTYPE}" | sed -e 's#:##g' | grep -q -i -e 'centos7' -e 'centos6'; then
1418-
#
1419-
# Case for CentOS
1420-
#
1421-
PRNWARN "OS is CentOS 7(6), so install ruby by special means(SCL)."
1422-
1423-
if ({ RUNCMD "${INSTALLER_BIN}" "${INSTALL_CMD}" "${INSTALL_CMD_ARG}" "${INSTALL_AUTO_ARG}" "${INSTALL_QUIET_ARG}" centos-release-scl || echo > "${PIPEFAILURE_FILE}"; } | sed -e 's/^/ /g') && rm "${PIPEFAILURE_FILE}" >/dev/null 2>&1; then
1424-
PRNERR "Failed to install SCL packages"
1425-
exit 1
1426-
fi
1427-
if ({ RUNCMD "${INSTALLER_BIN}" "${INSTALL_CMD}" "${INSTALL_CMD_ARG}" "${INSTALL_AUTO_ARG}" "${INSTALL_QUIET_ARG}" rh-ruby27 rh-ruby27-ruby-devel rh-ruby27-rubygem-rake || echo > "${PIPEFAILURE_FILE}"; } | sed -e 's/^/ /g') && rm "${PIPEFAILURE_FILE}" >/dev/null 2>&1; then
1428-
PRNERR "Failed to install ruby packages"
1429-
exit 1
1430-
fi
1431-
. /opt/rh/rh-ruby27/enable
1432-
1433-
if ({ RUNCMD "${GEM_BIN}" "${GEM_INSTALL_CMD}" package_cloud || echo > "${PIPEFAILURE_FILE}"; } | sed -e 's/^/ /g') && rm "${PIPEFAILURE_FILE}" >/dev/null 2>&1; then
1434-
PRNERR "Failed to install packagecloud.io upload tools"
1435-
exit 1
1436-
fi
1437-
1438-
elif [ "${IS_OS_ALPINE}" -eq 1 ]; then
1446+
if [ "${IS_OS_ALPINE}" -eq 1 ]; then
14391447
#
14401448
# Case for Alpine
14411449
#
@@ -1565,7 +1573,7 @@ if [ "${CI_DO_PUBLISH}" -eq 1 ]; then
15651573

15661574
else
15671575
#
1568-
# Case for other than CentOS / Alpine / Debian 10 / Rocky Linux 8
1576+
# Case for other than Alpine / Debian 10 / Rocky Linux 8
15691577
#
15701578
if ({ RUNCMD "${GEM_BIN}" "${GEM_INSTALL_CMD}" rake package_cloud || echo > "${PIPEFAILURE_FILE}"; } | sed -e 's/^/ /g') && rm "${PIPEFAILURE_FILE}" >/dev/null 2>&1; then
15711579
PRNERR "Failed to install packagecloud.io upload tools"
@@ -1582,29 +1590,10 @@ PRNSUCCESS "Install published tools for uploading packages to packagecloud.io"
15821590
#--------------------------------------------------------------
15831591
PRNTITLE "Install cppcheck"
15841592

1585-
IS_SET_ANOTHER_REPOSITORIES=0
15861593
if [ "${RUN_CPPCHECK}" -eq 1 ]; then
15871594
PRNINFO "Install cppcheck package."
15881595

1589-
if [ "${IS_OS_CENTOS}" -eq 1 ]; then
1590-
#
1591-
# CentOS
1592-
#
1593-
if ({ RUNCMD "${INSTALLER_BIN}" "${INSTALL_CMD}" "${INSTALL_CMD_ARG}" "${INSTALL_AUTO_ARG}" epel-release || echo > "${PIPEFAILURE_FILE}"; } | sed -e 's/^/ /g') && rm "${PIPEFAILURE_FILE}" >/dev/null 2>&1; then
1594-
PRNERR "Failed to install epel repository"
1595-
exit 1
1596-
fi
1597-
if ({ RUNCMD yum-config-manager --disable epel || echo > "${PIPEFAILURE_FILE}"; } | sed -e 's/^/ /g') && rm "${PIPEFAILURE_FILE}" >/dev/null 2>&1; then
1598-
PRNERR "Failed to disable epel repository"
1599-
exit 1
1600-
fi
1601-
if ({ RUNCMD "${INSTALLER_BIN}" --enablerepo=epel "${INSTALL_CMD}" "${INSTALL_CMD_ARG}" "${INSTALL_AUTO_ARG}" cppcheck || echo > "${PIPEFAILURE_FILE}"; } | sed -e 's/^/ /g') && rm "${PIPEFAILURE_FILE}" >/dev/null 2>&1; then
1602-
PRNERR "Failed to install cppcheck from epel repository"
1603-
exit 1
1604-
fi
1605-
IS_SET_ANOTHER_REPOSITORIES=1
1606-
1607-
elif [ "${IS_OS_FEDORA}" -eq 1 ]; then
1596+
if [ "${IS_OS_FEDORA}" -eq 1 ]; then
16081597
#
16091598
# Fedora
16101599
#
@@ -1647,7 +1636,6 @@ if [ "${RUN_CPPCHECK}" -eq 1 ]; then
16471636
PRNERR "Failed to install cppcheck"
16481637
exit 1
16491638
fi
1650-
IS_SET_ANOTHER_REPOSITORIES=1
16511639

16521640
elif [ "${IS_OS_UBUNTU}" -eq 1 ] || [ "${IS_OS_DEBIAN}" -eq 1 ]; then
16531641
#
@@ -1683,27 +1671,7 @@ PRNTITLE "Install shellcheck"
16831671
if [ "${RUN_SHELLCHECK}" -eq 1 ]; then
16841672
PRNINFO "Install shellcheck package."
16851673

1686-
if [ "${IS_OS_CENTOS}" -eq 1 ]; then
1687-
#
1688-
# CentOS
1689-
#
1690-
if [ "${IS_SET_ANOTHER_REPOSITORIES}" -eq 0 ]; then
1691-
if ({ RUNCMD "${INSTALLER_BIN}" "${INSTALL_CMD}" "${INSTALL_CMD_ARG}" "${INSTALL_AUTO_ARG}" epel-release || echo > "${PIPEFAILURE_FILE}"; } | sed -e 's/^/ /g') && rm "${PIPEFAILURE_FILE}" >/dev/null 2>&1; then
1692-
PRNERR "Failed to install epel repository"
1693-
exit 1
1694-
fi
1695-
if ({ RUNCMD yum-config-manager --disable epel || echo > "${PIPEFAILURE_FILE}"; } | sed -e 's/^/ /g') && rm "${PIPEFAILURE_FILE}" >/dev/null 2>&1; then
1696-
PRNERR "Failed to disable epel repository"
1697-
exit 1
1698-
fi
1699-
IS_SET_ANOTHER_REPOSITORIES=1
1700-
fi
1701-
if ({ RUNCMD "${INSTALLER_BIN}" --enablerepo=epel "${INSTALL_CMD}" "${INSTALL_CMD_ARG}" "${INSTALL_AUTO_ARG}" ShellCheck || echo > "${PIPEFAILURE_FILE}"; } | sed -e 's/^/ /g') && rm "${PIPEFAILURE_FILE}" >/dev/null 2>&1; then
1702-
PRNERR "Failed to install ShellCheck from epel repository"
1703-
exit 1
1704-
fi
1705-
1706-
elif [ "${IS_OS_FEDORA}" -eq 1 ]; then
1674+
if [ "${IS_OS_FEDORA}" -eq 1 ]; then
17071675
#
17081676
# Fedora
17091677
#

0 commit comments

Comments
 (0)
Please sign in to comment.