66 package_path :
77 description : Path to directory with package to release
88 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
1020 level :
1121 description : Level
1222 required : true
@@ -70,10 +80,45 @@ jobs:
7080 - name : Test
7181 run : pnpm zx ./scripts/rust/test.mjs "${{ inputs.package_path }}"
7282
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+
73118 publish :
74119 name : Publish Rust Crate
75120 runs-on : ubuntu-latest
76- needs : test
121+ needs : [ test, semver]
77122 permissions :
78123 contents : write
79124 steps :
@@ -86,12 +131,13 @@ jobs:
86131 - name : Setup Environment
87132 uses : ./.github/actions/setup
88133 with :
89- cli : true
90134 cargo-cache-key : cargo-publish-${{ inputs.package_path }}
91135 cargo-cache-fallback-key : cargo-publish
92136
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
95141
96142 - name : Ensure CARGO_REGISTRY_TOKEN variable is set
97143 env :
0 commit comments