File tree Expand file tree Collapse file tree 4 files changed +17
-37
lines changed Expand file tree Collapse file tree 4 files changed +17
-37
lines changed Original file line number Diff line number Diff line change 68
68
- name : Run cargo-audit
69
69
run : pnpm rust:audit
70
70
71
- semver_rust :
72
- name : Check semver Rust
73
- runs-on : ubuntu-latest
74
- steps :
75
- - name : Git Checkout
76
- uses : actions/checkout@v4
77
-
78
- - name : Setup Environment
79
- uses : ./.github/actions/setup
80
- with :
81
- cargo-cache-key : cargo-semver
82
-
83
- - name : Install cargo-audit
84
- uses : taiki-e/install-action@v2
85
- with :
86
- tool : cargo-semver-checks
87
-
88
- - name : Run semver checks
89
- run : pnpm rust:semver
90
-
91
71
spellcheck_rust :
92
72
name : Spellcheck Rust
93
73
runs-on : ubuntu-latest
Original file line number Diff line number Diff line change 27
27
- patch
28
28
- minor
29
29
- major
30
- - rc
31
- - beta
32
- - alpha
33
- - release
34
- - version
35
- version :
36
- description : Version (used with level "version")
37
- required : false
38
- type : string
39
30
dry_run :
40
31
description : Dry run
41
32
required : true
63
54
cargo-cache-key : cargo-test-publish-${{ inputs.package_path }}
64
55
cargo-cache-fallback-key : cargo-test-publish
65
56
57
+ - name : Install cargo-audit
58
+ uses : taiki-e/install-action@v2
59
+ with :
60
+ tool : cargo-semver-checks
61
+
66
62
- name : Format
67
63
run : pnpm zx ./scripts/rust/format.mjs "${{ inputs.package_path }}"
68
64
72
68
- name : Test
73
69
run : pnpm zx ./scripts/rust/test.mjs "${{ inputs.package_path }}"
74
70
71
+ - name : Check semver
72
+ run : pnpm rust:semver ${{ inputs.package_path }} --release-type ${{ inputs.level }}
73
+
75
74
publish :
76
75
name : Publish Rust Crate
77
76
runs-on : ubuntu-latest
@@ -113,19 +112,13 @@ jobs:
113
112
env :
114
113
CARGO_REGISTRY_TOKEN : ${{ secrets.CARGO_REGISTRY_TOKEN }}
115
114
run : |
116
- if [ "${{ inputs.level }}" == "version" ]; then
117
- LEVEL=${{ inputs.version }}
118
- else
119
- LEVEL=${{ inputs.level }}
120
- fi
121
-
122
115
if [ "${{ inputs.dry_run }}" == "true" ]; then
123
116
OPTIONS="--dry-run"
124
117
else
125
118
OPTIONS=""
126
119
fi
127
120
128
- pnpm rust:publish "${{ inputs.package_path }}" $LEVEL $OPTIONS
121
+ pnpm rust:publish "${{ inputs.package_path }}" "${{ inputs.level }}" $OPTIONS
129
122
130
123
- name : Generate a changelog
131
124
if : github.event.inputs.create_release == 'true'
Original file line number Diff line number Diff line change 33
33
"rust:audit" : " zx ./scripts/rust/audit.mjs" ,
34
34
"rust:publish" : " zx ./scripts/rust/publish.mjs" ,
35
35
"rust:hack" : " zx ./scripts/rust/hack.mjs" ,
36
- "rust:semver" : " cargo semver-checks "
36
+ "rust:semver" : " zx ./scripts/rust/ semver.mjs "
37
37
},
38
38
"devDependencies" : {
39
39
"@iarna/toml" : " ^2.2.5" ,
Original file line number Diff line number Diff line change
1
+ #!/usr/bin/env zx
2
+ import 'zx/globals' ;
3
+ import { cliArguments , getCargo , workingDirectory } from '../utils.mjs' ;
4
+
5
+ const [ folder , ...args ] = cliArguments ( ) ;
6
+ const manifestPath = path . join ( workingDirectory , folder , 'Cargo.toml' ) ;
7
+ await $ `cargo semver-checks --manifest-path ${ manifestPath } ${ args } ` ;
You can’t perform that action at this time.
0 commit comments