-
Notifications
You must be signed in to change notification settings - Fork 1
70 lines (57 loc) · 1.83 KB
/
Copy pathpublish.yml
File metadata and controls
70 lines (57 loc) · 1.83 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
name: Publish to crates.io
on:
push:
tags:
- 'v*'
workflow_dispatch:
inputs:
dry_run:
description: 'Dry run (do not actually publish)'
required: false
default: 'true'
type: boolean
env:
CARGO_TERM_COLOR: always
jobs:
publish:
name: Publish
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9
- name: Install frontend dependencies
working-directory: tracing-web-console/frontend
run: pnpm install --frozen-lockfile
- name: Build frontend
working-directory: tracing-web-console/frontend
run: pnpm build
- name: Setup Rust
uses: dtolnay/rust-toolchain@1.91
- name: Cache cargo registry
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Verify build
run: cargo build --release -p tracing-web-console
- name: Run tests
run: cargo test --release -p tracing-web-console
- name: Dry run publish
if: github.event_name == 'workflow_dispatch' && github.event.inputs.dry_run == 'true'
run: cargo publish --dry-run -p tracing-web-console
- name: Publish to crates.io
if: (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')) || (github.event_name == 'workflow_dispatch' && github.event.inputs.dry_run == 'false')
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
run: cargo publish -p tracing-web-console