|
1 | | -name: Build Release Artifacts |
| 1 | +name: Upload SPC Binary (Release) |
2 | 2 |
|
3 | 3 | on: |
4 | 4 | release: |
|
8 | 8 |
|
9 | 9 | jobs: |
10 | 10 | 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 |
13 | 13 | strategy: |
14 | | - fail-fast: false |
15 | 14 | matrix: |
16 | | - php-version: |
17 | | - - "8.1" |
18 | 15 | operating-system: |
19 | | - - "ubuntu-latest" |
20 | | - - "macos-latest" |
| 16 | + - "linux-x86_64" |
| 17 | + - "macos-x86_64" |
| 18 | + - "linux-aarch64" |
| 19 | + - "macos-aarch64" |
21 | 20 | steps: |
22 | 21 | - name: "Checkout" |
23 | 22 | uses: "actions/checkout@v4" |
24 | 23 |
|
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 |
27 | 26 | 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 }}" |
61 | 31 |
|
62 | 32 | - name: "Archive Executable" |
63 | 33 | 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 |
76 | 36 |
|
77 | 37 | - name: upload binaries to release |
78 | 38 | uses: softprops/action-gh-release@v1 |
|
84 | 44 | uses: actions/upload-artifact@v3 |
85 | 45 | with: |
86 | 46 | path: spc |
87 | | - name: spc-${{ env.OS }} |
| 47 | + name: spc-${{ matrix.operating-system }} |
0 commit comments