-
Notifications
You must be signed in to change notification settings - Fork 16
chore: add .NET release steps #717
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
643787a
chore: add .NET release steps
josecorella b1d10a1
add ubuntu and windows
josecorella eee93c4
support long paths
josecorella 6359b53
m
josecorella 49f0769
m
josecorella 0df4db1
?
josecorella fc4eb26
maybe
josecorella 3683b2f
rearrange
josecorella 15dfe20
?
josecorella 07412c6
always use compile suffix
josecorella b6ea94e
oops maybe too much
josecorella File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
version: 0.2 | ||
|
||
phases: | ||
install: | ||
runtime-versions: | ||
dotnet: 6.0 | ||
python: 3.x | ||
commands: | ||
- cd .. | ||
# Get Dafny | ||
#- export `cat ./aws-database-encryption-sdk-dynamodb/project.properties` | ||
- curl https://github.com/dafny-lang/dafny/releases/download/v$dafnyVersion/dafny-$dafnyVersion-x64-ubuntu-20.04.zip -L -o dafny.zip | ||
- unzip -qq dafny.zip && rm dafny.zip | ||
- export PATH="$PWD/dafny:$PATH" | ||
# Switch back to the main directory | ||
- cd aws-database-encryption-sdk-dynamodb | ||
pre_build: | ||
commands: | ||
# UNIQUE_ID should be passed in as an environment variable. It is used to tie | ||
# the different parts of the asynchronous signing process together | ||
- echo "Using unique id for flow $UNIQUE_ID" | ||
# Build unsigned source | ||
- cd DynamoDbEncryption | ||
- make transpile_net | ||
- dotnet build runtimes/net /p:Configuration=Release -nowarn:CS0162,CS0168 | ||
# This step assumes signing has already happened and we just need to retrieve | ||
# the signed artifacts | ||
- export ASSEMBLY_NAME="AWS.Cryptography.DbEncryptionSDK.DynamoDb.dll" | ||
- export BASE=../codebuild/net | ||
- python $BASE/retrieve_signed_assembly.py --target net6.0 --unique-id $UNIQUE_ID | ||
- python $BASE/retrieve_signed_assembly.py --target net48 --unique-id $UNIQUE_ID | ||
build: | ||
commands: | ||
- mkdir build | ||
- export VERSION=`grep '<Version>' runtimes/net/DynamoDbEncryption.csproj | sed 's/.*<Version>\(.*\)<\/Version>/\1/'` | ||
- dotnet pack runtimes/net/DynamoDbEncryption.csproj --no-build /p:Configuration=Release --output build | ||
- export API_ACCESS_KEY=$(python $BASE/retrieve_api_access_key.py) | ||
- dotnet nuget push build/AWS.Cryptography.DbEncryptionSDK.DynamoDb.$VERSION.nupkg --api-key "$API_ACCESS_KEY" --source https://api.nuget.org/v3/index.json |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
version: 0.2 | ||
|
||
phases: | ||
install: | ||
runtime-versions: | ||
dotnet: 6.0 | ||
python: 3.x | ||
commands: | ||
- cd .. | ||
# Get Dafny | ||
#- export `cat ./aws-database-encryption-sdk-dynamodb/project.properties` | ||
- curl https://github.com/dafny-lang/dafny/releases/download/v$dafnyVersion/dafny-$dafnyVersion-x64-ubuntu-20.04.zip -L -o dafny.zip | ||
- unzip -qq dafny.zip && rm dafny.zip | ||
- export PATH="$PWD/dafny:$PATH" | ||
# Switch back to the main directory | ||
- cd aws-database-encryption-sdk-dynamodb | ||
pre_build: | ||
commands: | ||
# UNIQUE_ID should be passed in as an environment variable. It is used to tie | ||
# the different parts of the asynchronous signing process together | ||
- echo "Using unique id for flow $UNIQUE_ID" | ||
# Build unsigned source | ||
- cd DynamoDbEncryption | ||
- make transpile_net | ||
- dotnet build runtimes/net /p:Configuration=Release -nowarn:CS0162,CS0168 | ||
# This step assumes signing has already happened and we just need to retrieve | ||
# the signed artifacts | ||
- export ASSEMBLY_NAME="AWS.Cryptography.DbEncryptionSDK.DynamoDb.dll" | ||
- export BASE=../codebuild/net | ||
- python $BASE/retrieve_signed_assembly.py --target net6.0 --unique-id $UNIQUE_ID | ||
- python $BASE/retrieve_signed_assembly.py --target net48 --unique-id $UNIQUE_ID | ||
build: | ||
commands: | ||
- mkdir build | ||
- >- | ||
aws codeartifact login \ | ||
--tool dotnet \ | ||
--repository dbesdk-net-staging \ | ||
--domain crypto-tools-internal \ | ||
--domain-owner 587316601012 \ | ||
--region us-east-1 | ||
# Set a unique version for releasing to staging, because this may fail and we don't | ||
# want to collide with previous runs | ||
- export VERSION=`grep '<Version>' runtimes/net/DynamoDbEncryption.csproj | sed 's/.*<Version>\(.*\)<\/Version>/\1/'` | ||
- dotnet pack runtimes/net/DynamoDbEncryption.csproj --no-build /p:Configuration=Release --output build | ||
- dotnet nuget push build/AWS.Cryptography.DbEncryptionSDK.DynamoDb.$VERSION.nupkg --source crypto-tools-internal/dbesdk-net-staging | ||
# Now validate we can run the tests | ||
- sed -i.backup "/\<ProjectReference Include=\"..\/DynamoDbEncryption.csproj\" \/>/d" runtimes/net/tests/Test-DynamoDbEncryption.csproj | ||
- dotnet add runtimes/net/tests/Test-DynamoDbEncryption.csproj package AWS.Cryptography.DbEncryptionSDK.DynamoDb --version $VERSION | ||
|
||
# run tests | ||
- TMP_ROLE=$(aws sts assume-role --role-arn "arn:aws:iam::370957321024:role/GitHub-CI-DDBEC-Dafny-Role-us-west-2" --role-session-name "CB-TestVectorResources") | ||
- export TMP_ROLE | ||
- export AWS_ACCESS_KEY_ID=$(echo "${TMP_ROLE}" | jq -r '.Credentials.AccessKeyId') | ||
- export AWS_SECRET_ACCESS_KEY=$(echo "${TMP_ROLE}" | jq -r '.Credentials.SecretAccessKey') | ||
- export AWS_SESSION_TOKEN=$(echo "${TMP_ROLE}" | jq -r '.Credentials.SessionToken') | ||
- aws sts get-caller-identity | ||
- make test_net FRAMEWORK=net6.0 | ||
|
||
# run test vectors | ||
- cd ../TestVectors | ||
- sed -i.backup "/\<ProjectReference Include=\"..\/..\/..\/DynamoDbEncryption\/runtimes\/net\/DynamoDbEncryption.csproj\" \/>/d" runtimes/net/DbEsdkTestVectors.csproj | ||
- dotnet add runtimes/net/DbEsdkTestVectors.csproj package AWS.Cryptography.DbEncryptionSDK.DynamoDb --version $VERSION | ||
- make transpile_net | ||
- cd runtimes/net | ||
- cp ../java/decrypt_java.json ../java/decrypt_dotnet.json . | ||
- dotnet run --framework net6.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
version: 0.2 | ||
|
||
batch: | ||
fast-fail: true | ||
build-graph: | ||
- identifier: sign | ||
buildspec: DynamoDbEncryption/codebuild/sign.yml | ||
env: | ||
type: LINUX_CONTAINER | ||
image: aws/codebuild/standard:6.0 | ||
- identifier: verify | ||
buildspec: DynamoDbEncryption/codebuild/verify.yml | ||
env: | ||
type: WINDOWS_SERVER_2019_CONTAINER | ||
image: aws/codebuild/windows-base:2019-2.0 | ||
depend-on: | ||
- sign | ||
- identifier: release_staging | ||
buildspec: DynamoDbEncryption/codebuild/release-staging.yml | ||
env: | ||
type: LINUX_CONTAINER | ||
image: aws/codebuild/standard:6.0 | ||
depend-on: | ||
- verify | ||
- identifier: release_prod | ||
buildspec: DynamoDbEncryption/codebuild/release-prod.yml | ||
env: | ||
type: LINUX_CONTAINER | ||
image: aws/codebuild/standard:6.0 | ||
depend-on: | ||
- verify | ||
- release_staging | ||
- identifier: test_prod | ||
buildspec: DynamoDbEncryption/codebuild/test-prod.yml | ||
env: | ||
type: LINUX_CONTAINER | ||
image: aws/codebuild/standard:6.0 | ||
depend-on: | ||
- release_prod |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
version: 0.2 | ||
|
||
phases: | ||
install: | ||
runtime-versions: | ||
dotnet: 6.0 | ||
python: 3.x | ||
commands: | ||
- cd .. | ||
# Get Dafny | ||
#- export `cat ./aws-database-encryption-sdk-dynamodb/project.properties` | ||
- curl https://github.com/dafny-lang/dafny/releases/download/v$dafnyVersion/dafny-$dafnyVersion-x64-ubuntu-20.04.zip -L -o dafny.zip | ||
- unzip -qq dafny.zip && rm dafny.zip | ||
- export PATH="$PWD/dafny:$PATH" | ||
# Switch back to the main directory | ||
- cd aws-database-encryption-sdk-dynamodb | ||
pre_build: | ||
commands: | ||
# UNIQUE_ID should be passed in as an environment variable. It is used to tie | ||
# the different parts of the asynchronous signing process together | ||
- echo "Using unique id for flow $UNIQUE_ID" | ||
build: | ||
commands: | ||
## Build Library from Source | ||
- cd DynamoDbEncryption | ||
- make transpile_net | ||
- TMP_ROLE=$(aws sts assume-role --role-arn "arn:aws:iam::370957321024:role/GitHub-CI-DDBEC-Dafny-Role-us-west-2" --role-session-name "CB-TestVectorResources") | ||
- export TMP_ROLE | ||
- export AWS_ACCESS_KEY_ID=$(echo "${TMP_ROLE}" | jq -r '.Credentials.AccessKeyId') | ||
- export AWS_SECRET_ACCESS_KEY=$(echo "${TMP_ROLE}" | jq -r '.Credentials.SecretAccessKey') | ||
- export AWS_SESSION_TOKEN=$(echo "${TMP_ROLE}" | jq -r '.Credentials.SessionToken') | ||
- aws sts get-caller-identity | ||
- make test_net FRAMEWORK=net6.0 | ||
|
||
## Unset temp creds so that we get dropped back into the aws codebuild service role | ||
- unset AWS_ACCESS_KEY_ID; unset AWS_SECRET_ACCESS_KEY; unset AWS_SESSION_TOKEN; | ||
|
||
- dotnet build runtimes/net /p:Configuration=Release -nowarn:CS0162,CS0168 | ||
- export ASSEMBLY_NAME="AWS.Cryptography.DbEncryptionSDK.DynamoDb.dll" | ||
- export BASE=../codebuild/net | ||
- python $BASE/upload_assembly.py --target net6.0 --unique-id $UNIQUE_ID | ||
- python $BASE/upload_assembly.py --target net48 --unique-id $UNIQUE_ID | ||
## Retrieve the signed assembly. We're not going to use it, but this | ||
## ensures that the signing process is complete | ||
- python $BASE/retrieve_signed_assembly.py --target net6.0 --unique-id $UNIQUE_ID | ||
- python $BASE/retrieve_signed_assembly.py --target net48 --unique-id $UNIQUE_ID |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
version: 0.2 | ||
|
||
phases: | ||
install: | ||
runtime-versions: | ||
dotnet: 6.0 | ||
python: 3.x | ||
commands: | ||
- cd .. | ||
# Get Dafny | ||
#- export `cat ./aws-database-encryption-sdk-dynamodb/project.properties` | ||
- curl https://github.com/dafny-lang/dafny/releases/download/v$dafnyVersion/dafny-$dafnyVersion-x64-ubuntu-20.04.zip -L -o dafny.zip | ||
- unzip -qq dafny.zip && rm dafny.zip | ||
- export PATH="$PWD/dafny:$PATH" | ||
# Switch back to the main directory | ||
- cd aws-database-encryption-sdk-dynamodb | ||
pre_build: | ||
commands: | ||
- cd DynamoDbEncryption | ||
- make transpile_net | ||
build: | ||
commands: | ||
- export VERSION=`grep '<Version>' runtimes/net/DynamoDbEncryption.csproj | sed 's/.*<Version>\(.*\)<\/Version>/\1/'` | ||
- sed -i.backup "/\<ProjectReference Include=\"..\/DynamoDbEncryption.csproj\" \/>/d" runtimes/net/tests/Test-DynamoDbEncryption.csproj | ||
- dotnet add runtimes/net/tests/Test-DynamoDbEncryption.csproj package AWS.Cryptography.DbEncryptionSDK.DynamoDb --version $VERSION | ||
|
||
# run tests | ||
- TMP_ROLE=$(aws sts assume-role --role-arn "arn:aws:iam::370957321024:role/GitHub-CI-DDBEC-Dafny-Role-us-west-2" --role-session-name "CB-TestVectorResources") | ||
- export TMP_ROLE | ||
- export AWS_ACCESS_KEY_ID=$(echo "${TMP_ROLE}" | jq -r '.Credentials.AccessKeyId') | ||
- export AWS_SECRET_ACCESS_KEY=$(echo "${TMP_ROLE}" | jq -r '.Credentials.SecretAccessKey') | ||
- export AWS_SESSION_TOKEN=$(echo "${TMP_ROLE}" | jq -r '.Credentials.SessionToken') | ||
- aws sts get-caller-identity | ||
- make test_net FRAMEWORK=net6.0 | ||
|
||
# run test vectors | ||
- cd ../TestVectors | ||
- sed -i.backup "/\<ProjectReference Include=\"..\/..\/..\/DynamoDbEncryption\/runtimes\/net\/DynamoDbEncryption.csproj\" \/>/d" runtimes/net/DbEsdkTestVectors.csproj | ||
- dotnet add runtimes/net/DbEsdkTestVectors.csproj package AWS.Cryptography.DbEncryptionSDK.DynamoDb --version $VERSION | ||
- make transpile_net | ||
- cd runtimes/net | ||
- cp ../java/decrypt_java.json ../java/decrypt_dotnet.json . | ||
- dotnet run --framework net6.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
version: 0.2 | ||
|
||
env: | ||
variables: | ||
FILE_NAME: "AWS.Cryptography.DbEncryptionSDK.DynamoDb.dll" | ||
ASSEMBLY_NAME: "AWS.Cryptography.DbEncryptionSDK.DynamoDb.dll" | ||
|
||
phases: | ||
install: | ||
runtime-versions: | ||
dotnet: 6.0 | ||
python: 3.x | ||
build: | ||
commands: | ||
- mkdir net48 | ||
- python codebuild/net/retrieve_signed_assembly.py --target net48 --unique-id $Env:UNIQUE_ID --output net48 | ||
- $sig = Get-AuthenticodeSignature -FilePath net48/$Env:FILE_NAME | ||
- $sig | Format-List -Property * | ||
# Check signature on net6.0 dll | ||
- mkdir net6.0 | ||
- python codebuild/net/retrieve_signed_assembly.py --target net6.0 --unique-id $Env:UNIQUE_ID --output net6.0 | ||
- $sig = Get-AuthenticodeSignature -FilePath net6.0/$Env:FILE_NAME | ||
- $sig | Format-List -Property * |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
using System.Reflection; | ||
|
||
[assembly: AssemblyTitle("AWS.Cryptography.DbEncryptionSDK.DynamoDb")] | ||
|
||
// This should be kept in sync with the version number in MPL.csproj | ||
[assembly: AssemblyVersion("3.2.0")] | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this command '>-' correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yup!