Skip to content

Commit

Permalink
Add support to build intl on zts php
Browse files Browse the repository at this point in the history
  • Loading branch information
shivammathur committed Jun 7, 2023
1 parent 17e430a commit d6ee42c
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 6 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/dispatch-single-icu-all-php-intl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jobs:
fail-fast: false
matrix:
php: ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3']
ts: ['zts', 'nts']
name: php-intl
steps:
- name: ${{github.event.inputs.php}}
Expand All @@ -29,6 +30,7 @@ jobs:
- name: Install requirements
run: bash src/install-requirements.sh
env:
TS: ${{ matrix.ts }}
VERSION: ${{ matrix.php }}
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -37,6 +39,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ICU: ${{ github.event.inputs.icu }}
REPO: ${{ github.repository }}
TS: ${{ matrix.ts }}
VERSION: ${{ matrix.php }}
WORKSPACE: ${{ github.workspace }}
run: |
Expand Down
55 changes: 55 additions & 0 deletions .github/workflows/dispatch-single-ts-single-icu-all-php-intl.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: 'dispatch-single-ts-single-icu-all-php-intl'
on:
workflow_dispatch:
inputs:
icu:
description: ICU version
required: true
ts:
description: thread-safety
required: true
rebuild:
description: rebuild
required: false

jobs:
php-intl:
container: ubuntu:focal
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3']
name: php-intl
steps:
- name: ${{github.event.inputs.php}}
id: print_details
run: |
echo sender=${{github.event.sender.login}}
echo ICU=${{github.event.inputs.icu}}
echo TS=${{github.event.inputs.ts}}
- name: Checkout
uses: actions/checkout@v3
- name: Install requirements
run: bash src/install-requirements.sh
env:
TS: ${{ github.event.inputs.ts }}
VERSION: ${{ matrix.php }}
- name: Checkout
uses: actions/checkout@v3
- name: Update intl
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ICU: ${{ github.event.inputs.icu }}
REPO: ${{ github.repository }}
TS: ${{ github.event.inputs.ts }}
VERSION: ${{ matrix.php }}
WORKSPACE: ${{ github.workspace }}
run: |
existing_version=$(gh release view intl 2>/dev/null | grep -Po "$VERSION-$ICU" | head -n 1)
if [ "$VERSION-$ICU" != "$existing_version" ] || [ "x${{github.event.inputs.rebuild}}" = "xtrue" ]; then
bash src/build-intl.sh
bash src/release-intl.sh
else
echo "intl $VERSION-$ICU build exists"
fi
5 changes: 4 additions & 1 deletion .github/workflows/intl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,24 @@ jobs:
matrix:
php: ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3']
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]
ts: ['zts', 'nts']
name: php-intl
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install requirements
run: bash src/install-requirements.sh
env:
VERSION: ${{ matrix.php }}
TS: ${{ matrix.php }}
VERSION: ${{ matrix.php }}
- name: Checkout
uses: actions/checkout@v3
- name: Update intl
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ICU: ${{ matrix.icu }}
REPO: ${{ github.repository }}
TS: ${{ matrix.php }}
VERSION: ${{ matrix.php }}
WORKSPACE: ${{ github.workspace }}
run: |
Expand Down
4 changes: 2 additions & 2 deletions src/install-requirements.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ for ppa in ppa:git-core/ppa ppa:ondrej/php; do
done
apt-get update
apt-get install -y git gh
if ! check_package php"$VERSION"; then
if ! check_package php"$VERSION" || [ "${TS:?}" = "zts" ]; then
curl -sSLO https://github.com/shivammathur/php-builder/releases/latest/download/install.sh
chmod a+x ./install.sh
./install.sh local "$VERSION"
./install.sh local "$VERSION" "$TS"
else
apt-get install -y --no-install-recommends php"$VERSION" php"$VERSION"-cli php"$VERSION"-xml php"$VERSION"-dev
fi
Expand Down
7 changes: 4 additions & 3 deletions src/release-intl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ ext_dir=$(php -i | grep "extension_dir => /" | sed -e "s|.*=> s*||")
icu_version=$(php -i | grep "ICU version =>" | sed -e "s|.*=> s*||")
[ "$icu_version" != "$ICU" ] && exit 1
cd "$ext_dir" || exit 1
sudo cp intl.so "${WORKSPACE:?}"/php"$VERSION"-intl-"$ICU".so
[ "${TS:?}" = "zts" ] && suffix=-zts
sudo cp intl.so "${WORKSPACE:?}"/php"$VERSION"-intl-"$ICU$suffix".so
cd "${WORKSPACE:?}" || exit 1
git config --global --add safe.directory "${WORKSPACE:?}"
if ! gh release view intl; then
gh release create "intl" php"$VERSION"-intl-"$ICU".so -t "intl" -n "intl"
gh release create "intl" php"$VERSION"-intl-"$ICU$suffix".so -t "intl" -n "intl"
else
gh release upload "intl" php"$VERSION"-intl-"$ICU".so --clobber
gh release upload "intl" php"$VERSION"-intl-"$ICU$suffix".so --clobber
fi

0 comments on commit d6ee42c

Please sign in to comment.