-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (54 loc) · 1.86 KB
/
Copy pathrelease-net-cli.yml
File metadata and controls
62 lines (54 loc) · 1.86 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
name: Release net-cli
# Publishes `net-cli` (the unified `net-mesh` command-line tool at
# `crates/net/cli/`) to crates.io.
#
# Tag schema: `cli-v<semver>`.
#
# Required repository secret: `CARGO_REGISTRY_TOKEN`
# Generate at https://crates.io/me with the `publish-update` scope
# restricted to `net-cli` after the first publish completes. The
# first publish requires a wider scope (or a broader account-level
# token) because crates.io scopes can only be set on existing
# crates.
#
# Prebuilt-binary distribution (tarballs, install script, Homebrew
# formula, cargo-binstall metadata) + the `@net-mesh/cli` npm shim
# land in a follow-up release pipeline — out of scope for this
# crates.io-only first slice.
on:
push:
tags:
- "cli-v*"
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
jobs:
publish:
name: Publish net-cli
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Cache cargo
uses: actions/cache@v5
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
net/crates/net/target/
key: ${{ runner.os }}-cargo-publish-cli-${{ hashFiles('**/Cargo.lock') }}
# `net-cli` depends on `net-mesh-sdk` (which depends on
# `net-mesh`). Both must already exist on crates.io at the
# version this crate's Cargo.toml pins, so run `release-crates`
# first when the workspace version bumps.
- name: cargo publish --dry-run (net-cli)
working-directory: net/crates/net/cli
run: cargo publish --dry-run
- name: Publish net-cli
working-directory: net/crates/net/cli
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
run: cargo publish