-
Notifications
You must be signed in to change notification settings - Fork 320
44 lines (36 loc) · 1.14 KB
/
crates.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
43
44
name: crates.io publishing
permissions:
contents: write
on:
push:
# Run on all tag formats.
tags:
- '**[0-9]+.[0-9]+.[0-9]+*'
# Support ad-hoc calls, mostly for debugging.
workflow_call:
workflow_dispatch:
jobs:
publish:
runs-on: buildjet-16vcpu-ubuntu-2204
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
steps:
- uses: actions/checkout@v4
with:
lfs: true
- name: install nix
uses: nixbuild/nix-quick-install-action@v28
- name: setup nix cache
uses: nix-community/cache-nix-action@v5
with:
primary-key: nix-${{ runner.os }}-${{ hashFiles('**/*.nix') }}
restore-prefixes-first-match: nix-${{ runner.os }}-
backend: buildjet
- name: Load rust cache
uses: astriaorg/[email protected]
# The `rust-toolchain.toml` file dictates which version of rust to setup.
- name: check rust version
run: nix develop --command rustc --version
# Publish the workspace to crates.io.
- name: publish crates
run: nix develop --command ./deployments/scripts/publish-crates