Skip to content

Commit 3d1e478

Browse files
authored
ci: setup workflow to publish crates to crates.io (#660)
rel: #333 (comment)
1 parent db8fa82 commit 3d1e478

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

.github/workflows/rust.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,27 @@ jobs:
331331
- name: Check versions are consistent
332332
run: ./s/check-version
333333

334+
publish-crates:
335+
if: startsWith(github.ref, 'refs/tags/')
336+
needs: [build]
337+
runs-on: ubuntu-22.04
338+
steps:
339+
- name: Checkout
340+
uses: actions/checkout@v4
341+
342+
- name: Install Toolchain
343+
uses: dtolnay/rust-toolchain@4305c38b25d97ef35a8ad1f985ccf2d2242004f2 # stable
344+
with:
345+
toolchain: 1.90.0
346+
347+
- name: Cache
348+
uses: Swatinem/rust-cache@9d47c6ad4b02e050fd481d890b2ea34778fd09d6 # pin@v2
349+
350+
- name: Publish to crates.io
351+
run: cargo publish --workspace
352+
env:
353+
CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_IO_TOKEN }}
354+
334355
publish-vscode:
335356
if: startsWith(github.ref, 'refs/tags/')
336357
needs: [build]

0 commit comments

Comments
 (0)