forked from static-php/hosted
-
Notifications
You must be signed in to change notification settings - Fork 0
90 lines (80 loc) · 3.3 KB
/
build-php-bulk.yml
File metadata and controls
90 lines (80 loc) · 3.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
name: Build Self-Hosted PHP Binary (bulk)
on:
workflow_dispatch:
jobs:
build-release-artifacts:
name: "Build ${{ matrix.php-version }} on ${{ matrix.operating-system }}"
runs-on: ${{ matrix.operating-system }}
strategy:
fail-fast: false
max-parallel: 1
matrix:
php-version:
- "8.1"
- "8.2"
- "8.3"
operating-system:
- "ubuntu-latest"
- "macos-latest"
- "macos-14"
extensions:
- apcu,bcmath,bz2,calendar,ctype,curl,dba,dom,event,exif,fileinfo,filter,ftp,gd,gmp,iconv,imagick,imap,intl,mbregex,mbstring,mysqli,mysqlnd,opcache,openssl,pcntl,pdo,pdo_mysql,pdo_pgsql,pdo_sqlite,pgsql,phar,posix,protobuf,readline,redis,session,shmop,simplexml,soap,sockets,sodium,sqlite3,swoole,sysvmsg,sysvsem,sysvshm,tokenizer,xml,xmlreader,xmlwriter,xsl,zip,zlib
steps:
- name: "Checkout"
uses: "actions/checkout@v4"
- name: OS type
id: os-type
run: |
OS=""
if [ "${{ matrix.operating-system }}" = "ubuntu-latest" ]; then
OS="linux-x86_64"
elif [ "${{ matrix.operating-system }}" = "macos-latest" ]; then
OS="macos-x86_64"
elif [ "${{ matrix.operating-system }}" = "macos-14" ]; then
OS="macos-aarch64"
fi
echo "OS=$OS" >> $GITHUB_ENV
- name: Download SPC bin artifact for self-hosted runners
uses: dawidd6/action-download-artifact@v2
with:
repo: crazywhalecc/static-php-cli
branch: main
workflow: release-build.yml
name: "spc-${{ env.OS }}"
- name: Validate SPC bin
run: |
chmod +x spc
./spc --version
- id: cache-download
uses: actions/cache@v3
with:
path: downloads
key: php-${{ matrix.php-version }}-dependencies-for-bulk-extensions
# If there's no dependencies cache, fetch sources
- name: "Download sources"
env:
GITHUB_TOKEN: ${{ secrets.S_GITHUB_TOKEN }}
run: ./spc download --with-php=${{ matrix.php-version }} --for-extensions=${{ matrix.extensions }}
- name: "Build library: ${{ matrix.library }}"
run: |
SPC_USE_SUDO=yes ./spc doctor --auto-fix
./spc build --build-cli --build-micro --with-micro-fake-cli --build-fpm ${{ matrix.extensions }} --debug
PHPVER=$(cat source/php-src/main/php_version.h | grep "PHP_VERSION " | awk -F\" '{print $2}')
mkdir dist/
tar -czf dist/php-$PHPVER-cli-$OS.tar.gz -C buildroot/bin/ php
tar -czf dist/php-$PHPVER-micro-$OS.tar.gz -C buildroot/bin/ micro.sfx
tar -czf dist/php-$PHPVER-fpm-$OS.tar.gz -C buildroot/bin/ php-fpm
if [ "${{ matrix.php-version }}" == "8.3" ] && [ "${{ matrix.operating-system }}" == "ubuntu-latest" ]; then
cp -r buildroot/license dist/
cp buildroot/build-extensions.json dist/
cp buildroot/build-libraries.json dist/
fi
- name: "Upload Artifact"
uses: actions/upload-artifact@v3
with:
name: php-${{ matrix.php-version }}-${{ env.OS }}
path: |
buildroot/bin/php
buildroot/bin/php-fpm
buildroot/bin/micro.sfx
if-no-files-found: error