-
Notifications
You must be signed in to change notification settings - Fork 13
66 lines (57 loc) · 1.57 KB
/
build-crate.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# Taken from clvm_rs' version.
name: Build crate
on:
push:
branches:
- main
- dev
tags:
- '**'
pull_request:
branches:
- '**'
jobs:
build_crate:
name: Crate
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up rusts
uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: rustfmt, clippy
- name: Set up rust (stable)
uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: rustfmt, clippy
- name: fmt (stable)
run: cargo +stable fmt -- --files-with-diff --check
- name: clippy (stable)
run: cargo +stable clippy
- name: tests
run: cargo test && cargo test --release
# The design of 'run' causes it to drop main.sym unannounced when compiling.
# ensure that it gets removed before cargo runs.
- name: remove stray main.sym
run: rm -f main.sym
- name: build
run: cargo build --release
- name: dry-run of `cargo publish`
run: cargo publish --dry-run
- name: Upload crate artifacts
uses: actions/upload-artifact@v3
with:
name: crate
path: ./target/package/clvm_tools_rs-*.crate
# this has not been tested, so probably needs to be debugged next time a tag is created
- name: publish to crates.io if tagged
if: startsWith(github.event.ref, 'refs/tags')
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.cargo_registry_token }}
run: cargo publish