Static CLI Build #5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Static CLI build | |
on: | |
push: | |
branches: [ '*' ] | |
pull_request: | |
branches: [ '*' ] | |
jobs: | |
build: | |
name: build ${{ matrix.php-versions }} on macOS x86_64 | |
runs-on: macos-latest | |
strategy: | |
matrix: | |
php-versions: ['8.2'] | |
steps: | |
- uses: actions/checkout@v3 | |
# Install macOS missing packages and mark os suffix | |
- run: | | |
brew install automake gzip | |
echo "SPC_BUILD_OS=macos" >> $GITHUB_ENV | |
# Cache composer dependencies | |
- id: cache-static-php-cli | |
uses: actions/cache@v3 | |
with: | |
path: /tmp/static-php-cli | |
key: cache-static-php-cli | |
- name: Download static-php-cli | |
if: steps.cache-static-php-cli.outputs.cache-hit != 'true' | |
run: | | |
# Clone only the specific commit to save time and space | |
git clone --depth 1 --branch main https://github.com/crazywhalecc/static-php-cli.git /tmp/static-php-cli | |
cd /tmp/static-php-cli | |
git checkout 4e99211bc37ae37aae6ee7918fc7669be505bc9a | |
# Install composer dependencies | |
composer install --no-dev --no-interaction --no-progress --no-suggest --no-scripts --prefer-dist --optimize-autoloader | |
# Cache downloaded source | |
- id: cache-download | |
uses: actions/cache@v3 | |
with: | |
path: /tmp/static-php-cli/downloads | |
key: php-${{ matrix.php-versions }}-dependencies | |
- if: steps.cache-download.outputs.cache-hit != 'true' | |
run: cd /tmp/static-php-cli && ./bin/spc download --with-php=${{ matrix.php-versions }} --all | |
# Run build command | |
- run: cd /tmp/static-php-cli && ./bin/spc build "curl,glfw,mbstring,opcache,zip" --build-cli |