6
6
package_path :
7
7
description : Path to directory with package to release
8
8
required : true
9
- type : string
9
+ default : ' clients/cli'
10
+ type : choice
11
+ options :
12
+ - clients/cli
13
+ - clients/rust-legacy
14
+ - confidential-transfer/ciphertext-arithmetic
15
+ - confidential-transfer/elgamal-registry
16
+ - confidential-transfer/proof-extraction
17
+ - confidential-transfer/proof-generation
18
+ - confidential-transfer/proof-tests
19
+ - program
10
20
level :
11
21
description : Level
12
22
required : true
@@ -70,10 +80,45 @@ jobs:
70
80
- name : Test
71
81
run : pnpm zx ./scripts/rust/test.mjs "${{ inputs.package_path }}"
72
82
83
+ semver :
84
+ name : Check Semver
85
+ runs-on : ubuntu-latest
86
+ steps :
87
+ - name : Git checkout
88
+ uses : actions/checkout@v4
89
+
90
+ - name : Setup Environment
91
+ uses : ./.github/actions/setup
92
+ with :
93
+ cargo-cache-key : cargo-publish-semver-${{ inputs.package_path }}
94
+ cargo-cache-fallback-key : cargo-publish-semver
95
+
96
+ - name : Install cargo-semver-checks
97
+ uses : taiki-e/install-action@v2
98
+ with :
99
+ tool : cargo-semver-checks,cargo-release
100
+
101
+ - name : Set Git Author (required for cargo-release)
102
+ run : |
103
+ git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
104
+ git config --global user.name "github-actions[bot]"
105
+
106
+ - name : Set Version
107
+ run : |
108
+ if [ "${{ inputs.level }}" == "version" ]; then
109
+ LEVEL=${{ inputs.version }}
110
+ else
111
+ LEVEL=${{ inputs.level }}
112
+ fi
113
+ cargo release $LEVEL --manifest-path "${{ inputs.package_path }}/Cargo.toml" --no-tag --no-publish --no-push --no-confirm --execute
114
+
115
+ - name : Check semver
116
+ run : pnpm rust:semver --manifest-path "${{ inputs.package_path }}/Cargo.toml"
117
+
73
118
publish :
74
119
name : Publish Rust Crate
75
120
runs-on : ubuntu-latest
76
- needs : test
121
+ needs : [ test, semver]
77
122
permissions :
78
123
contents : write
79
124
steps :
@@ -86,12 +131,13 @@ jobs:
86
131
- name : Setup Environment
87
132
uses : ./.github/actions/setup
88
133
with :
89
- cli : true
90
134
cargo-cache-key : cargo-publish-${{ inputs.package_path }}
91
135
cargo-cache-fallback-key : cargo-publish
92
136
93
- - name : Install Cargo Release
94
- run : which cargo-release || cargo install cargo-release
137
+ - name : Install cargo-release
138
+ uses : taiki-e/install-action@v2
139
+ with :
140
+ tool : cargo-release
95
141
96
142
- name : Ensure CARGO_REGISTRY_TOKEN variable is set
97
143
env :
0 commit comments