Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
34b3462
added build path option
hotrush Mar 3, 2026
941915d
Merge pull request #1 from hotrush/feat/build-path-option
hotrush Mar 3, 2026
d2458ad
Replace existing assets
hotrush Mar 4, 2026
da48aca
Merge pull request #2 from hotrush/feat/asset-replace
hotrush Mar 4, 2026
f772127
Update dist
hotrush Mar 4, 2026
1f36623
Merge pull request #3 from hotrush/feat/update-dist
hotrush Mar 4, 2026
3cba252
feat: add parseArgs function and update build process for better flag…
hotrush Mar 6, 2026
6941cca
feat: add parseArgs function and update build process for better flag…
hotrush Mar 6, 2026
d4eec68
Merge pull request #4 from hotrush/feat/improvements
hotrush Mar 6, 2026
13ca522
mustl output
hotrush Apr 12, 2026
7651e06
musl output
hotrush Apr 12, 2026
08d114f
musl output
hotrush Apr 12, 2026
8b36fc3
Merge pull request #5 from pie-extensions/feat/musl-output
hotrush Apr 12, 2026
c8970a6
APK packages
hotrush Apr 12, 2026
cb4e9a9
Merge pull request #6 from pie-extensions/feat/apk-packages
hotrush Apr 12, 2026
65e09bd
Optimize build process by enabling parallel execution in make commands
hotrush Apr 13, 2026
a6238a7
Optimize build process by enabling parallel execution in make commands
hotrush Apr 13, 2026
13d65d3
Merge pull request #7 from pie-extensions/feat/multi-proc
hotrush Apr 13, 2026
8ccdd3b
Smoke testing
hotrush Apr 20, 2026
4845334
Smoke testing
hotrush Apr 20, 2026
daa6d33
Smoke testing
hotrush Apr 20, 2026
683081a
Merge pull request #8 from pie-extensions/feat/testing
hotrush Apr 20, 2026
f6c539e
Port changes from pie-extensions fork
hotrush Jun 14, 2026
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
94 changes: 82 additions & 12 deletions .github/workflows/end-to-end.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,10 @@ jobs:
- macos-15-intel
- macos-latest
php-versions:
# - 5.6 @todo test ext doesn't currently build on 5.6
- 7.0
- 7.1
- 7.2
- 7.3
- 7.4
- 8.0
- 8.1
- 8.2
- 8.3
- 8.4
- '8.2'
- '8.3'
- '8.4'
- '8.5'
zts-mode:
- ts
- nts
Expand Down Expand Up @@ -83,22 +76,99 @@ jobs:
# debug: ${{ matrix.zend-debug }} @todo may not be able to use https://github.com/shivammathur/setup-php/issues/816
phpts: ${{ matrix.zts-mode }}

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Build dist
run: npm run build

- name: Run the action
id: pie-ext-binary-builder
uses: ./
with:
configure-flags: '--with-hello-name=FROM_MY_ACTION --enable-example-pie-extension'
release-tag: ${{ env.RELEASE_TAG }}
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: Check Output
run: |
echo "Package path: ${{ steps.pie-ext-binary-builder.outputs.package-path }}"
ls -l

test-action-alpine:
runs-on: ${{ matrix.arch == 'x86_64' && 'ubuntu-24.04' || 'ubuntu-24.04-arm' }}
needs: [create-test-release]
strategy:
fail-fast: false
matrix:
arch:
- x86_64
- arm64
php-versions:
- '8.2'
- '8.3'
- '8.4'
- '8.5'
zts-mode:
- ts
- nts
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v6

- name: Checkout test extension
uses: actions/checkout@v6
with:
repository: asgrim/example-pie-extension
path: ext

- name: Move test ext files
run: |
mv ext/composer.json .
mv ext/config.m4 .
mv ext/php_example_pie_extension.h .
mv ext/zend_example_pie_extension.c .

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Build dist
run: npm run build

- name: Run the action
id: pie-ext-binary-builder
uses: ./
with:
configure-flags: '--with-hello-name=FROM_MY_ACTION --enable-example-pie-extension'
release-tag: ${{ env.RELEASE_TAG }}
github-token: ${{ secrets.GITHUB_TOKEN }}
docker-image: ${{ format('php:{0}-{1}-alpine', matrix.php-versions, matrix.zts-mode == 'ts' && 'zts' || 'cli') }}

- name: Check Output
run: |
echo "Package path: ${{ steps.pie-ext-binary-builder.outputs.package-path }}"
ls -l
# Verify the asset name contains musl
echo "${{ steps.pie-ext-binary-builder.outputs.package-path }}" | grep -q "musl" \
|| (echo "ERROR: Expected 'musl' in package name" && exit 1)

delete-test-release:
runs-on: ubuntu-latest
needs: [test-action]
needs: [test-action, test-action-alpine]
steps:
- name: Checkout
uses: actions/checkout@v6
Expand Down
39 changes: 39 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Build and Release

on:
release:
types: [published]

permissions:
contents: write

jobs:
build:
name: Build dist and update tags
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.release.tag_name }}
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- run: npm ci
- run: npm run build
- name: Commit dist to release tag
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add -f dist/
git commit -m "build: compile dist for ${{ github.event.release.tag_name }}"
git push origin HEAD:refs/tags/${{ github.event.release.tag_name }} --force
- name: Update major version tag
run: |
TAG="${{ github.event.release.tag_name }}"
MAJOR=$(echo "$TAG" | grep -oE '^v[0-9]+')
if [ -n "$MAJOR" ]; then
git tag -f "$MAJOR"
git push origin "$MAJOR" --force
echo "Updated $MAJOR → $TAG"
fi
25 changes: 0 additions & 25 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,6 @@ on:
pull_request:

jobs:
check-dist-updated:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6

- name: Setup Node
uses: actions/setup-node@v6
with:
node-version: 20
cache: 'npm'

- name: Install Dependencies
run: npm ci

- name: Rebuild Dist
run: npm run build

- name: Compare Dist
run: |
if [ -n "$(git status --porcelain dist)" ]; then
echo "dist/ is out of date. Please run 'npm run build' and commit the changes."
exit 1
fi

run-unit-tests:
runs-on: ubuntu-latest
steps:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ node_modules/
.idea
.DS_Store
coverage
dist/
14 changes: 11 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Generate Pre-Packaged Binaries for PIE Extensions

> **Fork of [`php/pie-ext-binary-builder`](https://github.com/php/pie-ext-binary-builder)** by James Titcumb.
>
> This fork adds:
> - **`build-path` input** — build from a subdirectory (useful for mirror repos where extension source lives in a subfolder)
> - **Asset replacement** — re-uploads the release asset if one with the same name already exists
> - **CI-built dist** — `dist/` is built on release via GitHub Actions, not committed to the repo

This is a GitHub action designed to help generate pre-packaged binaries for
[PIE (PHP Installer for Extensions)](https://github.com/php/pie) extensions and attach
them to your GitHub releases. It will:
Expand All @@ -21,9 +28,10 @@ a release ready for the action to upload the builds to.
> a draft release, otherwise uploading the assets will fail.

```yaml
uses: php/pie-ext-binary-builder@0.0.2
uses: pie-extensions/pie-ext-binary-builder@v1
with:
configure-flags: '--enable-something --enable-other-things'
build-path: 'ext' # optional, defaults to repo root
release-tag: ${{ github.ref_name }}
github-token: ${{ secrets.GITHUB_TOKEN }}
```
Expand All @@ -35,7 +43,7 @@ with:
| `release-tag` | The tag to use when building the extension; there must be an existing draft release for the tag | `true` | - |
| `github-token` | The GitHub token to use. Usually `${{ secrets.GITHUB_TOKEN }}` would be fine for most cases. | `true` | - |
| `configure-flags` | If you need to pass additional flags to the `./configure` command, specify them here | `false` | `''` |
| `build-path` | Path to the extension source directory containing `config.m4`, relative to repo root | `false` | `'.'` |
| `build-path` | Path to the extension source directory containing `config.m4`, relative to repo root | `false` | `'.'` |

### Outputs

Expand Down Expand Up @@ -120,7 +128,7 @@ jobs:
# the given tag name
- name: Build and release
id: php-ext-binary-builder
uses: php/pie-ext-binary-builder@0.0.2
uses: pie-extensions/pie-ext-binary-builder@v1
with:
release-tag: ${{ github.ref_name }}
github-token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
10 changes: 9 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,17 @@ inputs:
github-token:
description: 'The GitHub token to use for uploading assets'
required: true
docker-image:
description: 'Docker image to run the build inside (e.g. php:8.2-cli-alpine). When set, build and PHP detection run inside this container via docker run.'
required: false
default: ''
apk-packages:
description: 'Additional Alpine packages to install when building with a Docker image (space-separated)'
required: false
default: ''
outputs:
package-path:
description: 'Path to the generated .zip package'
runs:
using: 'node20'
using: 'node24'
main: dist/index.js
Loading
Loading