Skip to content

Commit 334a030

Browse files
authored
refactor: simplify build steps (#153)
1 parent 91f774a commit 334a030

File tree

1 file changed

+34
-18
lines changed

1 file changed

+34
-18
lines changed

‎./workflows/build-php.yml

+34-18
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,44 @@ jobs:
2828
steps:
2929
- uses: actions/checkout@v4
3030

31+
- name: Set SPC URL for macos-13
32+
shell: bash
33+
if: matrix.os == 'macos-13'
34+
run: echo "SPC_URL=https://dl.static-php.dev/static-php-cli/spc-bin/nightly/spc-macos-x86_64" >> $_ENV
35+
36+
- name: Set SPC URL for macos-latest
37+
shell: bash
38+
if: matrix.os == 'macos-latest'
39+
run: echo "SPC_URL=https://dl.static-php.dev/static-php-cli/spc-bin/nightly/spc-macos-aarch64" >> $_ENV
40+
41+
- name: Set SPC URL for ubuntu-latest and ubuntu-24.04
42+
shell: bash
43+
if: matrix.os == 'ubuntu-latest'
44+
run: echo "SPC_URL=https://dl.static-php.dev/static-php-cli/spc-bin/nightly/spc-linux-x86_64" >> $_ENV
45+
46+
- name: Set SPC URL for ubuntu-24.04-arm
47+
shell: bash
48+
if: matrix.os == 'ubuntu-24.04-arm'
49+
run: echo "SPC_URL=https://dl.static-php.dev/static-php-cli/spc-bin/nightly/spc-linux-aarch64" >> $_ENV
50+
51+
- name: Set SPC URL for windows-latest
52+
shell: bash
53+
if: matrix.os == 'windows-latest'
54+
run: echo "SPC_URL=https://dl.static-php.dev/static-php-cli/spc-bin/nightly/spc-windows-x64.exe" >> $_ENV
55+
3156
- name: Download SPC
3257
shell: bash
3358
run: |
3459
cd ..
35-
git clone https://.com/crazywhalecc/static-php-cli.git
36-
cd static-php-cli
37-
git checkout main
38-
cd ../
60+
curl -fsSL -o spc ${{ env.SPC_URL }}
61+
chmod +x spc
62+
[ ! -d static-php-cli/bin ] && mkdir -p static-php-cli/bin
63+
mv spc static-php-cli/bin/
64+
65+
- name: Create php-bin directory
66+
shell: bash
67+
run: |
68+
cd ..
3969
[ ! -d php-bin ] && mkdir -p php-bin
4070
cd php-bin
4171
@@ -77,20 +107,6 @@ jobs:
77107
extensions: curl, openssl, mbstring, sodium, tokenizer
78108
ini-values: memory_limit=-1
79109

80-
# Cache composer dependencies
81-
- id: cache-spc-composer-deps
82-
uses: actions/cache@v4
83-
with:
84-
path: ../static-php-cli/vendor
85-
key: composer-dependencies
86-
87-
- name: Install SPC Composer dependencies
88-
if: steps.cache-spc-composer-deps.outputs.cache-hit != 'true'
89-
run: |
90-
cd ../static-php-cli
91-
composer update --no-dev --classmap-authoritative
92-
cd ../php-bin
93-
94110
- name: SPC doctor
95111
run: |
96112
cd ../static-php-cli

0 commit comments

Comments
 (0)