Skip to content

Commit 71140e8

Browse files
authored
RUST-546 Automate driver releases (#264)
1 parent 89a8e9c commit 71140e8

File tree

2 files changed

+84
-0
lines changed

2 files changed

+84
-0
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# ☠ ☢ ☠ ☢ ☠ ☢ ☠ ☢ ☠ ☢ ☠ ☢ ☠ ☢ ☠ ☢ ☠ ☢ ☠ ☢ ☠ ☢ ☠ ☢ ☠ ☢ ☠ ☢
2+
# # Danger!
3+
#
4+
# This script is used to publish a release of the driver to crates.io.
5+
#
6+
# Do not run it manually!
7+
# ☢ ☠ ☢ ☠ ☢ ☠ ☢ ☠ ☢ ☠ ☢ ☠ ☢ ☠ ☢ ☠ ☢ ☠ ☢ ☠ ☢ ☠ ☢ ☠ ☢ ☠ ☢ ☠
8+
9+
# Disable tracing
10+
set +x
11+
12+
set -o errexit
13+
14+
if [[ -z "$TAG" ]]; then
15+
>&2 echo "\$TAG must be set to the git tag of the release"
16+
exit 1
17+
fi
18+
19+
if [[ -z "$TOKEN" ]]; then
20+
>&2 echo "\$TOKEN must be set to the crates.io authentication token"
21+
exit 1
22+
fi
23+
24+
git fetch origin $TAG
25+
git checkout $TAG
26+
27+
. ~/.cargo/env
28+
29+
cargo publish --token $TOKEN

.evergreen/releases.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
exec_timeout_secs: 3600
2+
3+
functions:
4+
"fetch source":
5+
- command: git.get_project
6+
type: system
7+
params:
8+
directory: "src"
9+
10+
"install dependencies":
11+
command: shell.exec
12+
params:
13+
working_dir: "src"
14+
script: |
15+
${PREPARE_SHELL}
16+
.evergreen/install-dependencies.sh
17+
18+
"publish release":
19+
- command: shell.exec
20+
type: test
21+
params:
22+
working_dir: "src"
23+
script: |
24+
set +x
25+
26+
TAG=${GIT_TAG} \
27+
TOKEN=${CRATES_IO_TOKEN} \
28+
bash .evergreen/release-danger-do-not-run-manually.sh
29+
30+
tasks:
31+
- name: "publish-release"
32+
commands:
33+
- func: "fetch source"
34+
- func: "install dependencies"
35+
- func: "publish release"
36+
vars:
37+
GIT_TAG: ${triggered_by_git_tag}
38+
39+
axes:
40+
- id: "os"
41+
display_name: OS
42+
values:
43+
- id: ubuntu-16.04
44+
display_name: "Ubuntu 16.04"
45+
run_on: ubuntu1604-test
46+
47+
buildvariants:
48+
-
49+
matrix_name: "release"
50+
matrix_spec:
51+
os:
52+
- ubuntu-16.04
53+
display_name: "Publish driver release"
54+
tasks:
55+
- "publish-release"

0 commit comments

Comments
 (0)