File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3737 - name : Install Rust (stable)
3838 uses : dtolnay/rust-toolchain@stable
3939 with :
40- components : cargo
40+ components : cargo,clippy
41+
42+ - name : Install cargo-edit
43+ run : cargo install cargo-edit --locked
4144
4245 - name : Verify working tree is clean
4346 run : |
4750 exit 1
4851 fi
4952
50- - name : Validate version input
51- run : |
52- expected="${{ inputs.version }}"
53- actual=$(cargo metadata --no-deps --format-version 1 | jq -r '.packages[0].version')
54- if [ "$expected" != "$actual" ]; then
55- echo "Input version $expected does not match Cargo.toml version $actual" >&2
56- exit 1
57- fi
53+ - name : Update crate version
54+ run : cargo set-version ${{ inputs.version }}
5855
5956 - name : Tests
6057 run : |
7269 CARGO_REGISTRY_TOKEN : ${{ secrets.CARGO_REGISTRY_TOKEN }}
7370 run : cargo publish
7471
72+ - name : Commit version bump
73+ if : ${{ !inputs.dry_run }}
74+ run : |
75+ git add Cargo.toml Cargo.lock
76+ git commit -m "Release ${{ inputs.version }}"
77+
78+ - name : Push changes
79+ if : ${{ !inputs.dry_run }}
80+ run : git push origin HEAD:main
81+
7582 - name : Create tag
7683 if : ${{ !inputs.dry_run }}
7784 run : |
You can’t perform that action at this time.
0 commit comments