Skip to content

Commit 0731897

Browse files
committed
add publish
1 parent 4c17f6d commit 0731897

File tree

1 file changed

+64
-0
lines changed

1 file changed

+64
-0
lines changed

.github/workflows/publish.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
2+
name: Publish
3+
4+
on:
5+
push:
6+
branches: [ "main" ]
7+
tags: [ "**" ]
8+
9+
env:
10+
CARGO_TERM_COLOR: always
11+
12+
jobs:
13+
required:
14+
name: Required
15+
needs:
16+
- ci
17+
runs-on: ubuntu-20.04
18+
steps:
19+
- name: Check results
20+
run: |
21+
[[ ${{ needs.ci.result }} == 'success' ]] || exit 1;
22+
23+
ci:
24+
name: CI
25+
strategy:
26+
fail-fast: false
27+
matrix:
28+
os:
29+
- ubuntu-20.04
30+
- macos-12
31+
php-version:
32+
- "8.1"
33+
- "8.2"
34+
- "8.3"
35+
36+
runs-on: ${{ matrix.os }}
37+
steps:
38+
- name: Checkout
39+
uses: actions/checkout@v2
40+
41+
- name: Install libclang for Linux
42+
if: matrix.os == 'ubuntu-20.04'
43+
run: sudo apt-get install -y llvm-10-dev libclang-10-dev
44+
45+
- name: Setup libclang for Macos
46+
if: matrix.os == 'macos-12'
47+
run: |
48+
brew install llvm@13
49+
echo "LIBCLANG_PATH=$(brew --prefix llvm@13)/lib" >> $GITHUB_ENV
50+
51+
- name: Setup PHP
52+
uses: shivammathur/setup-php@v2
53+
with:
54+
php-version: ${{ matrix.php-version }}
55+
tools: php-config
56+
57+
- name: Build
58+
run: cargo build --verbose --release
59+
60+
- name: Create extension file (.so)
61+
uses: actions/upload-artifact@v4
62+
with:
63+
name: php-extension-${{ matrix.os }}-${{ matrix.php-version }}
64+
path: target/release/libphp_ext_fs_notify.so

0 commit comments

Comments
 (0)