Skip to content

Commit cb48044

Browse files
committed
Refactor workflows into scripts [skip ci]
Remove bintray
1 parent 03688d5 commit cb48044

15 files changed

+199
-350
lines changed

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

-91
This file was deleted.

.github/workflows/dispatch-single-icu.yaml

-50
This file was deleted.
+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: 'dispatch-single-icu'
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
icu:
6+
description: ICU version
7+
required: true
8+
jobs:
9+
icu:
10+
runs-on: ubuntu-latest
11+
name: icu4c
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v2
15+
- name: Build icu
16+
env:
17+
ICU: ${{ github.event.inputs.icu }}
18+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
19+
WORKSPACE: ${{ github.workspace }}
20+
run: |
21+
existing_version=$(gh release view icu4c 2>/dev/null | grep -Po $ICU | head -n 1)
22+
if [ "$ICU" != "$existing_version" ]; then
23+
bash src/build-icu4c.sh
24+
bash src/release-icu4c.sh
25+
else
26+
echo "icu4c $ICU build exists"
27+
fi

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

+17-66
Original file line numberDiff line numberDiff line change
@@ -2,94 +2,45 @@ name: 'dispatch-single-php-intl'
22
on:
33
workflow_dispatch:
44
inputs:
5-
php:
6-
description: PHP version
7-
required: true
85
icu:
96
description: ICU version
107
required: true
118

129
jobs:
1310
php-intl:
14-
container: ubuntu:bionic
11+
container: ubuntu:focal
1512
runs-on: ubuntu-latest
1613
strategy:
1714
fail-fast: false
15+
matrix:
16+
php: ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0']
1817
name: php-intl
1918
steps:
2019
- name: ${{github.event.inputs.php}}
2120
id: print_details
2221
run: |
2322
echo sender=${{github.event.sender.login}}
24-
echo PHP=${{github.event.inputs.php}}
2523
echo ICU=${{github.event.inputs.icu}}
2624
- name: Checkout
2725
uses: actions/checkout@v2
26+
- name: Install requirements
27+
run: bash src/install-requirements.sh
28+
env:
29+
VERSION: ${{ matrix.php }}
30+
- name: Checkout
31+
uses: actions/checkout@v2
2832
- name: Update intl
2933
env:
30-
ICU: ${{github.event.inputs.icu}}
31-
BINTRAY_KEY: ${{ secrets.bintray_key }}
32-
BINTRAY_REPO: icu4c
33-
BINTRAY_USER: ${{ github.repository_owner }}
34-
VERSION: ${{github.event.inputs.php}}
34+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
35+
ICU: ${{ github.event.inputs.icu }}
36+
REPO: ${{ github.repository }}
37+
VERSION: ${{ matrix.php }}
38+
WORKSPACE: ${{ github.workspace }}
3539
run: |
36-
apt-get -y update
37-
apt-get install -y sudo curl
38-
existing_version=$(curl --user "$BINTRAY_USER":"$BINTRAY_KEY" -s https://api.bintray.com/packages/"$BINTRAY_USER"/"$BINTRAY_REPO"/php-intl | grep -Po "$VERSION-$ICU" | head -n 1)
40+
existing_version=$(gh release view intl 2>/dev/null | grep -Po "$VERSION-$ICU" | head -n 1)
3941
if [ "$VERSION-$ICU" != "$existing_version" ]; then
40-
sudo apt-get install -y gnupg make automake zstd software-properties-common pkg-config
41-
LC_ALL=C.UTF-8 sudo DEBIAN_FRONTEND=noninteractive apt-add-repository ppa:ondrej/php -y
42-
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y php$VERSION php$VERSION-xml php$VERSION-dev
43-
ext_dir=$(php -i | grep "extension_dir => /" | sed -e "s|.*=> s*||")
44-
scan_dir=$(php --ini | grep additional | sed -e "s|.*: s*||")
45-
ini_file=$(php --ini | grep "Loaded Configuration" | sed -e "s|.*:s*||" | sed "s/ //g")
46-
pecl_file="$scan_dir"/99-pecl.ini
47-
get_tag() {
48-
echo "php-$(php -v | head -n 1 | cut -f 2 -d ' ' | cut -f 1 -d '-')"
49-
}
50-
get_php() {
51-
curl -sL "https://github.com/php/php-src/archive/$tag.tar.gz" | tar xzf - -C "/tmp"
52-
}
53-
check_extension() {
54-
extension=$1
55-
if [ "$extension" != "mysql" ]; then
56-
php -m | grep -i -q -w "$extension"
57-
else
58-
php -m | grep -i -q "$extension"
59-
fi
60-
}
61-
enable_extension() {
62-
if ! check_extension "$1" && [ -e "$ext_dir/$1.so" ]; then
63-
echo "$2=$1.so" >>"$pecl_file"
64-
fi
65-
}
66-
install_icu() {
67-
sudo curl -o /tmp/icu.tar.zst -sL https://dl.bintray.com/shivammathur/icu4c/icu4c-$ICU.tar.zst
68-
sudo tar -I zstd -xf /tmp/icu.tar.zst -C /usr/local
69-
sudo cp -r /usr/local/icu/* /usr/
70-
sudo cp -r /usr/local/icu/lib/* /usr/lib/x86_64-linux-gnu/
71-
}
72-
install_intl() {
73-
tag=$(get_tag)
74-
get_php
75-
(
76-
cd "/tmp/php-src-$tag/ext/intl" || exit 1
77-
phpize && sudo ./configure --with-php-config="$(command -v php-config)" --enable-intl
78-
echo "#define FALSE 0" >> config.h
79-
echo "#define TRUE 1" >> config.h
80-
sudo make CXXFLAGS="-O2 -std=c++11 -DU_USING_ICU_NAMESPACE=1 -DTRUE=1 -DFALSE=0 $CXXFLAGS"
81-
sudo cp ./modules/* "$ext_dir/"
82-
enable_extension intl extension
83-
)
84-
}
85-
install_icu
86-
install_intl
87-
icu_version=$(php -i | grep "ICU version =>" | sed -e "s|.*=> s*||")
88-
[ "$icu_version" != "$ICU" ] && exit 1
89-
cd "$ext_dir" || exit 1
90-
curl --user "$BINTRAY_USER":"$BINTRAY_KEY" -X DELETE https://api.bintray.com/content/"$BINTRAY_USER"/"$BINTRAY_REPO"/php"$VERSION"-intl-"$ICU".so || true
91-
curl --user "$BINTRAY_USER":"$BINTRAY_KEY" -T intl.so https://api.bintray.com/content/"$BINTRAY_USER"/"$BINTRAY_REPO"/php-intl/"$VERSION-$ICU"/php"$VERSION"-intl-"$ICU".so || true
92-
curl --user "$BINTRAY_USER":"$BINTRAY_KEY" -X POST https://api.bintray.com/content/"$BINTRAY_USER"/"$BINTRAY_REPO"/php-intl/"$VERSION-$ICU"/publish || true
42+
bash src/build-intl.sh
43+
bash src/release-intl.sh
9344
else
9445
echo "intl $VERSION-$ICU build exists"
9546
fi

.github/workflows/icu.yaml

-49
This file was deleted.

.github/workflows/icu.yml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: 'icu'
2+
on:
3+
workflow_dispatch:
4+
jobs:
5+
icu:
6+
runs-on: ubuntu-latest
7+
strategy:
8+
fail-fast: false
9+
matrix:
10+
icu: [50.2, 51.3, 52.2, 53.2, 54.2, 55.2, 56.2, 57.2, 58.3, 59.2, 60.3, 61.2, 62.2, 63.2, 64.2, 65.1, 66.1, 67.1, 68.1, 68.2]
11+
name: icu4c
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v2
15+
- name: Build icu
16+
env:
17+
ICU: ${{ matrix.icu }}
18+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
19+
WORKSPACE: ${{ github.workspace }}
20+
run: |
21+
existing_version=$(gh release view icu4c 2>/dev/null | grep -Po $ICU | head -n 1)
22+
if [ "$ICU" != "$existing_version" ]; then
23+
bash src/build-icu4c.sh
24+
bash src/release-icu4c.sh
25+
else
26+
echo "icu4c $ICU build exists"
27+
fi

0 commit comments

Comments
 (0)