diff --git a/.autover/changes/3fb2215f-52a7-4b5c-8019-65b4c8618452.json b/.autover/changes/3fb2215f-52a7-4b5c-8019-65b4c8618452.json new file mode 100644 index 00000000..d10cf40c --- /dev/null +++ b/.autover/changes/3fb2215f-52a7-4b5c-8019-65b4c8618452.json @@ -0,0 +1,11 @@ +{ + "Projects": [ + { + "Name": "Amazon.Lambda.Tools", + "Type": "Patch", + "ChangelogMessages": [ + "Fix: Use function architecture to determine artifact path instead of hardcoded \u0027x64\u0027." + ] + } + ] +} \ No newline at end of file diff --git a/src/Amazon.Lambda.Tools/Commands/PublishLayerCommand.cs b/src/Amazon.Lambda.Tools/Commands/PublishLayerCommand.cs index f052680e..d16394a9 100644 --- a/src/Amazon.Lambda.Tools/Commands/PublishLayerCommand.cs +++ b/src/Amazon.Lambda.Tools/Commands/PublishLayerCommand.cs @@ -246,9 +246,9 @@ private async Task CreateRuntimePackageStoreLayerZipFi } var architecture = this.GetStringValueOrDefault(this.Architecture, LambdaDefinedCommandOptions.ARGUMENT_FUNCTION_ARCHITECTURE, false); var cliWrapper = new LambdaDotNetCLIWrapper(this.Logger, this.WorkingDirectory); - if(cliWrapper.Store(defaults: this.DefaultConfig, + if (cliWrapper.Store(defaults: this.DefaultConfig, projectLocation: projectLocation, - outputLocation: storeOutputDirectory, + outputLocation: storeOutputDirectory, targetFramework: targetFramework, packageManifest: convertResult.PackageManifest, architecture: architecture, @@ -265,7 +265,8 @@ private async Task CreateRuntimePackageStoreLayerZipFi // The artifact.xml file is generated by the "dotnet store" command that lists the packages that were added to the store. // It is required during a "dotnet publish" so the NuGet packages in the store will be filtered out. - var artifactXmlPath = Path.Combine(storeOutputDirectory, "x64", targetFramework, "artifact.xml"); + var architectureDirectory = this.GetStringValueOrDefault(this.Architecture, LambdaDefinedCommandOptions.ARGUMENT_FUNCTION_ARCHITECTURE, false) ?? "x64"; + var artifactXmlPath = Path.Combine(storeOutputDirectory, architectureDirectory, targetFramework, "artifact.xml"); if(!File.Exists(artifactXmlPath)) { throw new LambdaToolsException($"Failed to find artifact.xml file in created local store.", LambdaToolsException.LambdaErrorCode.FailedToFindArtifactZip);