Skip to content

Commit fbe149b

Browse files
committed
reuse static-php-cli-hosted workflows
1 parent 92cafb3 commit fbe149b

File tree

1 file changed

+16
-56
lines changed

1 file changed

+16
-56
lines changed
Lines changed: 16 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build Release Artifacts
1+
name: Upload SPC Binary (Release)
22

33
on:
44
release:
@@ -8,71 +8,31 @@ on:
88

99
jobs:
1010
build-release-artifacts:
11-
name: "Build Release Artifacts"
12-
runs-on: ${{ matrix.operating-system }}
11+
name: "Upload SPC Binary (Release)"
12+
runs-on: ubuntu-latest
1313
strategy:
14-
fail-fast: false
1514
matrix:
16-
php-version:
17-
- "8.1"
1815
operating-system:
19-
- "ubuntu-latest"
20-
- "macos-latest"
16+
- "linux-x86_64"
17+
- "macos-x86_64"
18+
- "linux-aarch64"
19+
- "macos-aarch64"
2120
steps:
2221
- name: "Checkout"
2322
uses: "actions/checkout@v4"
2423

25-
- name: "Install PHP"
26-
uses: "shivammathur/setup-php@v2"
24+
- name: Reuse static-php-cli-hosted artifacts
25+
uses: dawidd6/action-download-artifact@v2
2726
with:
28-
coverage: none
29-
tools: composer:v2
30-
php-version: "${{ matrix.php-version }}"
31-
ini-values: memory_limit=-1
32-
33-
- name: "Get Composer Cache Directory"
34-
id: composer-cache
35-
run: |
36-
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
37-
38-
- name: "Cache Composer dependencies"
39-
uses: "actions/cache@v3"
40-
with:
41-
path: "${{ steps.composer-cache.outputs.dir }}"
42-
key: "php-${{ matrix.php-version }}-locked-composer-${{ hashFiles('**/composer.lock') }}"
43-
restore-keys: |
44-
php-${{ matrix.php-version }}-locked-composer-
45-
- name: "Install locked dependencies"
46-
run: "composer install --no-interaction --no-progress"
47-
48-
- name: "Download sources"
49-
run: bin/spc download --with-php=${{ matrix.php-version }} php-src,micro,pkg-config,onig,zlib
50-
51-
- name: "Build phpmicro"
52-
run: |
53-
SPC_USE_SUDO=yes bin/spc doctor --auto-fix
54-
bin/spc build pcntl,posix,mbstring,tokenizer,phar --build-micro
55-
56-
- name: "Build PHAR file"
57-
run: "composer build:phar"
58-
59-
- name: "Generate Executable"
60-
run: "bin/spc micro:combine spc.phar -O spc"
27+
repo: crazywhalecc/static-php-cli-hosted
28+
branch: master
29+
workflow: build-spc-release.yml
30+
name: "spc-${{ matrix.operating-system }}"
6131

6232
- name: "Archive Executable"
6333
run: |
64-
OS=""
65-
if [ "${{ matrix.operating-system }}" = "ubuntu-latest" ]; then
66-
OS="linux-x86_64"
67-
elif [ "${{ matrix.operating-system }}" = "macos-latest" ]; then
68-
OS="macos-x86_64"
69-
fi
70-
tar -czf spc-$OS.tar.gz spc
71-
echo "filename=spc-$OS.tar.gz" >> $GITHUB_ENV
72-
echo "OS=$OS" >> $GITHUB_ENV
73-
74-
- name: "Test Micro file"
75-
run: "./spc dev:extensions"
34+
tar -czf spc-${{ matrix.operating-system }}.tar.gz spc
35+
echo "filename=spc-${{ matrix.operating-system }}.tar.gz" >> $GITHUB_ENV
7636
7737
- name: upload binaries to release
7838
uses: softprops/action-gh-release@v1
@@ -84,4 +44,4 @@ jobs:
8444
uses: actions/upload-artifact@v3
8545
with:
8646
path: spc
87-
name: spc-${{ env.OS }}
47+
name: spc-${{ matrix.operating-system }}

0 commit comments

Comments
 (0)