-
Notifications
You must be signed in to change notification settings - Fork 7
71 lines (59 loc) · 2.14 KB
/
build-windows-release-binary.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: Build Release Binaries
on:
push:
tags:
- "*"
permissions:
contents: write
jobs:
build:
name: Build Binary (Windows)
runs-on: windows-latest
strategy:
fail-fast: false
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: "8.2"
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
- name: Get the version
id: get_version
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $env:GITHUB_ENV
- name: Install dependencies
run: |
composer install --prefer-dist --no-progress --no-dev --quiet
- name: Install SPC
run: |
curl -L spc-windows-x64.exe https://github.com/crazywhalecc/static-php-cli/releases/latest/download/spc-windows-x64.exe
ls
.\spc-windows-x64.exe --version
- name: Build Binary
run: |
php php-parser app:build --build-version=${{ env.VERSION }}
- name: Download PHP
run: |
curl -L 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
ls
tar -xf php-8.3.9-micro-win.zip
mkdir -p buildroot/bin
mv micro.sfx buildroot/bin
- name: SPC Combine
run: |
.\spc-windows-x64.exe micro:combine builds/php-parser -O bin/php-parser-${{ env.VERSION }}-x64-win32
- name: Upload binary as artifact
uses: actions/upload-artifact@v4
with:
name: php-parser-${{ env.VERSION }}-x64-win32
path: bin/php-parser-${{ env.VERSION }}-x64-win32
- name: Create Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
bin/php-parser-${{ env.VERSION }}-x64-win32
fail_on_unmatched_files: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}