-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (35 loc) · 1.03 KB
/
build.yml
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
name: Build and Upload Artifacts
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
feature: [lua54, lua53, lua52, lua51, luajit]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Build
run: cargo build --release --features ${{ matrix.feature }}
- name: Prepare artifact
run: |
if [ "${{ matrix.os }}" == "ubuntu-latest" ]; then
OS="linux"
EXT="so"
else
OS="macOS"
EXT="dylib"
fi
mkdir -p artifacts
cp target/release/libtiktoken_core.$EXT artifacts/tiktoken_core-$OS-${{ matrix.feature }}.$EXT
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: tiktoken_core-${{ matrix.os }}-${{ matrix.feature }}
path: artifacts/tiktoken_core-*.${{ matrix.os == 'ubuntu-latest' && 'so' || 'dylib' }}