File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3535 - name : Build release binary
3636 run : cargo build --release --target ${{ matrix.target.rust_target }}
3737
38+ # Guard against the v0.1.10 incident: the npm package version is stamped
39+ # from the tag / dispatch input, so a binary built from a checkout whose
40+ # Cargo.toml wasn't bumped would ship mislabeled — and its self-update
41+ # check would nag users forever. Fail the release instead.
42+ - name : Verify binary version matches the release version
43+ shell : bash
44+ run : |
45+ if [ "${GITHUB_EVENT_NAME}" = "workflow_dispatch" ]; then
46+ expected="${{ inputs.release_version }}"
47+ else
48+ expected="${GITHUB_REF_NAME#v}"
49+ fi
50+ actual="$(./target/${{ matrix.target.rust_target }}/release/jucode --version | awk '{print $NF}')"
51+ echo "expected=${expected} actual=${actual}"
52+ if [ "${actual}" != "${expected}" ]; then
53+ echo "::error::built binary reports ${actual} but the release is ${expected} — bump Cargo.toml (and commit) before tagging"
54+ exit 1
55+ fi
56+
3857 - name : Stage artifact
3958 shell : bash
4059 run : |
Original file line number Diff line number Diff line change 3636 - name : Build release binary
3737 run : cargo build --release --target ${{ matrix.target.rust_target }}
3838
39+ # Guard against the v0.1.10 incident: the npm package version is stamped
40+ # from the tag / dispatch input, so a binary built from a checkout whose
41+ # Cargo.toml wasn't bumped would ship mislabeled — and its self-update
42+ # check would nag users forever. Fail the release instead.
43+ - name : Verify binary version matches the release version
44+ shell : bash
45+ run : |
46+ if [ "${GITHUB_EVENT_NAME}" = "workflow_dispatch" ]; then
47+ expected="${{ inputs.release_version }}"
48+ else
49+ expected="${GITHUB_REF_NAME#v}"
50+ fi
51+ actual="$(./target/${{ matrix.target.rust_target }}/release/${{ matrix.target.binary_name }} --version | awk '{print $NF}')"
52+ echo "expected=${expected} actual=${actual}"
53+ if [ "${actual}" != "${expected}" ]; then
54+ echo "::error::built binary reports ${actual} but the release is ${expected} — bump Cargo.toml (and commit) before tagging"
55+ exit 1
56+ fi
57+
3958 - name : Stage artifact
4059 shell : bash
4160 run : |
Original file line number Diff line number Diff line change 11[package ]
22name = " jucode-cli"
3- version = " 0.1.10 "
3+ version = " 0.1.11 "
44edition = " 2021"
55
66[[bin ]]
Original file line number Diff line number Diff line change @@ -58,6 +58,14 @@ impl TuiRuntime for Runtime {
5858fn main ( ) -> io:: Result < ( ) > {
5959 jucode_agent_core:: logging:: init_global ( ) ;
6060 let mut args = env:: args ( ) . skip ( 1 ) . collect :: < Vec < _ > > ( ) ;
61+ // Before anything that may touch the terminal: `--version` must work in
62+ // TTY-less contexts (CI release guard, the desktop's check_backend probe).
63+ if args. iter ( ) . any ( |a| a == "--version" || a == "-V" )
64+ || args. first ( ) . map ( String :: as_str) == Some ( "version" )
65+ {
66+ println ! ( "jucode {}" , env!( "CARGO_PKG_VERSION" ) ) ;
67+ return Ok ( ( ) ) ;
68+ }
6169 let approval_mode = match take_approval_mode_flag ( & mut args) {
6270 Ok ( mode) => mode,
6371 Err ( error) => {
You can’t perform that action at this time.
0 commit comments