]> khamidou — GitHub mirrors - safetensors.git/commitdiff
Release rust. (#126)
authorNicolas Patry <patry.nicolas@protonmail.com>
Mon, 12 Dec 2022 13:59:19 +0000 (14:59 +0100)
committerGitHub <noreply@github.com>
Mon, 12 Dec 2022 13:59:19 +0000 (14:59 +0100)
.github/workflows/rust-release.yml [new file with mode: 0644]

diff --git a/.github/workflows/rust-release.yml b/.github/workflows/rust-release.yml
new file mode 100644 (file)
index 0000000..e946597
--- /dev/null
@@ -0,0 +1,32 @@
+name: Rust Release
+
+env:
+  CRATES_TOKEN: ${{ secrets.CRATES_TOKEN }}
+
+on:
+  push:
+    tags:
+      - v*
+
+jobs:
+  rust_publish:
+    runs-on: ubuntu-latest
+    steps:
+      - name: Checkout repository
+        uses: actions/checkout@v1
+
+      - name: Install Rust
+        uses: actions-rs/toolchain@v1
+        with:
+          toolchain: stable
+
+      - name: Cache Cargo Registry
+        uses: actions/cache@v1
+        with:
+          path: ~/.cargo/registry
+          key: ubuntu-latest-cargo-registry-${{ hashFiles('**/Cargo.toml') }}
+
+      - name: Publish package rust
+        working-directory: ./safetensors
+        run: cargo publish --token ${CRATES_TOKEN}
+