Skip to content

Commit e51f340

Browse files
authored
chore: create Rust release runbook (#1488)
* chore: automate release
1 parent 67f3d2e commit e51f340

File tree

7 files changed

+104
-36
lines changed

7 files changed

+104
-36
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
To publish a new version of the aws-db-esdk for version N.N.N
2+
3+
1. Acquire the appropriate permissions
4+
1. Ensure git checkout of main is fresh and clean
5+
1. ./start_release.sh N.N.N
6+
1. cd ../../../releases/rust/db_esdk
7+
1. Create a PR with all changed or added files
8+
1. cargo publish
9+
1. cd ../../../DynamoDbEncryption/runtimes/rust/ # i.e. return here
10+
1. ./test_published.sh N.N.N

DynamoDbEncryption/runtimes/rust/src/lib.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33

44
#![allow(warnings, unconditional_panic)]
55
#![allow(nonstandard_style)]
6+
#![allow(clippy::never_loop)]
7+
#![allow(clippy::absurd_extreme_comparisons)]
68

79
pub mod client;
810
pub mod conversions;
@@ -30,7 +32,7 @@ pub use crate::deps::aws_cryptography_materialProviders;
3032
pub use crate::deps::aws_cryptography_primitives;
3133

3234
pub(crate) mod implementation_from_dafny;
33-
pub(crate) use crate::implementation_from_dafny::r#_Wrappers_Compile;
35+
pub(crate) use crate::implementation_from_dafny::_Wrappers_Compile;
3436
pub(crate) use crate::implementation_from_dafny::software;
3537
pub(crate) use crate::implementation_from_dafny::AesKdfCtr;
3638
pub(crate) use crate::implementation_from_dafny::ConcurrentCall;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/bin/bash -eu
2+
3+
if [ "$#" -ne 1 ]; then
4+
echo 1>&2 "USAGE: start_release.sh N.N.N"
5+
exit 1
6+
fi
7+
8+
cd $( dirname ${BASH_SOURCE[0]} )
9+
10+
REGEX_VERSION='^\d+\.\d+\.\d+$'
11+
MATCHES=$(echo "$1" | egrep $REGEX_VERSION | wc -l)
12+
if [ $MATCHES -eq 0 ]; then
13+
echo 1>&2 "Version \"$1\" must be N.N.N"
14+
exit 1
15+
fi
16+
17+
perl -pe "s/^version = .*$/version = \"$1\"/" < Cargo.toml > new_Cargo.toml
18+
mv new_Cargo.toml Cargo.toml
19+
20+
find src -depth 1 | egrep -v '(intercept.rs|lib.rs|software_externs.rs)' | xargs rm -rf
21+
cd ../..
22+
make polymorph_rust transpile_rust test_rust
23+
cd runtimes/rust
24+
rm -rf target
25+
rm -rf ../../../releases/rust/db_esdk
26+
cp -r . ../../../releases/rust/db_esdk
27+
cd ../../../releases/rust/db_esdk
28+
git checkout dafny_runtime_rust
29+
rm -rf *~ copy_externs.sh start_release.sh test_published.sh test_examples *.pem RELEASE.md
30+
echo Cargo.lock > .gitignore
31+
echo target >> .gitignore
32+
33+
cargo test
34+
cargo run --example main
35+
rm -f Cargo.lock *.pem
36+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
*~
2+
*.pem
3+
src
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
[package]
2+
name = "aws-db-esdk-examples"
3+
version = "0.1.0"
4+
edition = "2021"
5+
rust-version = "1.80.0"
6+
7+
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
8+
9+
[dependencies]
10+
aws-config = "1.5.10"
11+
aws-lc-rs = "1.11.1"
12+
aws-lc-sys = "0.23.1"
13+
aws-sdk-dynamodb = "1.54.0"
14+
aws-sdk-kms = "1.50.0"
15+
aws-smithy-runtime-api = {version = "1.7.3", features = ["client"] }
16+
aws-smithy-types = "1.2.9"
17+
chrono = "0.4.38"
18+
dafny-runtime = "0.1.1"
19+
dashmap = "6.1.0"
20+
pem = "3.0.4"
21+
tokio = {version = "1.41.1", features = ["full"] }
22+
uuid = { version = "1.11.0", features = ["v4"] }
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/bin/bash -eu
2+
3+
if [ "$#" -ne 1 ]; then
4+
echo 1>&2 "USAGE: test_published.sh N.N.N"
5+
exit 1
6+
fi
7+
8+
cd $( dirname ${BASH_SOURCE[0]} )
9+
10+
REGEX_VERSION='^\d+\.\d+\.\d+$'
11+
12+
echo "$1" | egrep -q $REGEX_VERSION
13+
if [ $? -ne 0 ]; then
14+
echo 1>&2 "Version \"$1\" must be N.N.N"
15+
exit 1
16+
fi
17+
18+
VERSION=$1
19+
20+
rm -rf test_examples/src
21+
cp -r examples test_examples/src/
22+
cd test_examples
23+
cargo add aws-db-esdk
24+
MATCH=$(fgrep "aws-db-esdk = \"$VERSION\"" Cargo.toml | wc -l)
25+
if [ $MATCH -eq "0" ]; then
26+
echo Version $VERSION of aws-db-esdk not the most recent
27+
egrep '^aws-db-esdk' Cargo.toml
28+
exit 1
29+
fi
30+
cargo run

releases/rust/db_esdk/.gitignore~

-35
This file was deleted.

0 commit comments

Comments
 (0)