Skip to content

Commit 02ac230

Browse files
committed
Version script (--no-tag), use CI environment
1 parent 55c6c68 commit 02ac230

File tree

2 files changed

+20
-9
lines changed

2 files changed

+20
-9
lines changed

.github/other/update-version.sh

+16-5
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,25 @@
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
1313
fi
1414

1515
# --help menu
1616
args=("$@")
1717
for 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
2529
done
2630

2731
# Uncommitted changes, see https://stackoverflow.com/a/3879077.
@@ -61,6 +65,13 @@ done
6165
sed -i "s!documentation = \"https://docs.rs/godot/$oldVersion\"!documentation = \"https://docs.rs/godot/$newVersion\"!g" "$mainCargoToml" || exit 2
6266

6367
git 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 ""
6677
echo "SUCCESS: Updated version $oldVersion -> $newVersion"

.github/workflows/release-version.yml

+4-4
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
 (0)