Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .releaserc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,30 @@
`npx semantic-release --branches main`
*/

const fs = require("fs");

/**
* Function to parse a simple properties file
* @param {string} filePath - Path to the properties file
* @returns {Object} Parsed properties as key-value pairs
*/
function parsePropertiesFile(filePath) {
const content = fs.readFileSync(filePath, "utf8");
const properties = {};

content.split("\n").forEach((line) => {
if (line && !line.startsWith("#") && line.includes("=")) {
const [key, ...valueParts] = line.split("=");
properties[key.trim()] = valueParts.join("=").trim();
}
});

return properties;
}

// Read your project.properties file
const props = parsePropertiesFile("./project.properties");

// This project has several runtimes
// each one has files that need to be updated.
// We model all the files and the runtimes here in this structure
Expand Down Expand Up @@ -122,6 +146,13 @@ module.exports = {
results: Object.keys(Runtimes.net).map(CheckResults),
countMatches: true,
},
{
files: Object.keys(Runtimes.net),
from: '<ProjectReference Include="../../../submodules/MaterialProviders/AwsCryptographicMaterialProviders/runtimes/net/MPL.csproj"/>',
to: `<PackageReference Include="AWS.Cryptography.MaterialProviders" Version="[${props.mplDependencyNetVersion}]" />`,
results: Object.keys(Runtimes.net).map(CheckResults),
countMatches: true,
},
// Update the AssmeblyInfo.cs file of the DotNet projects
...Object.entries(Runtimes.net).flatMap(
([file, { assemblyInfo }]) => ({
Expand Down
3 changes: 2 additions & 1 deletion DynamoDbEncryption/runtimes/net/DynamoDbEncryption.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@
<!-- See https://learn.microsoft.com/en-us/nuget/concepts/package-versioning?tabs=semver20sort#version-ranges -->
<PackageReference Include="AWSSDK.Core" Version="[3.7.*, 4.0)" />
<PackageReference Include="AWSSDK.DynamoDBv2" Version="[3.7.*, 4.0)" />
<PackageReference Include="AWS.Cryptography.MaterialProviders" Version="[1.11.2]" />
<!-- Before releasing a new DBESDK version ensure to pin the MPL -->
<ProjectReference Include="../../../submodules/MaterialProviders/AwsCryptographicMaterialProviders/runtimes/net/MPL.csproj"/>
<!--
System.Collections.Immutable can be removed once dafny.msbuild is updated with
https://github.com/dafny-lang/dafny.msbuild/pull/10 and versioned
Expand Down
1 change: 1 addition & 0 deletions project.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
projectJavaVersion=3.9.1
mplDependencyJavaVersion=1.11.2-SNAPSHOT
mplDependencyNetVersion=1.11.2
dafnyVersion=4.9.0
dafnyVerifyVersion=4.9.1
dafnyRuntimeJavaVersion=4.9.0
Expand Down
2 changes: 1 addition & 1 deletion submodules/MaterialProviders
Loading