From b07032a07fabcee7666feab1c7b5e7dc492bf903 Mon Sep 17 00:00:00 2001 From: Daulet Zhanguzin Date: Tue, 2 May 2023 17:41:43 -0700 Subject: [PATCH] add support for darwin-arm64 --- Makefile | 11 +++++++++-- README.md | 1 + 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 9cc6f980..6919b063 100644 --- a/Makefile +++ b/Makefile @@ -6,12 +6,19 @@ build: build-example: @docker build -f ./example/Dockerfile . -t tokenizers-example +release-darwin-arm64: + cd lib && cargo build --release --target aarch64-apple-darwin + mkdir -p release/darwin-arm64 + cp lib/target/aarch64-apple-darwin/release/libtokenizers.a release/darwin-arm64/libtokenizers.a + cd release/darwin-arm64 && \ + tar -czf libtokenizers.darwin-arm64.tar.gz libtokenizers.a + release-linux-%: docker buildx build --platform linux/$* -f example/Dockerfile . -t tokenizers.linux-$* mkdir -p release/linux-$* docker run -v $(PWD)/release/linux-$*:/mnt --entrypoint cp tokenizers.linux-$* /workspace/libtokenizers.a /mnt/libtokenizers.a - mkdir -p release/output - tar -czf release/output/libtokenizers.linux-$*.tar.gz release/linux-$*/libtokenizers.a + cd release/linux-$* && \ + tar -czf libtokenizers.linux-$*.tar.gz libtokenizers.a test: build @go test -v ./... -count=1 diff --git a/README.md b/README.md index 3b106c9a..c93ec857 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,7 @@ Go bindings for the [HuggingFace Tokenizers](https://github.com/huggingface/toke ### Using pre-built binaries +* [darwin-arm64](https://github.com/daulet/tokenizers/releases/latest/download/libtokenizers.darwin-arm64.tar.gz) * [linux-arm64](https://github.com/daulet/tokenizers/releases/latest/download/libtokenizers.linux-arm64.tar.gz) * [linux-amd64](https://github.com/daulet/tokenizers/releases/latest/download/libtokenizers.linux-amd64.tar.gz)