File tree Expand file tree Collapse file tree 2 files changed +20
-9
lines changed Expand file tree Collapse file tree 2 files changed +20
-9
lines changed Original file line number Diff line number Diff line change 77# Small utility to run update crate versions, used by godot-rust developers.
88
99# No args specified: do everything.
10- if [ " $# " -eq 0 ]; then
11- echo " Usage: update-version.sh <newVersion> "
10+ if [[ " $# " -eq 0 ] ]; then
11+ echo " Usage: update-version.sh <VER> [--no-tag] "
1212 exit 1
1313fi
1414
1515# --help menu
1616args=(" $@ " )
1717for arg in " ${args[@]} " ; do
18- if [ " $arg " == " --help" ]; then
19- echo " Usage: update-version.sh <newVersion> "
18+ if [[ " $arg " == " --help" ] ]; then
19+ echo " Usage: update-version.sh <VER> [--no-tag] "
2020 echo " "
2121 echo " Replaces currently published version with <newVersion>" .
2222 echo " Does not git commit."
2323 exit 0
2424 fi
25+
26+ if [[ " $arg " == " --no-tag" ]]; then
27+ noTag=" true"
28+ fi
2529done
2630
2731# Uncommitted changes, see https://stackoverflow.com/a/3879077.
6165sed -i " s!documentation = \" https://docs.rs/godot/$oldVersion \" !documentation = \" https://docs.rs/godot/$newVersion \" !g" " $mainCargoToml " || exit 2
6266
6367git commit -am " Update crate version: $oldVersion -> $newVersion " || exit 2
64- git tag " $newVersion " || exit 2
6568
69+ if [[ " $noTag " == " true" ]]; then
70+ echo " Skipped creating tag."
71+ else
72+ git tag " v$newVersion " || exit 2
73+ echo " Created tag v$newVersion ."
74+ fi
75+
76+ echo " "
6677echo " SUCCESS: Updated version $oldVersion -> $newVersion "
Original file line number Diff line number Diff line change @@ -211,7 +211,7 @@ jobs:
211211 publish :
212212 runs-on : ubuntu-latest
213213 if : ${{ github.event.inputs.skip-release != 'y' }}
214- # environment: 'Crates.io'
214+ environment : ' Crates.io'
215215 needs :
216216 - validation
217217 - docs-and-commit
@@ -226,13 +226,13 @@ jobs:
226226 run : rustup update stable
227227
228228 - name : " Execute crates.io publishing"
229- # env:
230- # CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_IO_TOKEN }}
229+ env :
230+ CARGO_REGISTRY_TOKEN : ${{ secrets.CRATES_IO_TOKEN }}
231231 run : |
232232 IFS=' ' read -r -a publishedCrates <<< "$GDEXT_CRATES"
233233 for crate in "${publishedCrates[@]}"; do
234234 echo "Publish $crate..."
235- (cd "$crate" && cargo publish --dry-run ) || {
235+ (cd "$crate" && cargo publish -v ) || {
236236 printf "\n::error::Failed to publish $crate\n"
237237 exit 2
238238 }
You can’t perform that action at this time.
0 commit comments