-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (55 loc) · 1.72 KB
/
Copy pathrelease.yml
File metadata and controls
64 lines (55 loc) · 1.72 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
name: Release
on:
workflow_dispatch:
release:
types: [published]
permissions:
contents: write
jobs:
build:
name: Build for ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
include:
- os: ubuntu-latest
lib_src: rust/target/release/libtakumi_php.so
lib_dst: lib/libtakumi_php.so
artifact: libtakumi_php-linux
- os: macos-latest
lib_src: rust/target/release/libtakumi_php.dylib
lib_dst: lib/libtakumi_php.dylib
artifact: libtakumi_php-macos
- os: windows-latest
lib_src: rust/target/release/takumi_php.dll
lib_dst: lib/takumi_php.dll
artifact: libtakumi_php-windows
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
- name: Cache Rust dependencies
uses: actions/cache@v5
with:
path: |
~/.cargo/registry
~/.cargo/git
rust/target
key: ${{ runner.os }}-cargo-release-${{ hashFiles('rust/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-release
- name: Build Rust library (release)
working-directory: rust
run: cargo build --release
- name: Stage library
shell: bash
run: cp ${{ matrix.lib_src }} ${{ matrix.lib_dst }}
- name: Upload to GitHub Release
if: github.event_name == 'release'
uses: softprops/action-gh-release@v3
with:
files: ${{ matrix.lib_dst }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}