File tree Expand file tree Collapse file tree 3 files changed +29
-10
lines changed Expand file tree Collapse file tree 3 files changed +29
-10
lines changed Original file line number Diff line number Diff line change @@ -13,19 +13,16 @@ set +x
13
13
14
14
set -o errexit
15
15
16
- if [[ -z " $TAG " ]]; then
17
- echo >&2 " \$ TAG must be set to the git tag of the release"
18
- exit 1
19
- fi
20
-
21
16
if [[ -z " $TOKEN " ]]; then
22
17
echo >&2 " \$ TOKEN must be set to the crates.io authentication token"
23
18
exit 1
24
19
fi
25
20
26
- git fetch origin tag $TAG --no-tags
27
- git checkout $TAG
28
-
29
21
source ./.evergreen/env.sh
30
22
31
- cargo publish --token $TOKEN
23
+ EXTRA=" "
24
+ if [[ " ${DRY_RUN} " == " yes" ]]; then
25
+ EXTRA=" --dry-run"
26
+ fi
27
+
28
+ cargo publish --token $TOKEN ${EXTRA}
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ set -o errexit
4
+
5
+ if [[ -z " $GIT_TAG " ]]; then
6
+ echo >&2 " \$ GIT_TAG must be set to the git tag of the release"
7
+ exit 1
8
+ fi
9
+
10
+ git fetch origin tag $GIT_TAG --no-tags
11
+ git checkout $GIT_TAG
Original file line number Diff line number Diff line change @@ -47,6 +47,15 @@ functions:
47
47
${PREPARE_SHELL}
48
48
.evergreen/install-dependencies.sh rust
49
49
50
+ " fetch tag " :
51
+ command : subprocess.exec
52
+ params :
53
+ working_dir : " src"
54
+ add_expansions_to_env : true
55
+ binary : bash
56
+ args :
57
+ - .evergreen/release-fetch-tag.sh
58
+
50
59
" publish release " :
51
60
- command : shell.exec
52
61
type : test
@@ -57,6 +66,7 @@ functions:
57
66
58
67
TAG=${GIT_TAG} \
59
68
TOKEN=${CRATES_IO_TOKEN} \
69
+ DRY_RUN=${DRY_RUN} \
60
70
PROJECT_DIRECTORY="$(pwd)" \
61
71
bash .evergreen/release-danger-do-not-run-manually.sh
62
72
@@ -65,9 +75,10 @@ tasks:
65
75
commands :
66
76
- func : " fetch source"
67
77
- func : " install dependencies"
68
- - func : " publish release "
78
+ - func : " fetch tag "
69
79
vars :
70
80
GIT_TAG : ${triggered_by_git_tag}
81
+ - func : " publish release"
71
82
72
83
axes :
73
84
- id : " os"
You can’t perform that action at this time.
0 commit comments