-
Notifications
You must be signed in to change notification settings - Fork 2
/
frankenphp-8.2.yaml
86 lines (76 loc) · 2.36 KB
/
frankenphp-8.2.yaml
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
package:
name: frankenphp-8.2
version: 1.3.6
epoch: 0
description: "FrankenPHP"
copyright:
- license: MIT
dependencies:
runtime:
- libwatcher-c
- php-frankenphp-8.2
environment:
contents:
packages:
- autoconf
- brotli-dev
- build-base
- busybox
- caddy-src
- go
- libwatcher-c-dev
- libxml2-dev
- php-frankenphp-8.2
- php-frankenphp-8.2-dev
- readline-dev
- sqlite-dev
- xcaddy
pipeline:
- runs: |
mkdir -p "${{targets.destdir}}/var/www/html"
echo "<?php phpinfo();" > ${{targets.destdir}}/var/www/html/index.php
mkdir -p "${{targets.destdir}}/etc/caddy/"
cat <<EOF > "${{targets.destdir}}/etc/caddy/Caddyfile"
{
# Enable FrankenPHP
frankenphp
# Configure when the directive must be executed
order php_server before file_server
}
:8000 {
root * /var/www/html
# Enable compression (optional)
encode zstd br gzip
# Execute PHP files in the current directory and serve assets
php_server
}
EOF
- uses: git-checkout
with:
repository: https://github.com/dunglas/frankenphp
tag: "v${{package.version}}"
expected-commit: 2f93baf984410056286d0de9a34b97b3d6ccd5f9
- name: Build
runs: |
# see https://github.com/dunglas/frankenphp/blob/main/Dockerfile#L90C17-L90C58
export CGO_CFLAGS="-DFRANKENPHP_VERSION=${{package.version}} $(php-config --includes)"
export CGO_LDFLAGS="$(php-config --ldflags) $(php-config --libs)"
export XCADDY_GO_BUILD_FLAGS="-ldflags '-w -s -X \"github.com/caddyserver/caddy/v2.CustomVersion=FrankenPHP (WolfiPHP) ${{ package.version }} Caddy\"'"
export CGO_ENABLED=1
mkdir -p ${{targets.destdir}}/usr/bin/
xcaddy build \
--output ${{targets.destdir}}/usr/bin/frankenphp \
--with github.com/dunglas/frankenphp=./ \
--with github.com/dunglas/frankenphp/caddy=./caddy/ \
--with github.com/caddyserver/caddy/v2=/usr/src/caddy \
--with github.com/dunglas/caddy-cbrotli \
--with github.com/dunglas/mercure/caddy \
--with github.com/dunglas/vulcain/caddy \
--with github.com/caddyserver/cache-handler
- uses: strip
update:
enabled: true
github:
identifier: dunglas/frankenphp
strip-prefix: v
tag-filter: v