File tree Expand file tree Collapse file tree 2 files changed +23
-4
lines changed
Expand file tree Collapse file tree 2 files changed +23
-4
lines changed Original file line number Diff line number Diff line change @@ -70,10 +70,29 @@ jobs:
7070 - name : Build release
7171 run : cargo build --release
7272
73+ # Publish to crates.io (only if all builds succeed)
74+ # This job will only run if both test and build jobs succeed.
75+ publish :
76+ runs-on : ubuntu-latest
77+ needs : [test, build]
78+ if : success()
79+ permissions :
80+ contents : read
81+ steps :
82+ - uses : actions/checkout@v4
83+ - uses : dtolnay/rust-toolchain@stable
84+ - name : Cache cargo
85+ uses : Swatinem/rust-cache@v2
86+ with : { cache-on-failure: true }
87+ - name : Publish to crates.io
88+ run : cargo publish --locked
89+ env :
90+ CARGO_REGISTRY_TOKEN : ${{ secrets.CRATES_IO_TOKEN }}
91+
7392 # Create release
7493 release :
7594 runs-on : ubuntu-latest
76- needs : [changelog, build]
95+ needs : [changelog, build, publish ]
7796 permissions :
7897 contents : write
7998 steps :
Original file line number Diff line number Diff line change 11[package ]
22name = " mostro-core"
3- version = " 0.6.56 "
3+ version = " 0.6.57 "
44edition = " 2021"
55license = " MIT"
66authors = [" Francisco Calderón <negrunch@grunch.dev>" ]
@@ -13,7 +13,7 @@ crate-type = ["cdylib", "lib"]
1313
1414[package .metadata .release ]
1515# (Default: true) Set to false to prevent automatically running `cargo publish`.
16- publish = true
16+ publish = false
1717# (Default: true) Set to false to prevent automatically pushing commits and tags to the Git remote.
1818push = true
1919# (Default: true) Run `cargo test` before release? Highly recommended.
@@ -30,7 +30,7 @@ allow-branch = ["main"]
3030pre-release-hook = [
3131 " sh" ,
3232 " -c" ,
33- " rm -f CHANGELOG.md && GITHUB_TOKEN= \" ${GITHUB_TOKEN:-}\" git cliff --unreleased --github-repo MostroP2P/mostro-core -o CHANGELOG.md --tag {{version}} && if [ \" $DRY_RUN\" = \" true\" ]; then echo \" DRY RUN: Skip add/commit \" ; else ( git diff --quiet CHANGELOG.md || git add CHANGELOG.md && git commit -m \" Update CHANGELOG for version {{version}}\" ) ; fi" ,
33+ " cargo fmt --all && cargo clippy --all-targets --all-features -- -D warnings && if [ -n \" ${GITHUB_TOKEN:-}\" ]; then GITHUB_TOKEN= \" $GITHUB_TOKEN \" git cliff --unreleased --github-repo MostroP2P/mostro-core -o CHANGELOG.md --tag {{version}}; else git cliff --unreleased -o CHANGELOG.md --tag {{version}}; fi && if [ \" $DRY_RUN\" ! = \" true\" ]; then git diff --quiet CHANGELOG.md || { git add CHANGELOG.md && git commit -m \" Update CHANGELOG for version {{version}}\" ; }; else echo \" DRY RUN: Skip git add and commit \" ; fi" ,
3434]
3535
3636[dependencies ]
You can’t perform that action at this time.
0 commit comments