Skip to content

Commit 7124ed8

Browse files
committed
split windows into its own workflow
1 parent cfef1c3 commit 7124ed8

File tree

2 files changed

+72
-43
lines changed

2 files changed

+72
-43
lines changed

.github/workflows/build-release-binaries.yml

+3-43
Original file line numberDiff line numberDiff line change
@@ -19,23 +19,12 @@ jobs:
1919
- os: ubuntu-latest
2020
arch: x64-linux
2121
spc_suffix: linux-x86_64.tar.gz
22-
compressed_file: php-8.3.9-micro-linux-x86_64.tar.gz
23-
micro_suffix: common/php-8.3.9-micro-linux-x86_64.tar.gz
2422
- os: macos-latest
2523
arch: x64-darwin
2624
spc_suffix: macos-x86_64.tar.gz
27-
compressed_file: php-8.3.9-micro-macos-x86_64.tar.gz
28-
micro_suffix: common/php-8.3.9-micro-macos-x86_64.tar.gz
2925
- os: macos-14
3026
arch: arm64-darwin
3127
spc_suffix: macos-aarch64.tar.gz
32-
compressed_file: php-8.3.9-micro-macos-aarch64.tar.gz
33-
micro_suffix: common/php-8.3.9-micro-macos-aarch64.tar.gz
34-
- os: windows-latest
35-
arch: x64-win32
36-
spc_suffix: windows-x86_64.zip
37-
compressed_file: php-8.3.9-micro-win.zip
38-
micro_suffix: windows/spc-max/php-8.3.9-micro-win.zip
3928
steps:
4029
- name: Checkout code
4130
uses: actions/checkout@v4
@@ -68,41 +57,11 @@ jobs:
6857
6958
- name: Download PHP
7059
run: |
71-
curl -O -L "https://dl.static-php.dev/static-php-cli/${{ matrix.micro_suffix }}"
72-
tar xzf "${{ matrix.compressed_file }}"
60+
curl -O -L "https://dl.static-php.dev/static-php-cli/common/php-8.3.9-micro-${{ matrix.spc_suffix }}"
61+
tar xzf "php-8.3.9-micro-${{ matrix.spc_suffix }}"
7362
mkdir -p buildroot/bin
7463
mv micro.sfx buildroot/bin
7564
76-
- name: Extract Archive (Zip)
77-
run: |
78-
unzip "${{ matrix.compressed_file }}"
79-
if: endsWith(matrix.compressed_file, 'zip')
80-
81-
- name: Extract Archive (Tar)
82-
run: |
83-
tar xzf "${{ matrix.compressed_file }}"
84-
if: ${{ !endsWith(matrix.compressed_file, 'zip') }}
85-
86-
- name: Make Binary Directory (Windows)
87-
run: |
88-
if (-not (test-path buildroot/bin)) { mkdir -p buildroot/bin }
89-
if: contains(matrix.os, 'windows')
90-
91-
- name: Make Binary Directory (Linux/Mac)
92-
run: |
93-
mkdir -p buildroot/bin
94-
if: ${{ !contains(matrix.os, 'windows') }}
95-
96-
- name: Move Binary (Windows)
97-
run: |
98-
if (-not (test-path buildroot/bin/micro.sfx)) { mv micro.sfx buildroot/bin }
99-
if: contains(matrix.os, 'windows')
100-
101-
- name: Move Binary (Linux/Mac)
102-
run: |
103-
mv micro.sfx buildroot/bin
104-
if: ${{ !contains(matrix.os, 'windows') }}
105-
10665
- name: SPC Combine
10766
run: |
10867
./spc micro:combine builds/php-parser -O bin/php-parser-${{ env.VERSION }}-${{ matrix.arch }}
@@ -119,5 +78,6 @@ jobs:
11978
with:
12079
files: |
12180
bin/php-parser-${{ env.VERSION }}-${{ matrix.arch }}
81+
fail_on_unmatched_files: true
12282
env:
12383
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: Build Release Binaries
2+
3+
on:
4+
push:
5+
tags:
6+
- "*"
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
build:
13+
name: Build Binary (Windows)
14+
runs-on: windows-latest
15+
strategy:
16+
fail-fast: false
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v4
20+
21+
- name: Setup PHP
22+
uses: shivammathur/setup-php@v2
23+
with:
24+
php-version: "8.2"
25+
extensions: bcmath,calendar,ctype,curl,dba,dom,exif,fileinfo,filter,iconv,mbstring,openssl,pcntl,pdo_mysql,pdo_sqlite,pdo,phar,posix,readline,session,simplexml,sockets,sodium,sqlite3,tokenizer,xml,xmlreader,xmlwriter,zip,zlib
26+
27+
- name: Get the version
28+
id: get_version
29+
run: echo ("VERSION=" + $env:GITHUB_REF#refs/tags/) >> $env:GITHUB_ENV
30+
31+
- name: Install dependencies
32+
run: |
33+
composer install --prefer-dist --no-progress --no-dev --quiet
34+
35+
- name: Install SPC
36+
run: |
37+
wget -O spc-windows-x64.exe https://github.com/crazywhalecc/static-php-cli/releases/latest/download/spc-windows-x64.exe
38+
.\spc-windows-x64.exe --version
39+
40+
- name: Build Binary
41+
run: |
42+
php php-parser app:build --build-version=${{ env.VERSION }}
43+
44+
- name: Download PHP
45+
run: |
46+
wget -O php-8.3.9-micro-win.zip https://dl.static-php.dev/static-php-cli/windows/spc-max/php-8.3.9-micro-win.zip
47+
tar -xf php-8.3.9-micro-win.zip
48+
mkdir -p buildroot/bin
49+
mv micro.sfx buildroot/bin
50+
51+
- name: SPC Combine
52+
run: |
53+
.\spc-windows-x64.exe micro:combine builds/php-parser -O bin/php-parser-${{ env.VERSION }}-x64-win32
54+
55+
- name: Upload binary as artifact
56+
uses: actions/upload-artifact@v4
57+
with:
58+
name: php-parser-${{ env.VERSION }}-x64-win32
59+
path: bin/php-parser-${{ env.VERSION }}-x64-win32
60+
61+
- name: Create Release
62+
uses: softprops/action-gh-release@v1
63+
if: startsWith(github.ref, 'refs/tags/')
64+
with:
65+
files: |
66+
bin/php-parser-${{ env.VERSION }}-x64-win32
67+
fail_on_unmatched_files: true
68+
env:
69+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)