chore: Release php-ext-fs-notify version 0.2.0 #7
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish | |
on: | |
push: | |
tags: | |
- v* | |
permissions: | |
contents: write | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
create_release: | |
name: Release pushed tag | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Create release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
GIT_TAG: ${{ github.ref_name }} | |
run: | | |
gh release create "$GIT_TAG" \ | |
--repo="$GITHUB_REPOSITORY" \ | |
--title="${GIT_TAG#v}" \ | |
--generate-notes | |
artifacts: | |
name: Create artifacts | |
needs: | |
- create_release | |
strategy: | |
fail-fast: false | |
matrix: | |
os: | |
- ubuntu-20.04 | |
- macos-12 | |
php-version: | |
- "8.1" | |
- "8.2" | |
- "8.3" | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Install libclang for Linux | |
if: matrix.os == 'ubuntu-20.04' | |
run: sudo apt-get install -y llvm-10-dev libclang-10-dev | |
- name: Setup libclang for Macos | |
if: matrix.os == 'macos-12' | |
run: | | |
brew install llvm@13 | |
echo "LIBCLANG_PATH=$(brew --prefix llvm@13)/lib" >> $GITHUB_ENV | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php-version }} | |
tools: php-config | |
- name: Build | |
run: cargo build --verbose --release | |
- name: Create Linux extension file (.so) | |
if: matrix.os == 'ubuntu-20.04' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
GIT_TAG: ${{ github.ref_name }} | |
run: | | |
mv target/release/libphp_ext_fs_notify.so target/release/linux-php${{ matrix.php-version }}-fs_notify.so | |
gh release upload "$GIT_TAG" \ | |
--repo="$GITHUB_REPOSITORY" \ | |
target/release/linux-php${{ matrix.php-version }}-fs_notify.so | |
- name: Create Macos extension file (.dylib) | |
if: matrix.os == 'macos-12' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
GIT_TAG: ${{ github.ref_name }} | |
run: | | |
mv target/release/libphp_ext_fs_notify.dylib target/release/macos-php${{ matrix.php-version }}-fs_notify.dylib | |
gh release upload "$GIT_TAG" \ | |
--repo="$GITHUB_REPOSITORY" \ | |
target/release/macos-php${{ matrix.php-version }}-fs_notify.dylib |