Apple silicon build

This commit is contained in:
Kévin Dunglas
2023-09-02 21:34:33 +02:00
parent 12c971575b
commit 7a2997e092

View File

@@ -50,6 +50,11 @@ jobs:
name: Build macOS binaries
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
arch: ['arm64', 'x86_64']
steps:
- uses: actions/checkout@v3
@@ -57,7 +62,7 @@ jobs:
with:
go-version: '1.21'
- run: git clone --depth=1 https://github.com/dunglas/static-php-cli.git --branch=feat/embed
- run: git clone --depth=1 https://github.com/dunglas/static-php-cli.git --branch=feat/cross-compile-apple
- name: Install static-php-cli dependencies
working-directory: static-php-cli/
@@ -75,7 +80,9 @@ jobs:
- name: Build static libphp
working-directory: static-php-cli/
run: ./bin/spc build --enable-zts --build-embed --debug "bcmath,calendar,ctype,curl,dba,dom,exif,filter,fileinfo,gd,iconv,mbstring,mbregex,mysqli,mysqlnd,openssl,pcntl,pdo,pdo_mysql,pdo_pgsql,pdo_sqlite,pgsql,phar,posix,readline,redis,session,simplexml,sockets,sqlite3,tokenizer,xml,xmlreader,xmlwriter,zip,zlib,apcu"
run: |
clang --print-targets
./bin/spc build --arch ${{ matrix.arch }} --enable-zts --build-embed --debug "bcmath,calendar,ctype,curl,dba,dom,exif,filter,fileinfo,gd,iconv,mbstring,mbregex,mysqli,mysqlnd,openssl,pcntl,pdo,pdo_mysql,pdo_pgsql,pdo_sqlite,pgsql,phar,posix,readline,redis,session,simplexml,sockets,sqlite3,tokenizer,xml,xmlreader,xmlwriter,zip,zlib,apcu" || cat source/pkg-config/config.log
- name: Set CGO flags
working-directory: static-php-cli/
@@ -86,9 +93,11 @@ jobs:
- name: Build FrankenPHP
working-directory: caddy/frankenphp/
run: go build -buildmode=pie -tags "cgo netgo osusergo static_build" -ldflags "-linkmode=external -extldflags -static-pie -w -s"
env:
GOARCH: ${{ matrix.arch == 'arm64' && 'arm64' || 'amd64' }}
- name: Upload binary
uses: actions/upload-artifact@v3
with:
name: frankenphp-mac-x86_64-dev
name: frankenphp-mac-${{ matrix.arch }}-dev
path: caddy/frankenphp/frankenphp