-
-
Notifications
You must be signed in to change notification settings - Fork 38
122 lines (106 loc) · 3.31 KB
/
php-release.yml
File metadata and controls
122 lines (106 loc) · 3.31 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
name: "[PHP] Release"
on:
push:
tags:
- php-v*
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-24.04
target: x86_64-unknown-linux-gnu
php: "8.2"
artifact: libcss_inline_php.so
- os: ubuntu-24.04
target: x86_64-unknown-linux-gnu
php: "8.3"
artifact: libcss_inline_php.so
- os: ubuntu-24.04
target: x86_64-unknown-linux-gnu
php: "8.4"
artifact: libcss_inline_php.so
- os: macos-15-intel
target: x86_64-apple-darwin
php: "8.2"
artifact: libcss_inline_php.dylib
- os: macos-15-intel
target: x86_64-apple-darwin
php: "8.3"
artifact: libcss_inline_php.dylib
- os: macos-15-intel
target: x86_64-apple-darwin
php: "8.4"
artifact: libcss_inline_php.dylib
- os: macos-15
target: aarch64-apple-darwin
php: "8.2"
artifact: libcss_inline_php.dylib
- os: macos-15
target: aarch64-apple-darwin
php: "8.3"
artifact: libcss_inline_php.dylib
- os: macos-15
target: aarch64-apple-darwin
php: "8.4"
artifact: libcss_inline_php.dylib
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v6
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.cross && matrix.target || '' }}
- uses: Swatinem/rust-cache@v2
with:
workspaces: bindings/php
cache-all-crates: "true"
- name: Build
run: |
if [ "${{ matrix.cross }}" = "true" ]; then
cargo build --release --target ${{ matrix.target }}
else
cargo build --release
fi
working-directory: bindings/php
- name: Rename artifact
run: |
mkdir -p dist
if [ "${{ matrix.cross }}" = "true" ]; then
cp bindings/php/target/${{ matrix.target }}/release/${{ matrix.artifact }} dist/css_inline-php${{ matrix.php }}-${{ matrix.target }}.so
else
cp bindings/php/target/release/${{ matrix.artifact }} dist/css_inline-php${{ matrix.php }}-${{ matrix.target }}.so
fi
- name: Upload artifact
uses: actions/upload-artifact@v7
with:
name: css_inline-php${{ matrix.php }}-${{ matrix.target }}
path: dist/
release:
needs: build
runs-on: ubuntu-24.04
permissions:
contents: write
steps:
- uses: actions/checkout@v6
- name: Extract Version
run: echo "version=${GITHUB_REF#refs/tags/php-v}" >> $GITHUB_ENV
- name: Download all artifacts
uses: actions/download-artifact@v8
with:
path: artifacts
merge-multiple: true
- name: List artifacts
run: ls -la artifacts/
- name: GitHub Release
uses: softprops/action-gh-release@v2
with:
make_latest: false
draft: true
name: "[PHP] Release ${{ env.version }}"
files: artifacts/*