Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions .github/workflows/build-extension.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,23 @@ jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, ubuntu-24.04-arm]
php: ["8.2", "8.3", "8.4", "8.5"]
include:
- os: ubuntu-latest
arch: amd64
- os: ubuntu-24.04-arm
- os: ubuntu-24.04-arm
arch: arm64
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build and push

- name: Build
run: |
IMAGE=${{ env.REGISTRY }}/${{ github.repository }}:latest
docker build -t ${IMAGE}-${{matrix.arch}} --build-arg=PHP_VERSION=8.4 extension
IMAGE=${{ env.REGISTRY }}/${{ github.repository }}:latest
docker build \
-t ${IMAGE}-php${{ matrix.php }}-${{ matrix.arch }} \
--build-arg=PHP_VERSION=${{ matrix.php }} \
extension\
5 changes: 4 additions & 1 deletion .github/workflows/release-extension.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,18 @@ jobs:
run: |
IMAGE=${{ env.REGISTRY }}/${{ github.repository }}-extension:${{ github.ref_name }}
cd extension
docker build --no-cache --build-arg=PHP_VERSION=8.5 -t ${IMAGE}-php8.5-${{ matrix.arch }} .
docker build --no-cache --build-arg=PHP_VERSION=8.4 -t ${IMAGE}-php8.4-${{ matrix.arch }} .
docker build --no-cache --build-arg=PHP_VERSION=8.3 -t ${IMAGE}-php8.3-${{ matrix.arch }} .
docker build --no-cache --build-arg=PHP_VERSION=8.2 -t ${IMAGE}-php8.2-${{ matrix.arch }} .

- name: ☁️ Push
run: |
IMAGE=${{ env.REGISTRY }}/${{ github.repository }}-extension:${{ github.ref_name }}
docker push ${IMAGE}-php8.5-${{matrix.arch}}
docker push ${IMAGE}-php8.4-${{matrix.arch}}
docker push ${IMAGE}-php8.3-${{matrix.arch}}
docker push ${IMAGE}-php8.2-${{matrix.arch}}

manifest:
name: Manifest
runs-on: ubuntu-latest
Expand All @@ -75,6 +76,8 @@ jobs:
- name: ☁️ Push
run: |
IMAGE=${{ env.REGISTRY }}/${{ github.repository }}-extension:${{ github.ref_name }}
docker manifest create ${IMAGE}-php8.5 --amend ${IMAGE}-php8.5-arm64 --amend ${IMAGE}-php8.5-amd64
docker manifest push ${IMAGE}-php8.5
docker manifest create ${IMAGE}-php8.4 --amend ${IMAGE}-php8.4-arm64 --amend ${IMAGE}-php8.4-amd64
docker manifest push ${IMAGE}-php8.4
docker manifest create ${IMAGE}-php8.3 --amend ${IMAGE}-php8.3-arm64 --amend ${IMAGE}-php8.3-amd64
Expand Down
10 changes: 9 additions & 1 deletion extension/.devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
FROM ghcr.io/skpr/php-cli:8.4-v2-stable
FROM alpine:3.21

USER root

RUN apk add --no-cache curl && \
curl -sSL https://packages.skpr.io/php-alpine/skpr.rsa.pub -o /etc/apk/keys/skpr.rsa.pub && \
echo "https://packages.skpr.io/php-alpine/3.21/php8.4" >> /etc/apk/repositories

RUN apk add alpine-sdk \
clang \
clang-dev \
git \
php8.4 \
php8.4-dev

ENV MISE_DATA_DIR="/mise"
Expand All @@ -19,3 +24,6 @@ RUN curl https://mise.run | sh
ENV RUSTFLAGS="-C target-feature=-crt-static"

ENV RUST_BACKTRACE=full

WORKDIR /data

15 changes: 5 additions & 10 deletions extension/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion extension/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ crate-type = ["lib", "cdylib"]
[dependencies]
anyhow = "1.0.100"
coarsetime = "0.1.36"
phper = "0.17.1"
phper = { git = "https://github.com/phper-framework/phper.git", rev = "0689edbb59ec09adda90403c173c373949066ec5" }
probe = "0.5.2"
once_cell = "1.21.3"
nix = "0.30.1"
Expand Down
13 changes: 9 additions & 4 deletions extension/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
ARG PHP_VERSION=8.3
FROM ghcr.io/skpr/php-cli:${PHP_VERSION}-v2-stable AS build

FROM alpine:3.21 AS build
ARG PHP_VERSION=8.3

USER root

RUN apk add alpine-sdk clang clang-dev php${PHP_VERSION}-dev
RUN apk add --no-cache curl && \
curl -sSL https://packages.skpr.io/php-alpine/skpr.rsa.pub -o /etc/apk/keys/skpr.rsa.pub && \
echo "https://packages.skpr.io/php-alpine/3.21/php${PHP_VERSION}" >> /etc/apk/repositories

RUN apk add alpine-sdk clang clang-dev php${PHP_VERSION} php${PHP_VERSION}-dev

ENV MISE_DATA_DIR="/mise"
ENV MISE_CONFIG_DIR="/mise"
Expand All @@ -18,14 +21,16 @@ RUN curl https://mise.run | sh
ENV RUSTFLAGS="-C target-feature=-crt-static"
ENV RUST_BACKTRACE=full

WORKDIR /data

ADD --chown=skpr:skpr . /data
RUN mise trust .

RUN mise run lint
RUN mise run build
RUN mise run validate

FROM ghcr.io/skpr/php-cli:${PHP_VERSION}-v2-stable
FROM scratch

COPY compass.ini /etc/php/conf.d/00_compass.ini
COPY --from=build /data/target/release/libcompass_extension.so /usr/lib/php/modules/compass.so