-
-
Notifications
You must be signed in to change notification settings - Fork 20
184 lines (163 loc) · 5.26 KB
/
linux.yaml
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
name: Linux build
on:
pull_request:
push:
tags:
- '*'
jobs:
x86_64:
name: PHP ${{ matrix.php-version }} ${{ matrix.arch }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php-version: ["8.1"]
arch: ["x86_64"]
max-parallel: 4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Download PHP Cli
id: php_cli
run: |
gh run download 5471614657 -R hyperf/lwmbs -n cli_static_${{ matrix.php-version }}_musl_${{ matrix.arch }}_1245a03ecd8971e80be6c5a88a947035278229272751ab84b382eafd735e9a2c
ls -a
chmod 755 ./php
- name: Download Composer
id: composer
run: |
wget https://getcomposer.org/download/2.4.4/composer.phar
chmod 755 ./composer.phar
- name: Vendor Installation
id: vendor_installation
run: |
cd src
../php ../composer.phar install -o
- name: Create ~/.box folder
id: create_folder
run: |
cd ~
rm -rf .box
mkdir .box
chmod 755 .box
- name: Build Box
id: box
continue-on-error: true
run: |
./php src/bin/hyperf.php config set github.access-token ${{ env.GITHUB_TOKEN }}
./php src/bin/hyperf.php config set-php-version ${{ matrix.php-version }}
./php src/bin/hyperf.php build-prepare
./php src/bin/hyperf.php build-self --no-dev
mv ~/.box/box ./box
./box version
rm -rf ~/.box
- name: Upload artifact for box
if: steps.box.outcome == 'success'
uses: actions/upload-artifact@v3
with:
name: box_${{ matrix.arch }}
path: |
box
- name: Fail if box build failed
if: steps.box.outcome != 'success'
run: |
false
steps:
- name: Get release
id: get_release
uses: bruceadams/get-release@v1.2.3
continue-on-error: true
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload Release Asset
if: steps.box.outcome == 'success' && steps.get_release.outputs.upload_url
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ./box
asset_name: box_${{ matrix.arch }}_linux
asset_content_type: application/x-sh
aarch64:
name: PHP ${{ matrix.php-version }} ${{ matrix.arch }}
runs-on: [self-hosted, linux, arm64]
strategy:
fail-fast: false
matrix:
php-version: [ "8.1" ]
arch: [ "aarch64" ]
max-parallel: 4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Download PHP Cli
id: php_cli
run: |
gh run download 5471614657 -R hyperf/lwmbs -n cli_static_${{ matrix.php-version }}_musl_${{ matrix.arch }}_1245a03ecd8971e80be6c5a88a947035278229272751ab84b382eafd735e9a2c
ls -a
chmod 755 ./php
- name: Download Composer
id: composer
run: |
wget https://getcomposer.org/download/2.4.4/composer.phar
chmod 755 ./composer.phar
- name: Vendor Installation
id: vendor_installation
run: |
cd src
../php ../composer.phar install -o
- name: Create ~/.box folder
id: create_folder
run: |
cd ~
rm -rf ~/.box
mkdir .box
chmod 755 .box
- name: Build Box
id: box
continue-on-error: true
run: |
./php src/bin/hyperf.php config set github.access-token ${{ env.GITHUB_TOKEN }}
./php src/bin/hyperf.php config set-php-version ${{ matrix.php-version }}
./php src/bin/hyperf.php build-prepare
./php src/bin/hyperf.php build-self --no-dev
mv ~/.box/box ./box
./box version
rm -rf ~/.box
- name: Upload artifact for box
if: steps.box.outcome == 'success'
uses: actions/upload-artifact@v3
with:
name: box_${{ matrix.arch }}
path: |
box
- name: Fail if box build failed
if: steps.box.outcome != 'success'
run: |
false
steps:
- name: Get release
id: get_release
uses: bruceadams/get-release@v1.2.3
continue-on-error: true
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload Release Asset
if: steps.box.outcome == 'success' && steps.get_release.outputs.upload_url
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ./box
asset_name: box_${{ matrix.arch }}_linux
asset_content_type: application/x-sh