Skip to content

Commit d6ee42c

Browse files
committed
Add support to build intl on zts php
1 parent 17e430a commit d6ee42c

File tree

5 files changed

+68
-6
lines changed

5 files changed

+68
-6
lines changed

.github/workflows/dispatch-single-icu-all-php-intl.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ jobs:
1717
fail-fast: false
1818
matrix:
1919
php: ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3']
20+
ts: ['zts', 'nts']
2021
name: php-intl
2122
steps:
2223
- name: ${{github.event.inputs.php}}
@@ -29,6 +30,7 @@ jobs:
2930
- name: Install requirements
3031
run: bash src/install-requirements.sh
3132
env:
33+
TS: ${{ matrix.ts }}
3234
VERSION: ${{ matrix.php }}
3335
- name: Checkout
3436
uses: actions/checkout@v3
@@ -37,6 +39,7 @@ jobs:
3739
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3840
ICU: ${{ github.event.inputs.icu }}
3941
REPO: ${{ github.repository }}
42+
TS: ${{ matrix.ts }}
4043
VERSION: ${{ matrix.php }}
4144
WORKSPACE: ${{ github.workspace }}
4245
run: |
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: 'dispatch-single-ts-single-icu-all-php-intl'
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
icu:
6+
description: ICU version
7+
required: true
8+
ts:
9+
description: thread-safety
10+
required: true
11+
rebuild:
12+
description: rebuild
13+
required: false
14+
15+
jobs:
16+
php-intl:
17+
container: ubuntu:focal
18+
runs-on: ubuntu-latest
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
php: ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3']
23+
name: php-intl
24+
steps:
25+
- name: ${{github.event.inputs.php}}
26+
id: print_details
27+
run: |
28+
echo sender=${{github.event.sender.login}}
29+
echo ICU=${{github.event.inputs.icu}}
30+
echo TS=${{github.event.inputs.ts}}
31+
- name: Checkout
32+
uses: actions/checkout@v3
33+
- name: Install requirements
34+
run: bash src/install-requirements.sh
35+
env:
36+
TS: ${{ github.event.inputs.ts }}
37+
VERSION: ${{ matrix.php }}
38+
- name: Checkout
39+
uses: actions/checkout@v3
40+
- name: Update intl
41+
env:
42+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43+
ICU: ${{ github.event.inputs.icu }}
44+
REPO: ${{ github.repository }}
45+
TS: ${{ github.event.inputs.ts }}
46+
VERSION: ${{ matrix.php }}
47+
WORKSPACE: ${{ github.workspace }}
48+
run: |
49+
existing_version=$(gh release view intl 2>/dev/null | grep -Po "$VERSION-$ICU" | head -n 1)
50+
if [ "$VERSION-$ICU" != "$existing_version" ] || [ "x${{github.event.inputs.rebuild}}" = "xtrue" ]; then
51+
bash src/build-intl.sh
52+
bash src/release-intl.sh
53+
else
54+
echo "intl $VERSION-$ICU build exists"
55+
fi

.github/workflows/intl.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,24 @@ jobs:
1414
matrix:
1515
php: ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3']
1616
icu: [73.1, 72.1, 71.1, 70.1, 69.1, 68.2, 68.1, 67.1, 66.1, 65.1, 64.2, 63.2, 62.2, 61.2, 60.3, 59.2, 58.3, 57.2, 56.2, 55.2, 54.2, 53.2, 52.2, 51.3, 50.2]
17+
ts: ['zts', 'nts']
1718
name: php-intl
1819
steps:
1920
- name: Checkout
2021
uses: actions/checkout@v3
2122
- name: Install requirements
2223
run: bash src/install-requirements.sh
2324
env:
24-
VERSION: ${{ matrix.php }}
25+
TS: ${{ matrix.php }}
26+
VERSION: ${{ matrix.php }}
2527
- name: Checkout
2628
uses: actions/checkout@v3
2729
- name: Update intl
2830
env:
2931
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3032
ICU: ${{ matrix.icu }}
3133
REPO: ${{ github.repository }}
34+
TS: ${{ matrix.php }}
3235
VERSION: ${{ matrix.php }}
3336
WORKSPACE: ${{ github.workspace }}
3437
run: |

src/install-requirements.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ for ppa in ppa:git-core/ppa ppa:ondrej/php; do
1313
done
1414
apt-get update
1515
apt-get install -y git gh
16-
if ! check_package php"$VERSION"; then
16+
if ! check_package php"$VERSION" || [ "${TS:?}" = "zts" ]; then
1717
curl -sSLO https://github.com/shivammathur/php-builder/releases/latest/download/install.sh
1818
chmod a+x ./install.sh
19-
./install.sh local "$VERSION"
19+
./install.sh local "$VERSION" "$TS"
2020
else
2121
apt-get install -y --no-install-recommends php"$VERSION" php"$VERSION"-cli php"$VERSION"-xml php"$VERSION"-dev
2222
fi

src/release-intl.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@ ext_dir=$(php -i | grep "extension_dir => /" | sed -e "s|.*=> s*||")
22
icu_version=$(php -i | grep "ICU version =>" | sed -e "s|.*=> s*||")
33
[ "$icu_version" != "$ICU" ] && exit 1
44
cd "$ext_dir" || exit 1
5-
sudo cp intl.so "${WORKSPACE:?}"/php"$VERSION"-intl-"$ICU".so
5+
[ "${TS:?}" = "zts" ] && suffix=-zts
6+
sudo cp intl.so "${WORKSPACE:?}"/php"$VERSION"-intl-"$ICU$suffix".so
67
cd "${WORKSPACE:?}" || exit 1
78
git config --global --add safe.directory "${WORKSPACE:?}"
89
if ! gh release view intl; then
9-
gh release create "intl" php"$VERSION"-intl-"$ICU".so -t "intl" -n "intl"
10+
gh release create "intl" php"$VERSION"-intl-"$ICU$suffix".so -t "intl" -n "intl"
1011
else
11-
gh release upload "intl" php"$VERSION"-intl-"$ICU".so --clobber
12+
gh release upload "intl" php"$VERSION"-intl-"$ICU$suffix".so --clobber
1213
fi

0 commit comments

Comments
 (0)