Skip to content

Commit

Permalink
feat: add frankenphp with php 8.3
Browse files Browse the repository at this point in the history
  • Loading branch information
shyim committed Mar 29, 2024
1 parent 9e203ab commit 659d978
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/build-all.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ jobs:
--generate-index=false \
-r https://packages.wolfi.dev/os \
-k https://packages.wolfi.dev/os/wolfi-signing.rsa.pub \
-r https://wolfi.fos.gg \
-k https://wolfi.fos.gg/php-signing.rsa.pub \
--signing-key php-signing.rsa \
$file
done
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ jobs:
--generate-index=false \
-r https://packages.wolfi.dev/os \
-k https://packages.wolfi.dev/os/wolfi-signing.rsa.pub \
-r https://wolfi.fos.gg \
-k https://wolfi.fos.gg/php-signing.rsa.pub \
--signing-key php-signing.rsa \
$file
done
Expand Down
68 changes: 68 additions & 0 deletions frankenphp-8.3.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
package:
name: frankenphp-8.3
version: 1.1.2
epoch: 0
description: "FrankenPHP"
copyright:
- license: MIT
dependencies:
runtime:
- php-frankenphp-8.3

environment:
contents:
packages:
- autoconf
- build-base
- busybox
- go
- brotli-dev
- readline-dev
- sqlite-dev
- libxml2-dev
- php-frankenphp-8.3
- php-frankenphp-8.3-dev

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: e7e0dbfa3dcea98f2d19fd9c275324094a2610e9

- name: Build
working-directory: caddy/frankenphp
runs: |
set -e
CGO_CFLAGS=$(php-config --includes) CGO_LDFLAGS="$(php-config --ldflags) $(php-config --libs)" go build
mkdir -p ${{targets.destdir}}/usr/bin/
cp frankenphp ${{targets.destdir}}/usr/bin/frankenphp
update:
enabled: true
github:
identifier: dunglas/frankenphp
strip-prefix: v
tag-filter: v

0 comments on commit 659d978

Please sign in to comment.