-
Notifications
You must be signed in to change notification settings - Fork 1
72 lines (66 loc) · 2.37 KB
/
Copy pathrelease.yml
File metadata and controls
72 lines (66 loc) · 2.37 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
# Copyright Nixort <https://github.com/Nixort> 2026.
#
# License: GNU General Public License v3.0 only.
# You can find the license file in the project root.
#
# Causal Frontier Ratchet (CFR).
#
# Prerequisite: configure the CARGO_REGISTRY_TOKEN repository secret and a
# protected GitHub environment named `crates-io-release` with required review.
name: CFR release
on:
workflow_dispatch:
inputs:
confirmation:
description: "Type PUBLISH-CFR to publish the checked-out release"
required: true
type: string
permissions:
contents: read
concurrency:
group: cfr-crates-io-release
cancel-in-progress: false
jobs:
validate:
name: Validate release candidate
runs-on: ubuntu-24.04
timeout-minutes: 20
steps:
# actions/checkout v4.1.7, pinned by immutable commit SHA.
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262
# dtolnay/rust-toolchain, pinned by immutable commit SHA.
- uses: dtolnay/rust-toolchain@6c977a6ca4077a0ceb28ffbe03f59d46e9ac8772
with:
toolchain: stable
components: rustfmt, clippy
- name: Require an explicit release confirmation
env:
CONFIRMATION: ${{ inputs.confirmation }}
run: test "$CONFIRMATION" = "PUBLISH-CFR"
- name: Run the release quality gate
run: |
cargo fmt --all -- --check
cargo clippy --workspace --all-targets --all-features --locked -- -D warnings
cargo test --workspace --all-features --locked
cargo build --release --workspace --all-features --locked
publish:
name: Publish packages in dependency order
needs: validate
environment: crates-io-release
runs-on: ubuntu-24.04
timeout-minutes: 30
steps:
# actions/checkout v4.1.7, pinned by immutable commit SHA.
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262
# dtolnay/rust-toolchain, pinned by immutable commit SHA.
- uses: dtolnay/rust-toolchain@6c977a6ca4077a0ceb28ffbe03f59d46e9ac8772
with:
toolchain: stable
- name: Publish in internal dependency order
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
run: |
cargo publish --locked -p cfr-crypto
cargo publish --locked -p cfr-core
cargo publish --locked -p cfr-media
cargo publish --locked -p cfr_protocol