-
Notifications
You must be signed in to change notification settings - Fork 261
99 lines (84 loc) · 3.18 KB
/
rust-publish.yml
File metadata and controls
99 lines (84 loc) · 3.18 KB
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
name: Publish Rust Crates
on:
push:
tags:
- "rust-v*"
workflow_dispatch:
inputs:
dry_run:
description: "Perform a dry run without publishing"
required: false
type: boolean
default: true
jobs:
publish:
name: Publish to crates.io
runs-on: blacksmith-4vcpu-ubuntu-2404
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Setup Rust
uses: ./.github/actions/rust-setup
with:
cache-key: publish
- name: Check crate versions
run: |
echo "=== Checking crate versions ==="
echo "types version: $(cargo pkgid -p ev-types | cut -d# -f2)"
echo "ev-client version: $(cargo pkgid -p ev-client | cut -d# -f2)"
- name: Run tests
run: cargo test --workspace --all-features
- name: Package and publish ev-types (dry run)
if: github.event_name == 'workflow_dispatch' && inputs.dry_run
run: |
cd client/crates/types
cargo package --allow-dirty
cargo publish --dry-run
- name: Package and publish ev-client (dry run)
if: github.event_name == 'workflow_dispatch' && inputs.dry_run
run: |
cd client/crates/client
cargo package --allow-dirty
cargo publish --dry-run
- name: Publish ev-types
if: (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')) || (github.event_name == 'workflow_dispatch' && !inputs.dry_run)
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
run: |
cd client/crates/types
cargo package --allow-dirty
cargo publish
- name: Wait for ev-types to be available
if: (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')) || (github.event_name == 'workflow_dispatch' && !inputs.dry_run)
run: |
echo "Waiting for ev-types to be available on crates.io..."
sleep 60
# Verify the package is available
cargo search ev-types --limit 1
- name: Publish ev-client
if: (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')) || (github.event_name == 'workflow_dispatch' && !inputs.dry_run)
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
run: |
cd client/crates/client
cargo package --allow-dirty
cargo publish
- name: Create GitHub Release
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v2
with:
name: Rust Client ${{ github.ref_name }}
body: |
# Rust Client Release
This release includes:
- `ev-types`: Proto-generated types for ev-node
- `ev-client`: High-level Rust client for ev-node gRPC services
## Installation
Add to your `Cargo.toml`:
```toml
[dependencies]
ev-client = "<version>"
```
See the [README](https://github.com/evstack/ev-node/tree/main/client/crates/client) for usage examples.
draft: false
prerelease: false