mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-12 19:35:35 +08:00
change build CI to new builder
This commit is contained in:
42
.github/workflows/build.yml
vendored
42
.github/workflows/build.yml
vendored
@@ -20,16 +20,19 @@ on:
|
|||||||
- '8.1'
|
- '8.1'
|
||||||
- '8.0'
|
- '8.0'
|
||||||
- '7.4'
|
- '7.4'
|
||||||
target:
|
build-cli:
|
||||||
required: true
|
description: build cli binary
|
||||||
description: which SAPI to deploy
|
default: true
|
||||||
default: 'cli'
|
type: boolean
|
||||||
type: choice
|
build-micro:
|
||||||
options:
|
description: build phpmicro binary
|
||||||
- 'cli'
|
type: boolean
|
||||||
- 'micro'
|
build-fpm:
|
||||||
- 'all'
|
description: build fpm binary
|
||||||
|
type: boolean
|
||||||
extensions:
|
extensions:
|
||||||
|
description: extensions to compile (comma separated)
|
||||||
|
required: true
|
||||||
type: string
|
type: string
|
||||||
debug:
|
debug:
|
||||||
type: boolean
|
type: boolean
|
||||||
@@ -79,29 +82,40 @@ jobs:
|
|||||||
run: echo "SPC_BUILD_DEBUG=--debug" >> $GITHUB_ENV
|
run: echo "SPC_BUILD_DEBUG=--debug" >> $GITHUB_ENV
|
||||||
|
|
||||||
# With target select: cli, micro or both
|
# With target select: cli, micro or both
|
||||||
- if: ${{ inputs.target == 'micro' || inputs.target == 'all' }}
|
- if: ${{ inputs.build-cli == true }}
|
||||||
run: echo "SPC_BUILD_TARGET='--build-${{ inputs.target }}'" >> $GITHUB_ENV
|
run: echo "SPC_BUILD_CLI=--build-cli" >> $GITHUB_ENV
|
||||||
|
- if: ${{ inputs.build-micro == true }}
|
||||||
|
run: echo "SPC_BUILD_MICRO=--build-micro" >> $GITHUB_ENV
|
||||||
|
- if: ${{ inputs.build-fpm == true }}
|
||||||
|
run: echo "SPC_BUILD_FPM=--build-fpm" >> $GITHUB_ENV
|
||||||
|
|
||||||
# If there's no dependencies cache, fetch sources, with or without debug
|
# If there's no dependencies cache, fetch sources, with or without debug
|
||||||
- run: CACHE_API_EXEC=yes ./bin/spc fetch --with-php=${{ inputs.version }} --all ${{ env.SPC_BUILD_DEBUG }}
|
- run: CACHE_API_EXEC=yes ./bin/spc fetch --with-php=${{ inputs.version }} --all ${{ env.SPC_BUILD_DEBUG }}
|
||||||
|
|
||||||
# Run build command
|
# Run build command
|
||||||
- run: ./bin/spc build ${{ inputs.extensions }} ${{ env.SPC_BUILD_DEBUG }} ${{ env.SPC_BUILD_TARGET }}
|
- run: ./bin/spc build ${{ inputs.extensions }} ${{ env.SPC_BUILD_DEBUG }} ${{ env.SPC_BUILD_CLI }} ${{ env.SPC_BUILD_MICRO }} ${{ env.SPC_BUILD_FPM }}
|
||||||
|
|
||||||
# Upload cli executable
|
# Upload cli executable
|
||||||
- if: ${{ inputs.target == 'cli' || inputs.target == 'all' }}
|
- if: ${{ inputs.build-cli == true }}
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: php-${{ inputs.version }}-${{ env.SPC_BUILD_OS }}
|
name: php-${{ inputs.version }}-${{ env.SPC_BUILD_OS }}
|
||||||
path: buildroot/bin/php
|
path: buildroot/bin/php
|
||||||
|
|
||||||
# Upload micro self-extracted executable
|
# Upload micro self-extracted executable
|
||||||
- if: ${{ inputs.target == 'micro' || inputs.target == 'all' }}
|
- if: ${{ inputs.build-micro == true }}
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: micro-${{ inputs.version }}-${{ env.SPC_BUILD_OS }}
|
name: micro-${{ inputs.version }}-${{ env.SPC_BUILD_OS }}
|
||||||
path: buildroot/bin/micro.sfx
|
path: buildroot/bin/micro.sfx
|
||||||
|
|
||||||
|
# Upload fpm executable
|
||||||
|
- if: ${{ inputs.build-fpm == true }}
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: php-fpm-${{ inputs.version }}-${{ env.SPC_BUILD_OS }}
|
||||||
|
path: buildroot/bin/php-fpm
|
||||||
|
|
||||||
# Upload extensions metadata
|
# Upload extensions metadata
|
||||||
- uses: actions/upload-artifact@v3
|
- uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
|
|||||||
Reference in New Issue
Block a user