Skip to content

refactor: simplify build steps #153

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 26, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 34 additions & 18 deletions .github/workflows/build-php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,44 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Set SPC URL for macos-13
shell: bash
if: matrix.os == 'macos-13'
run: echo "SPC_URL=https://dl.static-php.dev/static-php-cli/spc-bin/nightly/spc-macos-x86_64" >> $GITHUB_ENV

- name: Set SPC URL for macos-latest
shell: bash
if: matrix.os == 'macos-latest'
run: echo "SPC_URL=https://dl.static-php.dev/static-php-cli/spc-bin/nightly/spc-macos-aarch64" >> $GITHUB_ENV

- name: Set SPC URL for ubuntu-latest and ubuntu-24.04
shell: bash
if: matrix.os == 'ubuntu-latest'
run: echo "SPC_URL=https://dl.static-php.dev/static-php-cli/spc-bin/nightly/spc-linux-x86_64" >> $GITHUB_ENV

- name: Set SPC URL for ubuntu-24.04-arm
shell: bash
if: matrix.os == 'ubuntu-24.04-arm'
run: echo "SPC_URL=https://dl.static-php.dev/static-php-cli/spc-bin/nightly/spc-linux-aarch64" >> $GITHUB_ENV

- name: Set SPC URL for windows-latest
shell: bash
if: matrix.os == 'windows-latest'
run: echo "SPC_URL=https://dl.static-php.dev/static-php-cli/spc-bin/nightly/spc-windows-x64.exe" >> $GITHUB_ENV

- name: Download SPC
shell: bash
run: |
cd ..
git clone https://github.com/crazywhalecc/static-php-cli.git
cd static-php-cli
git checkout main
cd ../
curl -fsSL -o spc ${{ env.SPC_URL }}
chmod +x spc
[ ! -d static-php-cli/bin ] && mkdir -p static-php-cli/bin
mv spc static-php-cli/bin/

- name: Create php-bin directory
shell: bash
run: |
cd ..
[ ! -d php-bin ] && mkdir -p php-bin
cd php-bin

Expand Down Expand Up @@ -77,20 +107,6 @@ jobs:
extensions: curl, openssl, mbstring, sodium, tokenizer
ini-values: memory_limit=-1

# Cache composer dependencies
- id: cache-spc-composer-deps
uses: actions/cache@v4
with:
path: ../static-php-cli/vendor
key: composer-dependencies

- name: Install SPC Composer dependencies
if: steps.cache-spc-composer-deps.outputs.cache-hit != 'true'
run: |
cd ../static-php-cli
composer update --no-dev --classmap-authoritative
cd ../php-bin

- name: SPC doctor
run: |
cd ../static-php-cli
Expand Down