-
Notifications
You must be signed in to change notification settings - Fork 4
205 lines (171 loc) · 5.91 KB
/
Copy pathcompile.yml
File metadata and controls
205 lines (171 loc) · 5.91 KB
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
name: Compile Test Project
on:
push:
branches: [ main ]
workflow_dispatch:
inputs:
platform:
description: 'Select platform to compile'
required: false
default: 'all'
type: choice
options:
- all
- windows-x64
- linux-x64
- linux-arm64
jobs:
build-windows-x64:
runs-on: windows-latest
name: Build Windows x86_64
if: ${{ github.event.inputs.platform == 'all' || github.event.inputs.platform == 'windows-x64' || github.event_name == 'push' }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install V
run: |
curl -fsSL https://github.com/vlang/v/releases/latest/download/v_windows.zip -o v.zip
Expand-Archive -Force v.zip -DestinationPath C:\v
& C:\v\v\v.exe symlink
- name: Install mingw-w64
uses: msys2/setup-msys2@v2
with:
msystem: UCRT64
update: true
install: mingw-w64-ucrt-x86_64-gcc
- name: Build bny
run: v -os windows . -o bny.exe
- name: Set bny.exe icon
run: script/rcedit-x64.exe bny.exe --set-icon icon.ico
- name: Build cli tools
run: |
v -os windows script/cli.v -o script/cli.exe
v -cc gcc -os windows script/win32.v -o script/win32.exe
- name: Add PHP 8.2
run: ./bny.exe add 8.2
- name: Add composer
run: ./bny.exe composer
- name: Compile webman project
run: |
mkdir -p test/cli
cd test/cli
../../bny.exe php -d extension=openssl ../../composer.phar create-project workerman/webman:~2.0 --no-interaction
Copy-Item webman/windows.php webman/index.php
cd webman
../../../bny.exe compile . -o webman
- name: Compile pebview project
run: |
cd test/gui/pebview
../../../bny.exe php -d extension=ffi -d ffi.enable=true -d extension=openssl ../../../composer.phar require kingbes/pebview
../../../bny.exe compile . -noterm true
- name: Prepare release package
run: |
New-Item -ItemType Directory -Force -Path release/test
Copy-Item test/cli/webman/webman.exe release/test/
Copy-Item test/gui/pebview/pebview.exe release/test/
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: test-windows-x86_64
path: release
if-no-files-found: error
build-linux-x64:
runs-on: ubuntu-latest
name: Build Linux x86_64
if: ${{ github.event.inputs.platform == 'all' || github.event.inputs.platform == 'linux-x64' || github.event_name == 'push' }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install V
run: |
git clone --depth=1 https://github.com/vlang/v
cd v
make
sudo ./v symlink
sudo apt update
sudo apt install curl
- name: Build bny
run: v -os linux . -o bny
- name: Build cli
run: v -os linux script/cli.v -o script/cli
- name: Add PHP 8.2
run: |
./bny add 8.2
./bny php -m
- name: Add composer
run: ./bny composer
- name: Compile webman project
run: |
mkdir -p test/cli
cd test/cli
../../bny composer create-project workerman/webman:~2.0 --no-interaction --repository-url=https://packagist.phpcomposer.com
cp webman/start.php webman/index.php
cd webman
chmod +x ../../bny
../../bny compile . -o webman
- name: Compile pebview project
run: |
cd test/gui/pebview
../../../bny composer require kingbes/pebview --repository-url=https://packagist.phpcomposer.com
../../../bny compile . -noterm true
- name: Prepare release package
run: |
mkdir -p release/test
cp test/cli/webman/webman release/test/
cp test/gui/pebview/pebview release/test/
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: test-linux-x86_64
path: release
if-no-files-found: error
build-linux-arm64:
runs-on: Ubuntu-24.04-arm
name: Build Linux aarch64
if: ${{ github.event.inputs.platform == 'all' || github.event.inputs.platform == 'linux-arm64' || github.event_name == 'push' }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install V
run: |
git clone --depth=1 https://github.com/vlang/v
cd v
make
sudo ./v symlink
sudo apt update
sudo apt install curl
- name: Build bny
run: v -os linux . -o bny
- name: Build cli
run: v -os linux script/cli.v -o script/cli
- name: Add PHP 8.2
run: |
./bny add 8.2
./bny php -m
- name: Add composer
run: ./bny composer
- name: Compile webman project
run: |
mkdir -p test/cli
cd test/cli
../../bny composer create-project workerman/webman:~2.0 --no-interaction --repository-url=https://packagist.phpcomposer.com
cp webman/start.php webman/index.php
cd webman
chmod +x ../../bny
../../bny compile . -o webman
- name: Compile pebview project
run: |
cd test/gui/pebview
../../../bny composer require kingbes/pebview --repository-url=https://packagist.phpcomposer.com
../../../bny compile . -noterm true
- name: Prepare release package
run: |
mkdir -p release/test
cp test/cli/webman/webman release/test/
cp test/gui/pebview/pebview release/test/
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: test-linux-aarch64
path: release
if-no-files-found: error