Skip to content

Commit

Permalink
update deps & automate builds
Browse files Browse the repository at this point in the history
  • Loading branch information
acheong08 committed Aug 17, 2024
1 parent 94abe8c commit dc11a90
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 9 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
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, luajit52]
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v3

- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true

- 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@v3
with:
name: tiktoken_core-${{ matrix.os }}-${{ matrix.feature }}
path: artifacts/tiktoken_core-*.${{ matrix.os == 'ubuntu-latest' && 'so' || 'dylib' }}
22 changes: 14 additions & 8 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ name = "tiktoken_core"
crate-type = ["cdylib"]

[dependencies]
mlua = { version = "0.9.1", features = ["serialize", "module"] }
mlua = { version = "0.9.7", features = ["serialize", "module"] }
# tiktoken dependencies
fancy-regex = "0.11.0"
regex = "1.8.3"
Expand Down

0 comments on commit dc11a90

Please sign in to comment.