-
Notifications
You must be signed in to change notification settings - Fork 1
84 lines (80 loc) · 2.5 KB
/
test.yml
File metadata and controls
84 lines (80 loc) · 2.5 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
name: test
on:
pull_request:
branches:
- main
env:
APP_NAME: 'manticore-executor'
PHP_VERSION: '8.4.18'
MAINTAINER: 'Manticore'
DESC: 'Custom built PHP executor for Manticore.'
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- job_name: 'Build static in Alpine'
os: ubuntu-22.04
use_docker: true
script_name: ./build-alpine
arch: amd64
build_type: alpine
- job_name: 'Build dev version in Jammy'
os: ubuntu-22.04
use_docker: false
script_name: ./build-linux
arch: amd64
build_type: jammy
- job_name: 'Build static on amd64 OSX'
os: macos-15-intel
use_docker: false
script_name: ./build-osx
arch: amd64
build_type: osx
- job_name: 'Build static on arm64 OSX'
os: macos-15
use_docker: false
script_name: ./build-osx
arch: arm64
build_type: osx
steps:
- uses: actions/checkout@v4
- uses: ilammy/msvc-dev-cmd@v1.11.0
with:
uwp: true
- name: Build binary using host OS
if: ${{ matrix.use_docker == false }}
run: ${{ matrix.script_name }} ${{ env.PHP_VERSION }}
- name: Build binary using Docker
if: ${{ matrix.use_docker == true }}
run: docker run -v ${PWD}:/src -w /src alpine:3.21 sh -c "apk add sudo bash; ${{ matrix.script_name }} ${{ env.PHP_VERSION }}"
- name: Create artifact
run: |
os="${{ runner.os }}"
assets="${{ env.APP_NAME }}_${{ matrix.build_type }}_${{ matrix.arch }}"
echo "$assets"
mkdir -p "dist/$assets"
if [[ "${{ runner.os }}" == Windows ]]; then
mv build/dist/php.exe build/dist/${{ env.APP_NAME }}.exe
cp build/dist/* "dist/$assets/"
else
cp build/dist/bin/php "dist/$assets/${{ env.APP_NAME }}"
fi
cp README.* "dist/$assets/"
(
cd dist
if [[ "${{ runner.os }}" == Windows ]]; then
7z a "$assets.zip" "$assets"
else
tar czf "$assets.tar.gz" "$assets"
fi
ls -lah *.*
)
shell: bash
- uses: actions/upload-artifact@v4
with:
name: artifact-${{ matrix.build_type }}-${{ matrix.arch }}
path: |
dist/*.tar.gz
dist/*.zip