Skip to content

Commit c87a1b0

Browse files
chore: add codebuild release (#232)
Co-authored-by: Valerie Lambert <[email protected]>
1 parent 46267b3 commit c87a1b0

File tree

23 files changed

+559
-113
lines changed

23 files changed

+559
-113
lines changed

.github/workflows/ci_examples_java.yml

+2-13
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ jobs:
3838
macos-latest
3939
]
4040
runs-on: ${{ matrix.os }}
41-
environment: "MPL CI"
4241
permissions:
4342
id-token: write
4443
contents: read
@@ -51,18 +50,8 @@ jobs:
5150
role-session-name: DDBEC-Dafny-Java-Tests
5251

5352
- uses: actions/checkout@v3
54-
55-
- name: Init Submodules
56-
env:
57-
# This secret is in the configured environment
58-
# Token created on # 05/12/2023
59-
# expires in ~30 days 05/22/2023
60-
MPL_PAT: ${{ secrets.MPL_PAT }}
61-
run: |
62-
AUTH="$(echo -n "pat:${MPL_PAT}" | base64 | tr -d '\n')"
63-
git config --global http.https://github.com/.extraheader "AUTHORIZATION: basic $AUTH"
64-
git config --global --add url.https://github.com/.insteadOf [email protected]:
65-
git submodule update --init --recursive submodules/MaterialProviders
53+
with:
54+
submodules: recursive
6655

6756
- name: Setup Java ${{ matrix.java-version }}
6857
uses: actions/setup-java@v3

.github/workflows/ci_test_java.yml

+6-13
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ jobs:
4040
macos-latest
4141
]
4242
runs-on: ${{ matrix.os }}
43-
environment: "MPL CI"
4443
permissions:
4544
id-token: write
4645
contents: read
@@ -53,18 +52,8 @@ jobs:
5352
role-session-name: DDBEC-Dafny-Java-Tests
5453

5554
- uses: actions/checkout@v3
56-
57-
- name: Init Submodules
58-
env:
59-
# This secret is in the configured environment
60-
# Token created on # 05/12/2023
61-
# expires in ~30 days 05/22/2023
62-
MPL_PAT: ${{ secrets.MPL_PAT }}
63-
run: |
64-
AUTH="$(echo -n "pat:${MPL_PAT}" | base64 | tr -d '\n')"
65-
git config --global http.https://github.com/.extraheader "AUTHORIZATION: basic $AUTH"
66-
git config --global --add url.https://github.com/.insteadOf [email protected]:
67-
git submodule update --init --recursive submodules/MaterialProviders
55+
with:
56+
submodules: recursive
6857

6958
- name: Setup Dafny
7059
uses: dafny-lang/[email protected]
@@ -89,4 +78,8 @@ jobs:
8978
- name: Test ${{ matrix.library }}
9079
working-directory: ./${{ matrix.library }}
9180
run: |
81+
# Clear MPL from cache
82+
# We have to do this because MakeFile does not do this yet. The MakeFile automatically builds and deploys dependencies
83+
# instead it should be picking it up from Maven.
84+
rm -rf ~/.m2/repository/software/amazon/cryptography/aws-cryptographic-material-providers
9285
make test_java

.github/workflows/ci_test_net.yml

+2-13
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ jobs:
4040
macos-latest,
4141
]
4242
runs-on: ${{ matrix.os }}
43-
environment: "MPL CI"
4443
permissions:
4544
id-token: write
4645
contents: read
@@ -49,18 +48,8 @@ jobs:
4948
DOTNET_NOLOGO: 1
5049
steps:
5150
- uses: actions/checkout@v3
52-
53-
- name: Init Submodules
54-
env:
55-
# This secret is in the configured environment
56-
# Token created on # 05/12/2023
57-
# expires in ~30 days 05/22/2023
58-
MPL_PAT: ${{ secrets.MPL_PAT }}
59-
run: |
60-
AUTH="$(echo -n "pat:${MPL_PAT}" | base64 | tr -d '\n')"
61-
git config --global http.https://github.com/.extraheader "AUTHORIZATION: basic $AUTH"
62-
git config --global --add url.https://github.com/.insteadOf [email protected]:
63-
git submodule update --init --recursive submodules/MaterialProviders
51+
with:
52+
submodules: recursive
6453

6554
- name: Setup .NET Core SDK ${{ matrix.dotnet-version }}
6655
uses: actions/setup-dotnet@v3

.github/workflows/ci_test_vector_java.yml

+6-12
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ jobs:
1717
ubuntu-latest
1818
]
1919
runs-on: ${{ matrix.os }}
20-
environment: "MPL CI"
2120
permissions:
2221
id-token: write
2322
contents: read
@@ -36,17 +35,8 @@ jobs:
3635
role-session-name: DDBEC-Dafny-Java-Tests
3736

3837
- uses: actions/checkout@v3
39-
40-
- name: Init Submodules
41-
env:
42-
# This secret is in the configured environment,
43-
# and set to expire every 30 days
44-
MPL_PAT: ${{ secrets.MPL_PAT }}
45-
run: |
46-
AUTH="$(echo -n "pat:${MPL_PAT}" | base64 | tr -d '\n')"
47-
git config --global http.https://github.com/.extraheader "AUTHORIZATION: basic $AUTH"
48-
git config --global --add url.https://github.com/.insteadOf [email protected]:
49-
git submodule update --init --recursive submodules/MaterialProviders
38+
with:
39+
submodules: recursive
5040

5141
- name: Setup Dafny
5242
uses: dafny-lang/[email protected]
@@ -70,4 +60,8 @@ jobs:
7060
- name: Test TestVectors
7161
working-directory: ./TestVectors
7262
run: |
63+
# Clear MPL from cache
64+
# We have to do this because MakeFile does not do this yet. The MakeFile automatically builds and deploys dependencies
65+
# instead it should be picking it up from Maven.
66+
rm -rf ~/.m2/repository/software/amazon/cryptography/aws-cryptographic-material-providers
7367
make test_java

.github/workflows/ci_verification.yml

+2-13
Original file line numberDiff line numberDiff line change
@@ -41,22 +41,11 @@ jobs:
4141
macos-latest,
4242
]
4343
runs-on: ${{ matrix.os }}
44-
environment: "MPL CI"
4544
steps:
4645
- uses: actions/checkout@v3
46+
with:
47+
submodules: recursive
4748

48-
- name: Init Submodules
49-
env:
50-
# This secret is in the configured environment
51-
# Token created on # 05/12/2023
52-
# expires in ~30 days 05/22/2023
53-
MPL_PAT: ${{ secrets.MPL_PAT }}
54-
run: |
55-
AUTH="$(echo -n "pat:${MPL_PAT}" | base64 | tr -d '\n')"
56-
git config --global http.https://github.com/.extraheader "AUTHORIZATION: basic $AUTH"
57-
git config --global --add url.https://github.com/.insteadOf [email protected]:
58-
git submodule update --init --recursive submodules/MaterialProviders
59-
6049
- name: Setup Dafny
6150
uses: dafny-lang/[email protected]
6251
with:

.gitmodules

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
url = https://github.com/aws/aws-cryptographic-material-providers-library-java.git
44
[submodule "submodules/smithy-dafny"]
55
path = submodules/smithy-dafny
6-
url = git@github.com:awslabs/smithy-dafny.git
6+
url = https://github.com/awslabs/smithy-dafny.git

CHANGELOG.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Changelog
2+
3+
## 3.0.0-preview-1 2023-06-08
4+
5+
### Features
6+
- Initial release of the AWS Database Encryption SDK.
7+
This release is considered a [developer preview](https://docs.aws.amazon.com/sdkref/latest/guide/maint-policy.html#version-life-cycle)
8+
and is not intended for production use cases.

DynamoDbEncryption/runtimes/java/build.gradle.kts

+81-3
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@ plugins {
77
`java`
88
`java-library`
99
`maven-publish`
10+
`signing`
11+
id("io.github.gradle-nexus.publish-plugin") version "1.3.0"
1012
}
1113

1214
group = "software.amazon.cryptography"
13-
version = "1.0-SNAPSHOT"
15+
version = "3.0.0-preview-1"
1416
description = "Aws Database Encryption Sdk for DynamoDb Java"
1517

1618
java {
@@ -68,7 +70,7 @@ val dynamodb by configurations.creating
6870
dependencies {
6971
implementation("org.dafny:DafnyRuntime:4.1.0")
7072
implementation("software.amazon.smithy.dafny:conversion:0.1")
71-
implementation("software.amazon.cryptography:AwsCryptographicMaterialProviders:1.0-SNAPSHOT")
73+
implementation("software.amazon.cryptography:aws-cryptographic-material-providers:1.0.0-preview-1")
7274

7375
implementation(platform("software.amazon.awssdk:bom:2.19.1"))
7476
implementation("software.amazon.awssdk:dynamodb")
@@ -107,12 +109,55 @@ dependencies {
107109
}
108110

109111
publishing {
112+
publications.create<MavenPublication>("mavenLocal") {
113+
groupId = "software.amazon.cryptography"
114+
artifactId = "aws-database-encryption-sdk-dynamodb"
115+
from(components["java"])
116+
}
117+
110118
publications.create<MavenPublication>("maven") {
111119
groupId = "software.amazon.cryptography"
112120
artifactId = "aws-database-encryption-sdk-dynamodb"
113121
from(components["java"])
122+
123+
// Include extra information in the POMs.
124+
afterEvaluate {
125+
pom {
126+
name.set("AWS Database Encryption SDK for DynamoDB")
127+
description.set("AWS Database Encryption SDK for DynamoDB in Java")
128+
url.set("https://github.com/aws/aws-database-encryption-sdk-dynamodb-java")
129+
licenses {
130+
license {
131+
name.set("Apache License 2.0")
132+
url.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
133+
distribution.set("repo")
134+
}
135+
}
136+
developers {
137+
developer {
138+
id.set("amazonwebservices")
139+
organization.set("Amazon Web Services")
140+
organizationUrl.set("https://aws.amazon.com")
141+
roles.add("developer")
142+
}
143+
}
144+
scm {
145+
url.set("https://github.com/aws/aws-database-encryption-sdk-dynamodb-java.git")
146+
}
147+
}
148+
}
149+
}
150+
repositories {
151+
mavenLocal()
152+
maven {
153+
name = "StagingCodeArtifact"
154+
url = URI.create("https://crypto-tools-internal-587316601012.d.codeartifact.us-east-1.amazonaws.com/maven/java-dbesdk-ddb-staging/")
155+
credentials {
156+
username = "aws"
157+
password = System.getenv("CODEARTIFACT_TOKEN")
158+
}
159+
}
114160
}
115-
repositories { mavenLocal() }
116161
}
117162

118163
tasks.withType<JavaCompile>() {
@@ -185,3 +230,36 @@ tasks.javadoc {
185230
}
186231
exclude("src/main/dafny-generated")
187232
}
233+
234+
nexusPublishing {
235+
// We are using the nexusPublishing plugin since it is recommended by Sonatype Gradle Project configurations
236+
// and it is easy to supply the creds we need to deploy
237+
// https://github.com/gradle-nexus/publish-plugin/
238+
repositories {
239+
sonatype {
240+
nexusUrl.set(uri("https://aws.oss.sonatype.org/service/local/"))
241+
snapshotRepositoryUrl.set(uri("https://aws.oss.sonatype.org/content/repositories/snapshots/"))
242+
username.set(System.getenv("SONA_USERNAME"))
243+
password.set(System.getenv("SONA_PASSWORD"))
244+
}
245+
}
246+
}
247+
248+
signing {
249+
useGpgCmd()
250+
251+
// Dynamically set these properties
252+
project.ext.set("signing.gnupg.executable", "gpg")
253+
project.ext.set("signing.gnupg.useLegacyGpg" , "true")
254+
project.ext.set("signing.gnupg.homeDir", System.getenv("HOME") + "/.gnupg/")
255+
project.ext.set("signing.gnupg.optionsFile", System.getenv("HOME") + "/.gnupg/gpg.conf")
256+
project.ext.set("signing.gnupg.keyName", System.getenv("GPG_KEY"))
257+
project.ext.set("signing.gnupg.passphrase", System.getenv("GPG_PASS"))
258+
259+
// Signing is required if building a release version and if we're going to publish it.
260+
// Otherwise if doing a maven publication we will sign
261+
setRequired({
262+
gradle.getTaskGraph().hasTask("publish")
263+
})
264+
sign(publishing.publications["maven"])
265+
}

Examples/runtimes/java/DynamoDbEncryption/build.gradle.kts

+4-4
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ java {
2424

2525
var caUrl: URI? = null
2626
@Nullable
27-
val caUrlStr: String? = System.getenv("CODEARTIFACT_URL_JAVA_CONVERSION")
27+
val caUrlStr: String? = System.getenv("CODEARTIFACT_REPO_URL")
2828
if (!caUrlStr.isNullOrBlank()) {
2929
caUrl = URI.create(caUrlStr)
3030
}
3131

3232
var caPassword: String? = null
3333
@Nullable
34-
val caPasswordString: String? = System.getenv("CODEARTIFACT_AUTH_TOKEN")
34+
val caPasswordString: String? = System.getenv("CODEARTIFACT_TOKEN")
3535
if (!caPasswordString.isNullOrBlank()) {
3636
caPassword = caPasswordString
3737
}
@@ -56,8 +56,8 @@ repositories {
5656
}
5757

5858
dependencies {
59-
implementation("software.amazon.cryptography:aws-database-encryption-sdk-dynamodb:1.0-SNAPSHOT")
60-
implementation("software.amazon.cryptography:AwsCryptographicMaterialProviders:1.0-SNAPSHOT")
59+
implementation("software.amazon.cryptography:aws-database-encryption-sdk-dynamodb:3.0.0-preview-1")
60+
implementation("software.amazon.cryptography:aws-cryptographic-material-providers:1.0.0-preview-1")
6161

6262
implementation(platform("software.amazon.awssdk:bom:2.19.1"))
6363
implementation("software.amazon.awssdk:arns")

Examples/runtimes/java/Migration/DDBECToAWSDBE/build.gradle.kts

+4-4
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ java {
2424

2525
var caUrl: URI? = null
2626
@Nullable
27-
val caUrlStr: String? = System.getenv("CODEARTIFACT_URL_JAVA_CONVERSION")
27+
val caUrlStr: String? = System.getenv("CODEARTIFACT_REPO_URL")
2828
if (!caUrlStr.isNullOrBlank()) {
2929
caUrl = URI.create(caUrlStr)
3030
}
3131

3232
var caPassword: String? = null
3333
@Nullable
34-
val caPasswordString: String? = System.getenv("CODEARTIFACT_AUTH_TOKEN")
34+
val caPasswordString: String? = System.getenv("CODEARTIFACT_TOKEN")
3535
if (!caPasswordString.isNullOrBlank()) {
3636
caPassword = caPasswordString
3737
}
@@ -56,8 +56,8 @@ repositories {
5656
}
5757

5858
dependencies {
59-
implementation("software.amazon.cryptography:aws-database-encryption-sdk-dynamodb:1.0-SNAPSHOT")
60-
implementation("software.amazon.cryptography:AwsCryptographicMaterialProviders:1.0-SNAPSHOT")
59+
implementation("software.amazon.cryptography:aws-database-encryption-sdk-dynamodb:3.0.0-preview-1")
60+
implementation("software.amazon.cryptography:aws-cryptographic-material-providers:1.0.0-preview-1")
6161

6262
implementation(platform("software.amazon.awssdk:bom:2.19.1"))
6363
implementation("software.amazon.awssdk:dynamodb")

Examples/runtimes/java/Migration/PlaintextToAWSDBE/build.gradle.kts

+4-4
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ java {
2424

2525
var caUrl: URI? = null
2626
@Nullable
27-
val caUrlStr: String? = System.getenv("CODEARTIFACT_URL_JAVA_CONVERSION")
27+
val caUrlStr: String? = System.getenv("CODEARTIFACT_REPO_URL")
2828
if (!caUrlStr.isNullOrBlank()) {
2929
caUrl = URI.create(caUrlStr)
3030
}
3131

3232
var caPassword: String? = null
3333
@Nullable
34-
val caPasswordString: String? = System.getenv("CODEARTIFACT_AUTH_TOKEN")
34+
val caPasswordString: String? = System.getenv("CODEARTIFACT_TOKEN")
3535
if (!caPasswordString.isNullOrBlank()) {
3636
caPassword = caPasswordString
3737
}
@@ -56,8 +56,8 @@ repositories {
5656
}
5757

5858
dependencies {
59-
implementation("software.amazon.cryptography:aws-database-encryption-sdk-dynamodb:1.0-SNAPSHOT")
60-
implementation("software.amazon.cryptography:AwsCryptographicMaterialProviders:1.0-SNAPSHOT")
59+
implementation("software.amazon.cryptography:aws-database-encryption-sdk-dynamodb:3.0.0-preview-1")
60+
implementation("software.amazon.cryptography:aws-cryptographic-material-providers:1.0.0-preview-1")
6161

6262
implementation(platform("software.amazon.awssdk:bom:2.19.1"))
6363
implementation("software.amazon.awssdk:dynamodb")

README.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# AWS Database Encryption SDK for DynamoDB in Java
22

3+
Note: The AWS Cryptographic Material Providers Library is released as a
4+
[developer preview](https://docs.aws.amazon.com/sdkref/latest/guide/maint-policy.html#version-life-cycle)
5+
and is subject to change.
6+
The current release is not intended to be used in production environments.
7+
38
The AWS Database Encryption SDK (DB-ESDK) for DynamoDB in Java is a client-side encryption
49
library that allows you to perform attribute-level encryption, enabling you to encrypt specific
510
attribute values within items before storing them in your DynamoDB table. All encryption and

SUPPORT_POLICY.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ This table describes the current support status of each major version of the AWS
2121
- Current status
2222
- Next status
2323
- Next status date
24-
* - 3.x
25-
- General Availability
24+
* - 3.0.0-preview-1
25+
- Developer Preview
2626
-
2727
-
2828

29-
.. _AWS SDKs and Tools Maintenance Policy: https://docs.aws.amazon.com/sdkref/latest/guide/maint-policy.html#version-life-cycle
29+
.. _AWS SDKs and Tools Maintenance Policy: https://docs.aws.amazon.com/sdkref/latest/guide/maint-policy.html#version-life-cycle

0 commit comments

Comments
 (0)