ext-php-rs icon indicating copy to clipboard operation
ext-php-rs copied to clipboard

Distributing extension

Open nikeee opened this issue 2 years ago • 6 comments

Is there a go-to solution for packaging the built extension?

I'd like to offer a .deb package and I'm wondering if there is an easy way to do this.

There are some things online about creating it manually:

  • Package php extensions: https://www.frandieguez.dev/posts/how-to-easily-create-debian-packages-for-php-extensions/
  • Package php extensions: https://www.dotdeb.org/2008/09/25/how-to-package-php-extensions-by-yourself/
  • Packaging rust binaries as deb package: https://github.com/kornelski/cargo-deb

Extensions can also be installed via PECL. If .deb is not an option, would that be a viable thing?

nikeee avatar Dec 13 '22 23:12 nikeee

Hello! Yes easily distributing an extension is in my mind. For the moment you had to setup a CI with matrix of all targets you want to distribute + all PHP versions for each. The same apply with packaging a .deb. We have no easy way for the moment but example is welcome!

ptondereau avatar Dec 14 '22 08:12 ptondereau

If you want another example, here's my GitHub Actions workflow: https://github.com/joehoyle/php-v8js/blob/main/.github/workflows/build.yml which does x86/arm64 builds for linux and macos for PHP 8, 8.1 and 8.2

joehoyle avatar Jan 17 '23 18:01 joehoyle

@joehoyle would be happy if you can provide a PR here to add this example

ptondereau avatar Jan 17 '23 20:01 ptondereau

@ptondereau is that best under the Guides in the book? Perhaps getting-started/build-github-workflow or something

joehoyle avatar Jan 18 '23 11:01 joehoyle

@ptondereau is that best under the Guides in the book? Perhaps getting-started/build-github-workflow or something

Could be a good start indeed!

ptondereau avatar Jan 18 '23 12:01 ptondereau

@rmccue also put together https://github.com/humanmade/ext-php-rs-starter

joehoyle avatar Nov 24 '23 13:11 joehoyle