mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-18 04:44:53 +08:00
update action and version
This commit is contained in:
parent
bbeb399004
commit
40b6980cdc
105
.github/workflows/build.yml
vendored
105
.github/workflows/build.yml
vendored
@ -28,98 +28,71 @@ env:
|
|||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
# linux:
|
build:
|
||||||
# runs-on: ubuntu-latest
|
strategy:
|
||||||
# steps:
|
matrix:
|
||||||
# - run: sudo apt-get install ninja-build
|
operating-system: [ ubuntu-latest, macos-latest ]
|
||||||
# - run: ninja --version
|
name: static-php-cli build on ${{ matrix.operating-system }}
|
||||||
|
|
||||||
# When windows support is ready, we can use this
|
|
||||||
# windows:
|
|
||||||
# runs-on: windows-latest
|
|
||||||
# steps:
|
|
||||||
# - run: choco install ninja
|
|
||||||
# - run: ninja --version
|
|
||||||
linux:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
- run: sudo apt install musl-tools -y
|
# Install macOS missing packages and mark os suffix
|
||||||
|
- if: ${{ matrix.operating-system == 'macos-latest' }}
|
||||||
|
run: |
|
||||||
|
brew install automake gzip
|
||||||
|
echo "SPC_BUILD_OS=macos" >> $GITHUB_ENV
|
||||||
|
|
||||||
- run: composer update --no-dev
|
# Install Ubuntu missing packages and mark os suffix
|
||||||
|
- if: ${{ matrix.operating-system == 'ubuntu-latest' }}
|
||||||
|
run: |
|
||||||
|
sudo apt install musl-tools -y
|
||||||
|
echo "SPC_BUILD_OS=linux" >> $GITHUB_ENV
|
||||||
|
|
||||||
# If there's no dependencies cache, fetch sources, with or without debug
|
# Cache composer dependencies
|
||||||
- run: ./bin/spc fetch --with-php=${{ inputs.version }} --all --debug
|
- id: cache-${{ env.SPC_BUILD_OS }}-composer-deps
|
||||||
|
|
||||||
# Run the build, with or without debug
|
|
||||||
- if: inputs.debug == true
|
|
||||||
run: echo "SPC_BUILD_DEBUG='--debug'" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- if: ${{ inputs.target == 'micro' || inputs.target == 'all' }}
|
|
||||||
run: echo "SPC_BUILD_TARGET='--build-${{ inputs.target }}'" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- run: ./bin/spc build ${{ inputs.extensions }} ${{ env.SPC_BUILD_DEBUG }} ${{ env.SPC_BUILD_TARGET }}
|
|
||||||
|
|
||||||
- if: ${{ inputs.target == 'cli' || inputs.target == 'all' }}
|
|
||||||
uses: actions/upload-artifact@v3
|
|
||||||
with:
|
|
||||||
name: php-${{ inputs.version }}-linux
|
|
||||||
path: buildroot/bin/php
|
|
||||||
|
|
||||||
- if: ${{ inputs.target == 'micro' || inputs.target == 'all' }}
|
|
||||||
uses: actions/upload-artifact@v3
|
|
||||||
with:
|
|
||||||
name: micro-${{ inputs.version }}-linux
|
|
||||||
path: buildroot/bin/micro.sfx
|
|
||||||
mac:
|
|
||||||
runs-on: macos-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
|
|
||||||
# Install some missing packages
|
|
||||||
- run: brew install automake gzip
|
|
||||||
|
|
||||||
- id: cache-composer-deps
|
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
path: vendor
|
path: vendor
|
||||||
key: composer-dependencies
|
key: ${{ env.SPC_BUILD_OS }}-composer-dependencies
|
||||||
|
|
||||||
# If there's no Composer cache, install dependencies
|
# If there's no Composer cache, install dependencies
|
||||||
- if: steps.cache-composer-deps.outputs.cache-hit != 'true'
|
- if: steps.cache-${{ env.SPC_BUILD_OS }}-composer-deps.outputs.cache-hit != 'true'
|
||||||
run: composer update
|
run: composer update --no-dev
|
||||||
|
|
||||||
- id: cache-build-deps
|
# Cache downloaded source
|
||||||
|
- id: cache-${{ env.SPC_BUILD_OS }}-build-deps
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
path: source
|
path: source
|
||||||
key: php-${{ inputs.version }}-dependencies
|
key: ${{ env.SPC_BUILD_OS }}-php-${{ inputs.version }}-dependencies
|
||||||
|
|
||||||
# If there's no dependencies cache, fetch sources, with or without debug
|
# With or without debug
|
||||||
- if: ${{ steps.cache-build-deps.outputs.cache-hit != 'true' && inputs.debug == true }}
|
|
||||||
run: ./bin/spc fetch --with-php=${{ inputs.version }} --with-openssl11 --all --debug
|
|
||||||
|
|
||||||
- if: ${{ steps.cache-build-deps.outputs.cache-hit != 'true' && inputs.debug == false }}
|
|
||||||
run: ./bin/spc fetch --with-php=${{ inputs.version }} --all
|
|
||||||
|
|
||||||
# Run the build, with or without debug
|
|
||||||
- if: inputs.debug == true
|
- if: inputs.debug == true
|
||||||
run: echo "SPC_BUILD_DEBUG='--debug'" >> $GITHUB_ENV
|
run: echo "SPC_BUILD_DEBUG='--debug'" >> $GITHUB_ENV
|
||||||
|
|
||||||
- if: ${{ inputs.target == 'micro' || inputs.target == 'all' }}
|
# If there's no dependencies cache, fetch sources, with or without debug
|
||||||
run: echo "SPC_BUILD_TARGET='--build-${{ inputs.target }}' >> $GITHUB_ENV
|
- if: ${{ steps.cache-${{ env.SPC_BUILD_OS }}-build-deps.outputs.cache-hit != 'true' && inputs.debug == true }}
|
||||||
|
run: ./bin/spc fetch --with-php=${{ inputs.version }} --all --debug
|
||||||
|
- if: ${{ steps.cache-${{ env.SPC_BUILD_OS }}-build-deps.outputs.cache-hit != 'true' && inputs.debug == false }}
|
||||||
|
run: ./bin/spc fetch --with-php=${{ inputs.version }} --all
|
||||||
|
|
||||||
|
# Build target select: cli, micro or both
|
||||||
|
- if: ${{ inputs.target == 'micro' || inputs.target == 'all' }}
|
||||||
|
run: echo "SPC_BUILD_TARGET='--build-${{ inputs.target }}'" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
# 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_TARGET }}
|
||||||
|
|
||||||
|
# Upload cli executable
|
||||||
- if: ${{ inputs.target == 'cli' || inputs.target == 'all' }}
|
- if: ${{ inputs.target == 'cli' || inputs.target == 'all' }}
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: php-${{ inputs.version }}-macos
|
name: php-${{ inputs.version }}-${{ env.SPC_BUILD_OS }}
|
||||||
path: buildroot/bin/php
|
path: buildroot/bin/php
|
||||||
|
|
||||||
|
# Upload micro self-extracted executable
|
||||||
- if: ${{ inputs.target == 'micro' || inputs.target == 'all' }}
|
- if: ${{ inputs.target == 'micro' || inputs.target == 'all' }}
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: micro-${{ inputs.version }}-macos
|
name: micro-${{ inputs.version }}-${{ env.SPC_BUILD_OS }}
|
||||||
path: buildroot/bin/micro.sfx
|
path: buildroot/bin/micro.sfx
|
||||||
|
|||||||
@ -16,7 +16,7 @@ use Symfony\Component\Console\Command\ListCommand;
|
|||||||
*/
|
*/
|
||||||
class ConsoleApplication extends Application
|
class ConsoleApplication extends Application
|
||||||
{
|
{
|
||||||
public const VERSION = '2.0-alpha2';
|
public const VERSION = '2.0-beta1';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @throws \ReflectionException
|
* @throws \ReflectionException
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user