From d05d45f6ed96084e2f725876b85d56b18785ed80 Mon Sep 17 00:00:00 2001 From: Garrett Beatty Date: Tue, 15 Jul 2025 18:10:19 -0400 Subject: [PATCH 01/19] auto update lambda runtime images --- .github/workflows/auto-update-Dockerfiles.yml | 175 ++++++++++++++++++ .github/workflows/update-Dockerfiles.yml | 12 +- .../get-latest-aspnet-versions.ps1 | 147 +++++++++++++++ 3 files changed, 328 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/auto-update-Dockerfiles.yml create mode 100644 LambdaRuntimeDockerfiles/get-latest-aspnet-versions.ps1 diff --git a/.github/workflows/auto-update-Dockerfiles.yml b/.github/workflows/auto-update-Dockerfiles.yml new file mode 100644 index 000000000..8f43f4fd8 --- /dev/null +++ b/.github/workflows/auto-update-Dockerfiles.yml @@ -0,0 +1,175 @@ +name: Auto-Update Lambda Dockerfiles Monthly + +on: + # Run monthly on the 1st day of each month at midnight UTC + schedule: + - cron: '0 0 1 * *' + # Allows to run this workflow manually from the Actions tab for testing + workflow_dispatch: + +jobs: + auto-update: + runs-on: ubuntu-latest + env: + NET_8_AMD64_Dockerfile: "LambdaRuntimeDockerfiles/Images/net8/amd64/Dockerfile" + NET_8_ARM64_Dockerfile: "LambdaRuntimeDockerfiles/Images/net8/arm64/Dockerfile" + NET_9_AMD64_Dockerfile: "LambdaRuntimeDockerfiles/Images/net9/amd64/Dockerfile" + NET_9_ARM64_Dockerfile: "LambdaRuntimeDockerfiles/Images/net9/arm64/Dockerfile" + NET_10_AMD64_Dockerfile: "LambdaRuntimeDockerfiles/Images/net10/amd64/Dockerfile" + NET_10_ARM64_Dockerfile: "LambdaRuntimeDockerfiles/Images/net10/arm64/Dockerfile" + + steps: + # Checks-out the repository under $GITHUB_WORKSPACE + - uses: actions/checkout@85e6279cec87321a52edac9c87bce653a07cf6c2 #v4.2.2 + with: + ref: 'dev' + + # Determine the latest ASP.NET Core versions for all .NET versions + - name: Determine Latest ASP.NET Core Versions + id: get-versions + shell: pwsh + run: | + $versions = ./LambdaRuntimeDockerfiles/get-latest-aspnet-versions.ps1 + foreach ($line in $versions) { + if ($line -match '(.+)=(.+)') { + echo "$($matches[1])=$($matches[2])" >> $env:GITHUB_OUTPUT + echo "Using $($matches[1])=$($matches[2])" + } + } + + # Update .NET 8 AMD64 Dockerfile + - name: Update .NET 8 AMD64 + id: update-net8-amd64 + shell: pwsh + env: + DOCKERFILE_PATH: ${{ env.NET_8_AMD64_Dockerfile }} + NEXT_VERSION: ${{ steps.get-versions.outputs.NET_8_NEXT_VERSION }} + run: | + if (-not [string]::IsNullOrEmpty("${{ env.NEXT_VERSION }}")) { + .\LambdaRuntimeDockerfiles\update-dockerfile.ps1 -DockerfilePath "${{ env.DOCKERFILE_PATH }}" -NextVersion "${{ env.NEXT_VERSION }}" + } else { + Write-Host "Skipping .NET 8 AMD64 update - No version detected" + } + + # Update .NET 8 ARM64 Dockerfile + - name: Update .NET 8 ARM64 + id: update-net8-arm64 + shell: pwsh + env: + DOCKERFILE_PATH: ${{ env.NET_8_ARM64_Dockerfile }} + NEXT_VERSION: ${{ steps.get-versions.outputs.NET_8_NEXT_VERSION }} + run: | + if (-not [string]::IsNullOrEmpty("${{ env.NEXT_VERSION }}")) { + .\LambdaRuntimeDockerfiles\update-dockerfile.ps1 -DockerfilePath "${{ env.DOCKERFILE_PATH }}" -NextVersion "${{ env.NEXT_VERSION }}" + } else { + Write-Host "Skipping .NET 8 ARM64 update - No version detected" + } + + # Update .NET 9 AMD64 Dockerfile + - name: Update .NET 9 AMD64 + id: update-net9-amd64 + shell: pwsh + env: + DOCKERFILE_PATH: ${{ env.NET_9_AMD64_Dockerfile }} + NEXT_VERSION: ${{ steps.get-versions.outputs.NET_9_NEXT_VERSION }} + run: | + if (-not [string]::IsNullOrEmpty("${{ env.NEXT_VERSION }}")) { + .\LambdaRuntimeDockerfiles\update-dockerfile.ps1 -DockerfilePath "${{ env.DOCKERFILE_PATH }}" -NextVersion "${{ env.NEXT_VERSION }}" + } else { + Write-Host "Skipping .NET 9 AMD64 update - No version detected" + } + + # Update .NET 9 ARM64 Dockerfile + - name: Update .NET 9 ARM64 + id: update-net9-arm64 + shell: pwsh + env: + DOCKERFILE_PATH: ${{ env.NET_9_ARM64_Dockerfile }} + NEXT_VERSION: ${{ steps.get-versions.outputs.NET_9_NEXT_VERSION }} + run: | + if (-not [string]::IsNullOrEmpty("${{ env.NEXT_VERSION }}")) { + .\LambdaRuntimeDockerfiles\update-dockerfile.ps1 -DockerfilePath "${{ env.DOCKERFILE_PATH }}" -NextVersion "${{ env.NEXT_VERSION }}" + } else { + Write-Host "Skipping .NET 9 ARM64 update - No version detected" + } + + # Update .NET 10 AMD64 Dockerfile + - name: Update .NET 10 AMD64 + id: update-net10-amd64 + shell: pwsh + env: + DOCKERFILE_PATH: ${{ env.NET_10_AMD64_Dockerfile }} + NEXT_VERSION: ${{ steps.get-versions.outputs.NET_10_NEXT_VERSION }} + run: | + if (-not [string]::IsNullOrEmpty("${{ env.NEXT_VERSION }}")) { + .\LambdaRuntimeDockerfiles\update-dockerfile.ps1 -DockerfilePath "${{ env.DOCKERFILE_PATH }}" -NextVersion "${{ env.NEXT_VERSION }}" + } else { + Write-Host "Skipping .NET 10 AMD64 update - No version detected" + } + + # Update .NET 10 ARM64 Dockerfile + - name: Update .NET 10 ARM64 + id: update-net10-arm64 + shell: pwsh + env: + DOCKERFILE_PATH: ${{ env.NET_10_ARM64_Dockerfile }} + NEXT_VERSION: ${{ steps.get-versions.outputs.NET_10_NEXT_VERSION }} + run: | + if (-not [string]::IsNullOrEmpty("${{ env.NEXT_VERSION }}")) { + .\LambdaRuntimeDockerfiles\update-dockerfile.ps1 -DockerfilePath "${{ env.DOCKERFILE_PATH }}" -NextVersion "${{ env.NEXT_VERSION }}" + } else { + Write-Host "Skipping .NET 10 ARM64 update - No version detected" + } + + # Commit changes and create a branch + - name: Commit and Push + id: commit-push + shell: pwsh + run: | + # Check if there are any changes to commit + if (git status --porcelain) { + git config --global user.email "github-aws-sdk-dotnet-automation@amazon.com" + git config --global user.name "aws-sdk-dotnet-automation" + $suffix=Get-Date -Format yyyy-MM-dd + $branch="chore/auto-update-Dockerfiles-${suffix}" + git checkout -b $branch + git add "**/*Dockerfile" + git commit -m "chore: Monthly ASP.NET Core version update in Dockerfiles" + git push origin $branch + + # Write the branch name to GITHUB_OUTPUT for use in the PR step + Add-Content -Path $env:GITHUB_OUTPUT -Value "BRANCH=$branch" + Add-Content -Path $env:GITHUB_OUTPUT -Value "CHANGES_MADE=true" + echo "Changes committed and pushed to branch $branch" + } else { + echo "No changes detected in Dockerfiles, skipping PR creation" + } + + # Create a Pull Request + - name: Create Pull Request + id: pull-request + if: ${{ steps.commit-push.outputs.CHANGES_MADE == 'true' }} + uses: repo-sync/pull-request@v2 + with: + source_branch: ${{ steps.commit-push.outputs.BRANCH }} + destination_branch: "dev" + pr_title: 'chore: Monthly ASP.NET Core version update in Dockerfiles' + pr_body: "This PR automatically updates the Dockerfiles to use the latest ASP.NET Core version. + + Verify that the Dockerfiles have correct versions and matching SHA512 checksums for ASP.NET Core runtime. + + All .NET versions: https://dotnet.microsoft.com/en-us/download/dotnet + + *Description of changes:* + \n${{ format + ( + '{0}\n{1}\n{2}\n{3}\n{4}\n{5}', + join(steps.update-net8-amd64.outputs.MESSAGE, '\n'), + join(steps.update-net8-arm64.outputs.MESSAGE, '\n'), + join(steps.update-net9-amd64.outputs.MESSAGE, '\n'), + join(steps.update-net9-arm64.outputs.MESSAGE, '\n'), + join(steps.update-net10-amd64.outputs.MESSAGE, '\n'), + join(steps.update-net10-arm64.outputs.MESSAGE, '\n') + ) + }}" + github_token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/update-Dockerfiles.yml b/.github/workflows/update-Dockerfiles.yml index 9fbbd0690..27956024b 100644 --- a/.github/workflows/update-Dockerfiles.yml +++ b/.github/workflows/update-Dockerfiles.yml @@ -8,12 +8,12 @@ on: description: ".NET 8 AMD64" type: boolean required: true - default: "true" + default: true NET_8_ARM64: description: ".NET 8 ARM64" type: boolean required: true - default: "true" + default: true NET_8_NEXT_VERSION: description: ".NET 8 Next Version" type: string @@ -22,12 +22,12 @@ on: description: ".NET 9 AMD64" type: boolean required: true - default: "true" + default: true NET_9_ARM64: description: ".NET 9 ARM64" type: boolean required: true - default: "true" + default: true NET_9_NEXT_VERSION: description: ".NET 9 Next Version" type: string @@ -36,12 +36,12 @@ on: description: ".NET 10 AMD64" type: boolean required: true - default: "true" + default: true NET_10_ARM64: description: ".NET 10 ARM64" type: boolean required: true - default: "true" + default: true NET_10_NEXT_VERSION: description: ".NET 10 Next Version" type: string diff --git a/LambdaRuntimeDockerfiles/get-latest-aspnet-versions.ps1 b/LambdaRuntimeDockerfiles/get-latest-aspnet-versions.ps1 new file mode 100644 index 000000000..d233c222a --- /dev/null +++ b/LambdaRuntimeDockerfiles/get-latest-aspnet-versions.ps1 @@ -0,0 +1,147 @@ +# This script fetches the latest ASP.NET Core runtime versions for .NET 8, 9, and 10 +# It uses the NuGet API to query for Microsoft.AspNetCore.App.Runtime.linux-x64 package versions + +function Get-LatestAspNetVersion { + param ( + [string]$majorVersion + ) + + Write-Host "Fetching latest ASP.NET Core runtime version for .NET $majorVersion..." + + try { + # Use NuGet API to find latest version + $response = Invoke-RestMethod -Uri "https://api.nuget.org/v3-flatcontainer/microsoft.aspnetcore.app.runtime.linux-x64/index.json" + + # Filter versions matching the major version + $versions = @() + foreach ($ver in $response.versions) { + if ($ver -like "$majorVersion.*") { + $versions += $ver + } + } + + if ($versions.Count -eq 0) { + Write-Error "No versions found for .NET $majorVersion" + return $null + } + + # Separate release and preview versions + $releaseVersions = @() + $previewVersions = @() + + foreach ($ver in $versions) { + if ($ver -match '-preview') { + $previewVersions += $ver + } else { + $releaseVersions += $ver + } + } + + # If we have release versions, get the latest + if ($releaseVersions.Count -gt 0) { + $verObjects = @() + + foreach ($ver in $releaseVersions) { + try { + $verObj = New-Object PSObject + Add-Member -InputObject $verObj -MemberType NoteProperty -Name "OriginalVersion" -Value $ver + + # Convert to Version object for proper comparison + $versionObj = [Version]$ver + Add-Member -InputObject $verObj -MemberType NoteProperty -Name "Version" -Value $versionObj + + $verObjects += $verObj + } catch { + Write-Host "Warning: Could not parse version $ver, skipping." + } + } + + # Sort by version (descending) and get the first one + $sortedVersions = $verObjects | Sort-Object -Property Version -Descending + + if ($sortedVersions.Count -gt 0) { + $latestVersion = $sortedVersions[0].OriginalVersion + } else { + $latestVersion = $null + } + } + # Otherwise get the latest preview version + elseif ($previewVersions.Count -gt 0) { + # For preview versions like "10.0.0-preview.5.25277.114" + $previewObjs = @() + + foreach ($ver in $previewVersions) { + if ($ver -match '(\d+)\.(\d+)\.(\d+)-preview\.(\d+)') { + $major = [int]$matches[1] + $minor = [int]$matches[2] + $patch = [int]$matches[3] + $preview = [int]$matches[4] + + $previewObj = New-Object PSObject + Add-Member -InputObject $previewObj -MemberType NoteProperty -Name "OriginalVersion" -Value $ver + Add-Member -InputObject $previewObj -MemberType NoteProperty -Name "Major" -Value $major + Add-Member -InputObject $previewObj -MemberType NoteProperty -Name "Minor" -Value $minor + Add-Member -InputObject $previewObj -MemberType NoteProperty -Name "Patch" -Value $patch + Add-Member -InputObject $previewObj -MemberType NoteProperty -Name "Preview" -Value $preview + + $previewObjs += $previewObj + } + } + + # Sort by version components + $sortedPreviews = $previewObjs | Sort-Object -Property Major, Minor, Patch, Preview -Descending + + if ($sortedPreviews.Count -gt 0) { + $latestVersion = $sortedPreviews[0].OriginalVersion + } else { + # Fallback - just take the last one alphabetically + $latestVersion = ($previewVersions | Sort-Object)[-1] + } + } + else { + $latestVersion = $null + } + + if ($latestVersion) { + Write-Host "Latest ASP.NET Core runtime version for .NET $majorVersion is $latestVersion" + return $latestVersion + } else { + Write-Error "Could not determine latest version for .NET $majorVersion" + return $null + } + } + catch { + $errorMessage = "Error fetching versions for .NET $majorVersion " + $_ + Write-Error $errorMessage + return $null + } +} + +# Get latest versions for each .NET version +$net8Version = Get-LatestAspNetVersion -majorVersion "8" +$net9Version = Get-LatestAspNetVersion -majorVersion "9" +$net10Version = Get-LatestAspNetVersion -majorVersion "10" + +# Verify we got valid versions +$allVersionsValid = $true +if (-not $net8Version) { + Write-Error "Failed to determine .NET 8 version" + $allVersionsValid = $false +} +if (-not $net9Version) { + Write-Error "Failed to determine .NET 9 version" + $allVersionsValid = $false +} +if (-not $net10Version) { + Write-Error "Failed to determine .NET 10 version" + $allVersionsValid = $false +} + +if (-not $allVersionsValid) { + exit 1 +} + +# Output as GitHub Actions environment variables +Write-Output "NET_8_NEXT_VERSION=$net8Version" +Write-Output "NET_9_NEXT_VERSION=$net9Version" +Write-Output "NET_10_NEXT_VERSION=$net10Version" From b404e9e4f9385e085dfde2a3f2bfdb8ca57cc7c8 Mon Sep 17 00:00:00 2001 From: Garrett Beatty Date: Tue, 15 Jul 2025 20:18:18 -0400 Subject: [PATCH 02/19] temp add on github --- .github/workflows/auto-update-Dockerfiles.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/auto-update-Dockerfiles.yml b/.github/workflows/auto-update-Dockerfiles.yml index 8f43f4fd8..8096a1f4b 100644 --- a/.github/workflows/auto-update-Dockerfiles.yml +++ b/.github/workflows/auto-update-Dockerfiles.yml @@ -6,6 +6,9 @@ on: - cron: '0 0 1 * *' # Allows to run this workflow manually from the Actions tab for testing workflow_dispatch: + pull_request: + + jobs: auto-update: From 2eb7a4dea0a18d63d69a42c3643997d35f166eb7 Mon Sep 17 00:00:00 2001 From: Garrett Beatty Date: Tue, 15 Jul 2025 20:18:46 -0400 Subject: [PATCH 03/19] update --- .github/workflows/auto-update-Dockerfiles.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/auto-update-Dockerfiles.yml b/.github/workflows/auto-update-Dockerfiles.yml index 8096a1f4b..9af8d5780 100644 --- a/.github/workflows/auto-update-Dockerfiles.yml +++ b/.github/workflows/auto-update-Dockerfiles.yml @@ -6,7 +6,6 @@ on: - cron: '0 0 1 * *' # Allows to run this workflow manually from the Actions tab for testing workflow_dispatch: - pull_request: From 28c5b2c01b7c39dc194ffb2635daec0dc0b2b093 Mon Sep 17 00:00:00 2001 From: Garrett Beatty Date: Tue, 15 Jul 2025 20:20:45 -0400 Subject: [PATCH 04/19] fix pathing --- .github/workflows/auto-update-Dockerfiles.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/auto-update-Dockerfiles.yml b/.github/workflows/auto-update-Dockerfiles.yml index 9af8d5780..b1bbba07b 100644 --- a/.github/workflows/auto-update-Dockerfiles.yml +++ b/.github/workflows/auto-update-Dockerfiles.yml @@ -31,7 +31,7 @@ jobs: id: get-versions shell: pwsh run: | - $versions = ./LambdaRuntimeDockerfiles/get-latest-aspnet-versions.ps1 + $versions = .\LambdaRuntimeDockerfiles\get-latest-aspnet-versions.ps1 foreach ($line in $versions) { if ($line -match '(.+)=(.+)') { echo "$($matches[1])=$($matches[2])" >> $env:GITHUB_OUTPUT From fb53e7139013d9b237f42858bccb0611b599a45e Mon Sep 17 00:00:00 2001 From: Garrett Beatty Date: Tue, 15 Jul 2025 20:40:58 -0400 Subject: [PATCH 05/19] temp branch update --- .github/workflows/auto-update-Dockerfiles.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/auto-update-Dockerfiles.yml b/.github/workflows/auto-update-Dockerfiles.yml index b1bbba07b..8f052295e 100644 --- a/.github/workflows/auto-update-Dockerfiles.yml +++ b/.github/workflows/auto-update-Dockerfiles.yml @@ -24,7 +24,7 @@ jobs: # Checks-out the repository under $GITHUB_WORKSPACE - uses: actions/checkout@85e6279cec87321a52edac9c87bce653a07cf6c2 #v4.2.2 with: - ref: 'dev' + ref: 'gcbeatty/runtime2' # Determine the latest ASP.NET Core versions for all .NET versions - name: Determine Latest ASP.NET Core Versions From 997f128c8e283f89cee2d5f40bda4159c12eb72f Mon Sep 17 00:00:00 2001 From: Garrett Beatty Date: Tue, 15 Jul 2025 20:43:57 -0400 Subject: [PATCH 06/19] update branch back to dev --- .github/workflows/auto-update-Dockerfiles.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/auto-update-Dockerfiles.yml b/.github/workflows/auto-update-Dockerfiles.yml index 8f052295e..b1bbba07b 100644 --- a/.github/workflows/auto-update-Dockerfiles.yml +++ b/.github/workflows/auto-update-Dockerfiles.yml @@ -24,7 +24,7 @@ jobs: # Checks-out the repository under $GITHUB_WORKSPACE - uses: actions/checkout@85e6279cec87321a52edac9c87bce653a07cf6c2 #v4.2.2 with: - ref: 'gcbeatty/runtime2' + ref: 'dev' # Determine the latest ASP.NET Core versions for all .NET versions - name: Determine Latest ASP.NET Core Versions From cf2ec850452dd8a39c60f98434e43e5e7c1b32d8 Mon Sep 17 00:00:00 2001 From: Garrett Beatty Date: Tue, 15 Jul 2025 20:45:04 -0400 Subject: [PATCH 07/19] add permissions --- .github/workflows/auto-update-Dockerfiles.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/auto-update-Dockerfiles.yml b/.github/workflows/auto-update-Dockerfiles.yml index b1bbba07b..74b014db8 100644 --- a/.github/workflows/auto-update-Dockerfiles.yml +++ b/.github/workflows/auto-update-Dockerfiles.yml @@ -1,5 +1,9 @@ name: Auto-Update Lambda Dockerfiles Monthly +permissions: + contents: read + pull-requests: write + on: # Run monthly on the 1st day of each month at midnight UTC schedule: From e51055507a0637c259624a07672ed8c8b74d1a5a Mon Sep 17 00:00:00 2001 From: Garrett Beatty Date: Tue, 15 Jul 2025 20:54:16 -0400 Subject: [PATCH 08/19] add permissions and label --- .github/workflows/auto-update-Dockerfiles.yml | 14 ++++++++++++++ .github/workflows/update-Dockerfiles.yml | 19 ++++++++++++++++++- 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/.github/workflows/auto-update-Dockerfiles.yml b/.github/workflows/auto-update-Dockerfiles.yml index 74b014db8..02798c3ba 100644 --- a/.github/workflows/auto-update-Dockerfiles.yml +++ b/.github/workflows/auto-update-Dockerfiles.yml @@ -179,3 +179,17 @@ jobs: ) }}" github_token: ${{ secrets.GITHUB_TOKEN }} + + # Add "Release Not Needed" label to the PR + - name: Add Release Not Needed label + if: ${{ steps.pull-request.outputs.pr_number }} + uses: actions/github-script@v6 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + github.rest.issues.addLabels({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: ${{ steps.pull-request.outputs.pr_number }}, + labels: ['Release Not Needed'] + }) diff --git a/.github/workflows/update-Dockerfiles.yml b/.github/workflows/update-Dockerfiles.yml index 27956024b..1bdc051bc 100644 --- a/.github/workflows/update-Dockerfiles.yml +++ b/.github/workflows/update-Dockerfiles.yml @@ -1,5 +1,9 @@ name: Update Lambda Dockerfiles +permissions: + contents: read + pull-requests: write + on: # Allows to run this workflow manually from the Actions tab workflow_dispatch: @@ -165,4 +169,17 @@ jobs: ) }}" github_token: ${{ secrets.GITHUB_TOKEN }} - \ No newline at end of file + + # Add "Release Not Needed" label to the PR + - name: Add Release Not Needed label + if: ${{ steps.pull-request.outputs.pr_number }} + uses: actions/github-script@v6 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + github.rest.issues.addLabels({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: ${{ steps.pull-request.outputs.pr_number }}, + labels: ['Release Not Needed'] + }) From 6312c87299a9ea5c9682d04b29c4eafd79d7b36a Mon Sep 17 00:00:00 2001 From: Garrett Beatty Date: Tue, 15 Jul 2025 20:55:19 -0400 Subject: [PATCH 09/19] temp branch update --- .github/workflows/auto-update-Dockerfiles.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/auto-update-Dockerfiles.yml b/.github/workflows/auto-update-Dockerfiles.yml index 02798c3ba..680e18c9d 100644 --- a/.github/workflows/auto-update-Dockerfiles.yml +++ b/.github/workflows/auto-update-Dockerfiles.yml @@ -28,7 +28,7 @@ jobs: # Checks-out the repository under $GITHUB_WORKSPACE - uses: actions/checkout@85e6279cec87321a52edac9c87bce653a07cf6c2 #v4.2.2 with: - ref: 'dev' + ref: 'gcbeatty/runtime2' # Determine the latest ASP.NET Core versions for all .NET versions - name: Determine Latest ASP.NET Core Versions From 5538207997459c90b24c589e85ea97e28b3b94e9 Mon Sep 17 00:00:00 2001 From: Garrett Beatty Date: Tue, 15 Jul 2025 20:55:41 -0400 Subject: [PATCH 10/19] temp branch update --- .github/workflows/auto-update-Dockerfiles.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/auto-update-Dockerfiles.yml b/.github/workflows/auto-update-Dockerfiles.yml index 680e18c9d..02798c3ba 100644 --- a/.github/workflows/auto-update-Dockerfiles.yml +++ b/.github/workflows/auto-update-Dockerfiles.yml @@ -28,7 +28,7 @@ jobs: # Checks-out the repository under $GITHUB_WORKSPACE - uses: actions/checkout@85e6279cec87321a52edac9c87bce653a07cf6c2 #v4.2.2 with: - ref: 'gcbeatty/runtime2' + ref: 'dev' # Determine the latest ASP.NET Core versions for all .NET versions - name: Determine Latest ASP.NET Core Versions From a574dcdacb9c811d40a2c9da6c0ea28cd09d4761 Mon Sep 17 00:00:00 2001 From: Garrett Beatty Date: Tue, 15 Jul 2025 20:56:21 -0400 Subject: [PATCH 11/19] fix permissions --- .github/workflows/auto-update-Dockerfiles.yml | 2 +- .github/workflows/update-Dockerfiles.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/auto-update-Dockerfiles.yml b/.github/workflows/auto-update-Dockerfiles.yml index 02798c3ba..abc0472d6 100644 --- a/.github/workflows/auto-update-Dockerfiles.yml +++ b/.github/workflows/auto-update-Dockerfiles.yml @@ -1,7 +1,7 @@ name: Auto-Update Lambda Dockerfiles Monthly permissions: - contents: read + contents: write pull-requests: write on: diff --git a/.github/workflows/update-Dockerfiles.yml b/.github/workflows/update-Dockerfiles.yml index 1bdc051bc..87c1bd83c 100644 --- a/.github/workflows/update-Dockerfiles.yml +++ b/.github/workflows/update-Dockerfiles.yml @@ -1,7 +1,7 @@ name: Update Lambda Dockerfiles permissions: - contents: read + contents: write pull-requests: write on: From 1263f4b5ef0a9c7025d9405bc8a2e78bf358259a Mon Sep 17 00:00:00 2001 From: Garrett Beatty Date: Tue, 15 Jul 2025 20:56:40 -0400 Subject: [PATCH 12/19] temp branch update --- .github/workflows/auto-update-Dockerfiles.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/auto-update-Dockerfiles.yml b/.github/workflows/auto-update-Dockerfiles.yml index abc0472d6..f7331f976 100644 --- a/.github/workflows/auto-update-Dockerfiles.yml +++ b/.github/workflows/auto-update-Dockerfiles.yml @@ -28,7 +28,7 @@ jobs: # Checks-out the repository under $GITHUB_WORKSPACE - uses: actions/checkout@85e6279cec87321a52edac9c87bce653a07cf6c2 #v4.2.2 with: - ref: 'dev' + ref: 'gcbeatty/runtime2' # Determine the latest ASP.NET Core versions for all .NET versions - name: Determine Latest ASP.NET Core Versions From 733c4691dd3216b30a365aab5e1debf6d571eb0b Mon Sep 17 00:00:00 2001 From: Garrett Beatty Date: Tue, 15 Jul 2025 20:58:04 -0400 Subject: [PATCH 13/19] temp branch update --- .github/workflows/auto-update-Dockerfiles.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/auto-update-Dockerfiles.yml b/.github/workflows/auto-update-Dockerfiles.yml index f7331f976..abc0472d6 100644 --- a/.github/workflows/auto-update-Dockerfiles.yml +++ b/.github/workflows/auto-update-Dockerfiles.yml @@ -28,7 +28,7 @@ jobs: # Checks-out the repository under $GITHUB_WORKSPACE - uses: actions/checkout@85e6279cec87321a52edac9c87bce653a07cf6c2 #v4.2.2 with: - ref: 'gcbeatty/runtime2' + ref: 'dev' # Determine the latest ASP.NET Core versions for all .NET versions - name: Determine Latest ASP.NET Core Versions From 3e36ac20bd5f19f0ac26a223849d2a0d41ec3eba Mon Sep 17 00:00:00 2001 From: Garrett Beatty Date: Thu, 28 Aug 2025 15:39:07 -0400 Subject: [PATCH 14/19] PR comments --- .github/workflows/auto-update-Dockerfiles.yml | 77 +++++++++---------- .../get-latest-aspnet-versions.ps1 | 38 ++++----- 2 files changed, 50 insertions(+), 65 deletions(-) diff --git a/.github/workflows/auto-update-Dockerfiles.yml b/.github/workflows/auto-update-Dockerfiles.yml index abc0472d6..a97268bb3 100644 --- a/.github/workflows/auto-update-Dockerfiles.yml +++ b/.github/workflows/auto-update-Dockerfiles.yml @@ -1,13 +1,13 @@ -name: Auto-Update Lambda Dockerfiles Monthly +name: Auto-Update Lambda Dockerfiles Daily permissions: contents: write pull-requests: write on: - # Run monthly on the 1st day of each month at midnight UTC + # Run daily at midnight UTC schedule: - - cron: '0 0 1 * *' + - cron: '0 0 * * *' # Allows to run this workflow manually from the Actions tab for testing workflow_dispatch: @@ -30,29 +30,16 @@ jobs: with: ref: 'dev' - # Determine the latest ASP.NET Core versions for all .NET versions - - name: Determine Latest ASP.NET Core Versions - id: get-versions - shell: pwsh - run: | - $versions = .\LambdaRuntimeDockerfiles\get-latest-aspnet-versions.ps1 - foreach ($line in $versions) { - if ($line -match '(.+)=(.+)') { - echo "$($matches[1])=$($matches[2])" >> $env:GITHUB_OUTPUT - echo "Using $($matches[1])=$($matches[2])" - } - } - # Update .NET 8 AMD64 Dockerfile - name: Update .NET 8 AMD64 id: update-net8-amd64 shell: pwsh env: DOCKERFILE_PATH: ${{ env.NET_8_AMD64_Dockerfile }} - NEXT_VERSION: ${{ steps.get-versions.outputs.NET_8_NEXT_VERSION }} run: | - if (-not [string]::IsNullOrEmpty("${{ env.NEXT_VERSION }}")) { - .\LambdaRuntimeDockerfiles\update-dockerfile.ps1 -DockerfilePath "${{ env.DOCKERFILE_PATH }}" -NextVersion "${{ env.NEXT_VERSION }}" + $version = .\LambdaRuntimeDockerfiles\get-latest-aspnet-versions.ps1 -MajorVersion "8" + if (-not [string]::IsNullOrEmpty($version)) { + .\LambdaRuntimeDockerfiles\update-dockerfile.ps1 -DockerfilePath "${{ env.DOCKERFILE_PATH }}" -NextVersion $version } else { Write-Host "Skipping .NET 8 AMD64 update - No version detected" } @@ -63,10 +50,10 @@ jobs: shell: pwsh env: DOCKERFILE_PATH: ${{ env.NET_8_ARM64_Dockerfile }} - NEXT_VERSION: ${{ steps.get-versions.outputs.NET_8_NEXT_VERSION }} run: | - if (-not [string]::IsNullOrEmpty("${{ env.NEXT_VERSION }}")) { - .\LambdaRuntimeDockerfiles\update-dockerfile.ps1 -DockerfilePath "${{ env.DOCKERFILE_PATH }}" -NextVersion "${{ env.NEXT_VERSION }}" + $version = .\LambdaRuntimeDockerfiles\get-latest-aspnet-versions.ps1 -MajorVersion "8" + if (-not [string]::IsNullOrEmpty($version)) { + .\LambdaRuntimeDockerfiles\update-dockerfile.ps1 -DockerfilePath "${{ env.DOCKERFILE_PATH }}" -NextVersion $version } else { Write-Host "Skipping .NET 8 ARM64 update - No version detected" } @@ -77,10 +64,10 @@ jobs: shell: pwsh env: DOCKERFILE_PATH: ${{ env.NET_9_AMD64_Dockerfile }} - NEXT_VERSION: ${{ steps.get-versions.outputs.NET_9_NEXT_VERSION }} run: | - if (-not [string]::IsNullOrEmpty("${{ env.NEXT_VERSION }}")) { - .\LambdaRuntimeDockerfiles\update-dockerfile.ps1 -DockerfilePath "${{ env.DOCKERFILE_PATH }}" -NextVersion "${{ env.NEXT_VERSION }}" + $version = .\LambdaRuntimeDockerfiles\get-latest-aspnet-versions.ps1 -MajorVersion "9" + if (-not [string]::IsNullOrEmpty($version)) { + .\LambdaRuntimeDockerfiles\update-dockerfile.ps1 -DockerfilePath "${{ env.DOCKERFILE_PATH }}" -NextVersion $version } else { Write-Host "Skipping .NET 9 AMD64 update - No version detected" } @@ -91,10 +78,10 @@ jobs: shell: pwsh env: DOCKERFILE_PATH: ${{ env.NET_9_ARM64_Dockerfile }} - NEXT_VERSION: ${{ steps.get-versions.outputs.NET_9_NEXT_VERSION }} run: | - if (-not [string]::IsNullOrEmpty("${{ env.NEXT_VERSION }}")) { - .\LambdaRuntimeDockerfiles\update-dockerfile.ps1 -DockerfilePath "${{ env.DOCKERFILE_PATH }}" -NextVersion "${{ env.NEXT_VERSION }}" + $version = .\LambdaRuntimeDockerfiles\get-latest-aspnet-versions.ps1 -MajorVersion "9" + if (-not [string]::IsNullOrEmpty($version)) { + .\LambdaRuntimeDockerfiles\update-dockerfile.ps1 -DockerfilePath "${{ env.DOCKERFILE_PATH }}" -NextVersion $version } else { Write-Host "Skipping .NET 9 ARM64 update - No version detected" } @@ -105,10 +92,10 @@ jobs: shell: pwsh env: DOCKERFILE_PATH: ${{ env.NET_10_AMD64_Dockerfile }} - NEXT_VERSION: ${{ steps.get-versions.outputs.NET_10_NEXT_VERSION }} run: | - if (-not [string]::IsNullOrEmpty("${{ env.NEXT_VERSION }}")) { - .\LambdaRuntimeDockerfiles\update-dockerfile.ps1 -DockerfilePath "${{ env.DOCKERFILE_PATH }}" -NextVersion "${{ env.NEXT_VERSION }}" + $version = .\LambdaRuntimeDockerfiles\get-latest-aspnet-versions.ps1 -MajorVersion "10" + if (-not [string]::IsNullOrEmpty($version)) { + .\LambdaRuntimeDockerfiles\update-dockerfile.ps1 -DockerfilePath "${{ env.DOCKERFILE_PATH }}" -NextVersion $version } else { Write-Host "Skipping .NET 10 AMD64 update - No version detected" } @@ -119,10 +106,10 @@ jobs: shell: pwsh env: DOCKERFILE_PATH: ${{ env.NET_10_ARM64_Dockerfile }} - NEXT_VERSION: ${{ steps.get-versions.outputs.NET_10_NEXT_VERSION }} run: | - if (-not [string]::IsNullOrEmpty("${{ env.NEXT_VERSION }}")) { - .\LambdaRuntimeDockerfiles\update-dockerfile.ps1 -DockerfilePath "${{ env.DOCKERFILE_PATH }}" -NextVersion "${{ env.NEXT_VERSION }}" + $version = .\LambdaRuntimeDockerfiles\get-latest-aspnet-versions.ps1 -MajorVersion "10" + if (-not [string]::IsNullOrEmpty($version)) { + .\LambdaRuntimeDockerfiles\update-dockerfile.ps1 -DockerfilePath "${{ env.DOCKERFILE_PATH }}" -NextVersion $version } else { Write-Host "Skipping .NET 10 ARM64 update - No version detected" } @@ -136,12 +123,22 @@ jobs: if (git status --porcelain) { git config --global user.email "github-aws-sdk-dotnet-automation@amazon.com" git config --global user.name "aws-sdk-dotnet-automation" - $suffix=Get-Date -Format yyyy-MM-dd - $branch="chore/auto-update-Dockerfiles-${suffix}" - git checkout -b $branch + $branch="chore/auto-update-Dockerfiles-daily" + + # Check if the branch already exists remotely + $branchExists = git ls-remote --heads origin $branch + if ($branchExists) { + # Branch exists, check it out and update it + git fetch origin $branch + git checkout -B $branch origin/$branch + } else { + # Branch doesn't exist, create it + git checkout -b $branch + } + git add "**/*Dockerfile" - git commit -m "chore: Monthly ASP.NET Core version update in Dockerfiles" - git push origin $branch + git commit -m "chore: Daily ASP.NET Core version update in Dockerfiles" + git push --force-with-lease origin $branch # Write the branch name to GITHUB_OUTPUT for use in the PR step Add-Content -Path $env:GITHUB_OUTPUT -Value "BRANCH=$branch" @@ -159,7 +156,7 @@ jobs: with: source_branch: ${{ steps.commit-push.outputs.BRANCH }} destination_branch: "dev" - pr_title: 'chore: Monthly ASP.NET Core version update in Dockerfiles' + pr_title: 'chore: Daily ASP.NET Core version update in Dockerfiles' pr_body: "This PR automatically updates the Dockerfiles to use the latest ASP.NET Core version. Verify that the Dockerfiles have correct versions and matching SHA512 checksums for ASP.NET Core runtime. diff --git a/LambdaRuntimeDockerfiles/get-latest-aspnet-versions.ps1 b/LambdaRuntimeDockerfiles/get-latest-aspnet-versions.ps1 index d233c222a..fd2a889a7 100644 --- a/LambdaRuntimeDockerfiles/get-latest-aspnet-versions.ps1 +++ b/LambdaRuntimeDockerfiles/get-latest-aspnet-versions.ps1 @@ -1,6 +1,11 @@ -# This script fetches the latest ASP.NET Core runtime versions for .NET 8, 9, and 10 +# This script fetches the latest ASP.NET Core runtime version for a specified .NET major version # It uses the NuGet API to query for Microsoft.AspNetCore.App.Runtime.linux-x64 package versions +param( + [Parameter(Mandatory=$true)] + [string]$MajorVersion +) + function Get-LatestAspNetVersion { param ( [string]$majorVersion @@ -117,31 +122,14 @@ function Get-LatestAspNetVersion { } } -# Get latest versions for each .NET version -$net8Version = Get-LatestAspNetVersion -majorVersion "8" -$net9Version = Get-LatestAspNetVersion -majorVersion "9" -$net10Version = Get-LatestAspNetVersion -majorVersion "10" - -# Verify we got valid versions -$allVersionsValid = $true -if (-not $net8Version) { - Write-Error "Failed to determine .NET 8 version" - $allVersionsValid = $false -} -if (-not $net9Version) { - Write-Error "Failed to determine .NET 9 version" - $allVersionsValid = $false -} -if (-not $net10Version) { - Write-Error "Failed to determine .NET 10 version" - $allVersionsValid = $false -} +# Get latest version for the specified .NET major version +$version = Get-LatestAspNetVersion -majorVersion $MajorVersion -if (-not $allVersionsValid) { +# Verify we got a valid version +if (-not $version) { + Write-Error "Failed to determine .NET $MajorVersion version" exit 1 } -# Output as GitHub Actions environment variables -Write-Output "NET_8_NEXT_VERSION=$net8Version" -Write-Output "NET_9_NEXT_VERSION=$net9Version" -Write-Output "NET_10_NEXT_VERSION=$net10Version" +# Output the version directly +Write-Output $version From 2d2787e0a7d2515d1cdee182a7dfff74d8161727 Mon Sep 17 00:00:00 2001 From: Garrett Beatty Date: Thu, 28 Aug 2025 15:44:13 -0400 Subject: [PATCH 15/19] fix pathing --- .github/workflows/auto-update-Dockerfiles.yml | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/auto-update-Dockerfiles.yml b/.github/workflows/auto-update-Dockerfiles.yml index a97268bb3..5b1661987 100644 --- a/.github/workflows/auto-update-Dockerfiles.yml +++ b/.github/workflows/auto-update-Dockerfiles.yml @@ -37,9 +37,9 @@ jobs: env: DOCKERFILE_PATH: ${{ env.NET_8_AMD64_Dockerfile }} run: | - $version = .\LambdaRuntimeDockerfiles\get-latest-aspnet-versions.ps1 -MajorVersion "8" + $version = ./LambdaRuntimeDockerfiles/get-latest-aspnet-versions.ps1 -MajorVersion "8" if (-not [string]::IsNullOrEmpty($version)) { - .\LambdaRuntimeDockerfiles\update-dockerfile.ps1 -DockerfilePath "${{ env.DOCKERFILE_PATH }}" -NextVersion $version + ./LambdaRuntimeDockerfiles/update-dockerfile.ps1 -DockerfilePath "${{ env.DOCKERFILE_PATH }}" -NextVersion $version } else { Write-Host "Skipping .NET 8 AMD64 update - No version detected" } @@ -51,9 +51,9 @@ jobs: env: DOCKERFILE_PATH: ${{ env.NET_8_ARM64_Dockerfile }} run: | - $version = .\LambdaRuntimeDockerfiles\get-latest-aspnet-versions.ps1 -MajorVersion "8" + $version = ./LambdaRuntimeDockerfiles/get-latest-aspnet-versions.ps1 -MajorVersion "8" if (-not [string]::IsNullOrEmpty($version)) { - .\LambdaRuntimeDockerfiles\update-dockerfile.ps1 -DockerfilePath "${{ env.DOCKERFILE_PATH }}" -NextVersion $version + ./LambdaRuntimeDockerfiles/update-dockerfile.ps1 -DockerfilePath "${{ env.DOCKERFILE_PATH }}" -NextVersion $version } else { Write-Host "Skipping .NET 8 ARM64 update - No version detected" } @@ -65,9 +65,9 @@ jobs: env: DOCKERFILE_PATH: ${{ env.NET_9_AMD64_Dockerfile }} run: | - $version = .\LambdaRuntimeDockerfiles\get-latest-aspnet-versions.ps1 -MajorVersion "9" + $version = ./LambdaRuntimeDockerfiles/get-latest-aspnet-versions.ps1 -MajorVersion "9" if (-not [string]::IsNullOrEmpty($version)) { - .\LambdaRuntimeDockerfiles\update-dockerfile.ps1 -DockerfilePath "${{ env.DOCKERFILE_PATH }}" -NextVersion $version + ./LambdaRuntimeDockerfiles/update-dockerfile.ps1 -DockerfilePath "${{ env.DOCKERFILE_PATH }}" -NextVersion $version } else { Write-Host "Skipping .NET 9 AMD64 update - No version detected" } @@ -79,9 +79,9 @@ jobs: env: DOCKERFILE_PATH: ${{ env.NET_9_ARM64_Dockerfile }} run: | - $version = .\LambdaRuntimeDockerfiles\get-latest-aspnet-versions.ps1 -MajorVersion "9" + $version = ./LambdaRuntimeDockerfiles/get-latest-aspnet-versions.ps1 -MajorVersion "9" if (-not [string]::IsNullOrEmpty($version)) { - .\LambdaRuntimeDockerfiles\update-dockerfile.ps1 -DockerfilePath "${{ env.DOCKERFILE_PATH }}" -NextVersion $version + ./LambdaRuntimeDockerfiles/update-dockerfile.ps1 -DockerfilePath "${{ env.DOCKERFILE_PATH }}" -NextVersion $version } else { Write-Host "Skipping .NET 9 ARM64 update - No version detected" } @@ -93,9 +93,9 @@ jobs: env: DOCKERFILE_PATH: ${{ env.NET_10_AMD64_Dockerfile }} run: | - $version = .\LambdaRuntimeDockerfiles\get-latest-aspnet-versions.ps1 -MajorVersion "10" + $version = ./LambdaRuntimeDockerfiles/get-latest-aspnet-versions.ps1 -MajorVersion "10" if (-not [string]::IsNullOrEmpty($version)) { - .\LambdaRuntimeDockerfiles\update-dockerfile.ps1 -DockerfilePath "${{ env.DOCKERFILE_PATH }}" -NextVersion $version + ./LambdaRuntimeDockerfiles/update-dockerfile.ps1 -DockerfilePath "${{ env.DOCKERFILE_PATH }}" -NextVersion $version } else { Write-Host "Skipping .NET 10 AMD64 update - No version detected" } @@ -107,9 +107,9 @@ jobs: env: DOCKERFILE_PATH: ${{ env.NET_10_ARM64_Dockerfile }} run: | - $version = .\LambdaRuntimeDockerfiles\get-latest-aspnet-versions.ps1 -MajorVersion "10" + $version = ./LambdaRuntimeDockerfiles/get-latest-aspnet-versions.ps1 -MajorVersion "10" if (-not [string]::IsNullOrEmpty($version)) { - .\LambdaRuntimeDockerfiles\update-dockerfile.ps1 -DockerfilePath "${{ env.DOCKERFILE_PATH }}" -NextVersion $version + ./LambdaRuntimeDockerfiles/update-dockerfile.ps1 -DockerfilePath "${{ env.DOCKERFILE_PATH }}" -NextVersion $version } else { Write-Host "Skipping .NET 10 ARM64 update - No version detected" } From ac67228846b9a885b5955a662b931308f94adf29 Mon Sep 17 00:00:00 2001 From: Garrett Beatty Date: Thu, 28 Aug 2025 15:48:46 -0400 Subject: [PATCH 16/19] fix pathing --- .github/workflows/auto-update-Dockerfiles.yml | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/auto-update-Dockerfiles.yml b/.github/workflows/auto-update-Dockerfiles.yml index 5b1661987..43adc2259 100644 --- a/.github/workflows/auto-update-Dockerfiles.yml +++ b/.github/workflows/auto-update-Dockerfiles.yml @@ -37,9 +37,9 @@ jobs: env: DOCKERFILE_PATH: ${{ env.NET_8_AMD64_Dockerfile }} run: | - $version = ./LambdaRuntimeDockerfiles/get-latest-aspnet-versions.ps1 -MajorVersion "8" + $version = & "./LambdaRuntimeDockerfiles/get-latest-aspnet-versions.ps1" -MajorVersion "8" if (-not [string]::IsNullOrEmpty($version)) { - ./LambdaRuntimeDockerfiles/update-dockerfile.ps1 -DockerfilePath "${{ env.DOCKERFILE_PATH }}" -NextVersion $version + & "./LambdaRuntimeDockerfiles/update-dockerfile.ps1" -DockerfilePath "${{ env.DOCKERFILE_PATH }}" -NextVersion $version } else { Write-Host "Skipping .NET 8 AMD64 update - No version detected" } @@ -51,9 +51,9 @@ jobs: env: DOCKERFILE_PATH: ${{ env.NET_8_ARM64_Dockerfile }} run: | - $version = ./LambdaRuntimeDockerfiles/get-latest-aspnet-versions.ps1 -MajorVersion "8" + $version = & "./LambdaRuntimeDockerfiles/get-latest-aspnet-versions.ps1" -MajorVersion "8" if (-not [string]::IsNullOrEmpty($version)) { - ./LambdaRuntimeDockerfiles/update-dockerfile.ps1 -DockerfilePath "${{ env.DOCKERFILE_PATH }}" -NextVersion $version + & "./LambdaRuntimeDockerfiles/update-dockerfile.ps1" -DockerfilePath "${{ env.DOCKERFILE_PATH }}" -NextVersion $version } else { Write-Host "Skipping .NET 8 ARM64 update - No version detected" } @@ -65,9 +65,9 @@ jobs: env: DOCKERFILE_PATH: ${{ env.NET_9_AMD64_Dockerfile }} run: | - $version = ./LambdaRuntimeDockerfiles/get-latest-aspnet-versions.ps1 -MajorVersion "9" + $version = & "./LambdaRuntimeDockerfiles/get-latest-aspnet-versions.ps1" -MajorVersion "9" if (-not [string]::IsNullOrEmpty($version)) { - ./LambdaRuntimeDockerfiles/update-dockerfile.ps1 -DockerfilePath "${{ env.DOCKERFILE_PATH }}" -NextVersion $version + & "./LambdaRuntimeDockerfiles/update-dockerfile.ps1" -DockerfilePath "${{ env.DOCKERFILE_PATH }}" -NextVersion $version } else { Write-Host "Skipping .NET 9 AMD64 update - No version detected" } @@ -79,9 +79,9 @@ jobs: env: DOCKERFILE_PATH: ${{ env.NET_9_ARM64_Dockerfile }} run: | - $version = ./LambdaRuntimeDockerfiles/get-latest-aspnet-versions.ps1 -MajorVersion "9" + $version = & "./LambdaRuntimeDockerfiles/get-latest-aspnet-versions.ps1" -MajorVersion "9" if (-not [string]::IsNullOrEmpty($version)) { - ./LambdaRuntimeDockerfiles/update-dockerfile.ps1 -DockerfilePath "${{ env.DOCKERFILE_PATH }}" -NextVersion $version + & "./LambdaRuntimeDockerfiles/update-dockerfile.ps1" -DockerfilePath "${{ env.DOCKERFILE_PATH }}" -NextVersion $version } else { Write-Host "Skipping .NET 9 ARM64 update - No version detected" } @@ -93,9 +93,9 @@ jobs: env: DOCKERFILE_PATH: ${{ env.NET_10_AMD64_Dockerfile }} run: | - $version = ./LambdaRuntimeDockerfiles/get-latest-aspnet-versions.ps1 -MajorVersion "10" + $version = & "./LambdaRuntimeDockerfiles/get-latest-aspnet-versions.ps1" -MajorVersion "10" if (-not [string]::IsNullOrEmpty($version)) { - ./LambdaRuntimeDockerfiles/update-dockerfile.ps1 -DockerfilePath "${{ env.DOCKERFILE_PATH }}" -NextVersion $version + & "./LambdaRuntimeDockerfiles/update-dockerfile.ps1" -DockerfilePath "${{ env.DOCKERFILE_PATH }}" -NextVersion $version } else { Write-Host "Skipping .NET 10 AMD64 update - No version detected" } @@ -107,9 +107,9 @@ jobs: env: DOCKERFILE_PATH: ${{ env.NET_10_ARM64_Dockerfile }} run: | - $version = ./LambdaRuntimeDockerfiles/get-latest-aspnet-versions.ps1 -MajorVersion "10" + $version = & "./LambdaRuntimeDockerfiles/get-latest-aspnet-versions.ps1" -MajorVersion "10" if (-not [string]::IsNullOrEmpty($version)) { - ./LambdaRuntimeDockerfiles/update-dockerfile.ps1 -DockerfilePath "${{ env.DOCKERFILE_PATH }}" -NextVersion $version + & "./LambdaRuntimeDockerfiles/update-dockerfile.ps1" -DockerfilePath "${{ env.DOCKERFILE_PATH }}" -NextVersion $version } else { Write-Host "Skipping .NET 10 ARM64 update - No version detected" } From b801be5ec353b59fbfa6991ac62966c891a89e8d Mon Sep 17 00:00:00 2001 From: Garrett Beatty Date: Thu, 28 Aug 2025 15:53:36 -0400 Subject: [PATCH 17/19] add logs --- .github/workflows/auto-update-Dockerfiles.yml | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/.github/workflows/auto-update-Dockerfiles.yml b/.github/workflows/auto-update-Dockerfiles.yml index 43adc2259..f84fd273e 100644 --- a/.github/workflows/auto-update-Dockerfiles.yml +++ b/.github/workflows/auto-update-Dockerfiles.yml @@ -30,6 +30,35 @@ jobs: with: ref: 'dev' + # Debug: Check current directory and file structure + - name: Debug - Check paths and files + shell: pwsh + run: | + Write-Host "=== DEBUGGING INFORMATION ===" + Write-Host "Current working directory: $(Get-Location)" + Write-Host "PWD variable: $PWD" + Write-Host "" + Write-Host "Files in current directory:" + Get-ChildItem -Name | Sort-Object + Write-Host "" + Write-Host "Checking for LambdaRuntimeDockerfiles directory:" + if (Test-Path "LambdaRuntimeDockerfiles") { + Write-Host "✓ LambdaRuntimeDockerfiles directory exists" + Write-Host "Contents of LambdaRuntimeDockerfiles:" + Get-ChildItem "LambdaRuntimeDockerfiles" -Name | Sort-Object + Write-Host "" + Write-Host "Checking for get-latest-aspnet-versions.ps1:" + if (Test-Path "LambdaRuntimeDockerfiles/get-latest-aspnet-versions.ps1") { + Write-Host "✓ get-latest-aspnet-versions.ps1 exists" + Write-Host "Full path: $(Resolve-Path 'LambdaRuntimeDockerfiles/get-latest-aspnet-versions.ps1')" + } else { + Write-Host "✗ get-latest-aspnet-versions.ps1 NOT FOUND" + } + } else { + Write-Host "✗ LambdaRuntimeDockerfiles directory NOT FOUND" + } + Write-Host "=== END DEBUGGING ===" + # Update .NET 8 AMD64 Dockerfile - name: Update .NET 8 AMD64 id: update-net8-amd64 From deaa0dccbe58b008959bf483ffb8511da10b3346 Mon Sep 17 00:00:00 2001 From: Garrett Beatty Date: Thu, 28 Aug 2025 15:56:57 -0400 Subject: [PATCH 18/19] testing --- .github/workflows/auto-update-Dockerfiles.yml | 32 ++----------------- 1 file changed, 2 insertions(+), 30 deletions(-) diff --git a/.github/workflows/auto-update-Dockerfiles.yml b/.github/workflows/auto-update-Dockerfiles.yml index f84fd273e..6d890287f 100644 --- a/.github/workflows/auto-update-Dockerfiles.yml +++ b/.github/workflows/auto-update-Dockerfiles.yml @@ -28,37 +28,9 @@ jobs: # Checks-out the repository under $GITHUB_WORKSPACE - uses: actions/checkout@85e6279cec87321a52edac9c87bce653a07cf6c2 #v4.2.2 with: - ref: 'dev' - - # Debug: Check current directory and file structure - - name: Debug - Check paths and files - shell: pwsh - run: | - Write-Host "=== DEBUGGING INFORMATION ===" - Write-Host "Current working directory: $(Get-Location)" - Write-Host "PWD variable: $PWD" - Write-Host "" - Write-Host "Files in current directory:" - Get-ChildItem -Name | Sort-Object - Write-Host "" - Write-Host "Checking for LambdaRuntimeDockerfiles directory:" - if (Test-Path "LambdaRuntimeDockerfiles") { - Write-Host "✓ LambdaRuntimeDockerfiles directory exists" - Write-Host "Contents of LambdaRuntimeDockerfiles:" - Get-ChildItem "LambdaRuntimeDockerfiles" -Name | Sort-Object - Write-Host "" - Write-Host "Checking for get-latest-aspnet-versions.ps1:" - if (Test-Path "LambdaRuntimeDockerfiles/get-latest-aspnet-versions.ps1") { - Write-Host "✓ get-latest-aspnet-versions.ps1 exists" - Write-Host "Full path: $(Resolve-Path 'LambdaRuntimeDockerfiles/get-latest-aspnet-versions.ps1')" - } else { - Write-Host "✗ get-latest-aspnet-versions.ps1 NOT FOUND" - } - } else { - Write-Host "✗ LambdaRuntimeDockerfiles directory NOT FOUND" - } - Write-Host "=== END DEBUGGING ===" + ref: 'gcbeatty/runtime2' + # Update .NET 8 AMD64 Dockerfile - name: Update .NET 8 AMD64 id: update-net8-amd64 From 90f61bb1ba1615efacac2102d40a904226027dcd Mon Sep 17 00:00:00 2001 From: aws-sdk-dotnet-automation Date: Thu, 28 Aug 2025 19:57:36 +0000 Subject: [PATCH 19/19] chore: Daily ASP.NET Core version update in Dockerfiles --- LambdaRuntimeDockerfiles/Images/net10/amd64/Dockerfile | 4 ++-- LambdaRuntimeDockerfiles/Images/net10/arm64/Dockerfile | 4 ++-- LambdaRuntimeDockerfiles/Images/net8/amd64/Dockerfile | 4 ++-- LambdaRuntimeDockerfiles/Images/net8/arm64/Dockerfile | 4 ++-- LambdaRuntimeDockerfiles/Images/net9/amd64/Dockerfile | 4 ++-- LambdaRuntimeDockerfiles/Images/net9/arm64/Dockerfile | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/LambdaRuntimeDockerfiles/Images/net10/amd64/Dockerfile b/LambdaRuntimeDockerfiles/Images/net10/amd64/Dockerfile index 897d97f88..1c9cb5285 100644 --- a/LambdaRuntimeDockerfiles/Images/net10/amd64/Dockerfile +++ b/LambdaRuntimeDockerfiles/Images/net10/amd64/Dockerfile @@ -1,7 +1,7 @@ # Based on Docker image from: https://github.com/dotnet/dotnet-docker/ -ARG ASPNET_VERSION=10.0.0-preview.5.25277.114 -ARG ASPNET_SHA512=6E69A85F7E18B8EEBB5F99A7E8099DB2FA5DA34BCF078BECBB123C0863D4BE7B4252C7CFC6B21B9585F4F800C058A12CAE55EF2A63B9BEA886CA3D1D8A0EC113 +ARG ASPNET_VERSION=10.0.0-preview.7.25380.108 +ARG ASPNET_SHA512=f689f386f7fa56b9b53bd7d510abecf2b9c22358fb29367846c23fbba7b0a61a47d86dbceef96b73a728af076e55c346838497402e0cd80b8695d9dc1ea3c2b9 ARG LAMBDA_RUNTIME_NAME=dotnet10 ARG AMAZON_LINUX=public.ecr.aws/lambda/provided:al2023 diff --git a/LambdaRuntimeDockerfiles/Images/net10/arm64/Dockerfile b/LambdaRuntimeDockerfiles/Images/net10/arm64/Dockerfile index 846536c84..d77328fd3 100644 --- a/LambdaRuntimeDockerfiles/Images/net10/arm64/Dockerfile +++ b/LambdaRuntimeDockerfiles/Images/net10/arm64/Dockerfile @@ -1,7 +1,7 @@ # Based on Docker image from: https://github.com/dotnet/dotnet-docker/ -ARG ASPNET_VERSION=10.0.0-preview.5.25277.114 -ARG ASPNET_SHA512=AC99EBEC4E7ABD660A27317D37DA56AE1FA8E9EBDBF4A88FE5F9BE58E1F4D7E8F05BEC32D5E902C0FDD1E9D9E250CDB49448266682010E4CF7F4640F9699B9F1 +ARG ASPNET_VERSION=10.0.0-preview.7.25380.108 +ARG ASPNET_SHA512=81358ed46adffd1a4e2e095e3d23d67d1d289a6c4c50ab20e1e71161b2823c8c44dd5a6c241ac9b3fcd4a2af518dbffbccdb7b3acd07a42af9ff24c5fd62c6a3 ARG LAMBDA_RUNTIME_NAME=dotnet10 ARG AMAZON_LINUX=public.ecr.aws/lambda/provided:al2023 diff --git a/LambdaRuntimeDockerfiles/Images/net8/amd64/Dockerfile b/LambdaRuntimeDockerfiles/Images/net8/amd64/Dockerfile index 1690f3200..c731f586f 100644 --- a/LambdaRuntimeDockerfiles/Images/net8/amd64/Dockerfile +++ b/LambdaRuntimeDockerfiles/Images/net8/amd64/Dockerfile @@ -1,7 +1,7 @@ # Based on Docker image from: https://github.com/dotnet/dotnet-docker/ -ARG ASPNET_VERSION=8.0.18 -ARG ASPNET_SHA512=896e9cab7c3ea5384c174e7e2cffae3c7f8f9ed5d6d2b7434b5a2b0dc3f02b611ff8668f5d70c0b356a6a5d85a28fe40756cf356b168d0306370da11646b4b23 +ARG ASPNET_VERSION=8.0.19 +ARG ASPNET_SHA512=9503fe84627716cb9df02c648e34971c6ec4d44686f213bc6f6bd74bc54ffb41ef272fbd2c8aa3f0a309b20664796c12f9c77b137015f84581ac265af2f21687 ARG LAMBDA_RUNTIME_NAME=dotnet8 ARG AMAZON_LINUX=public.ecr.aws/lambda/provided:al2023 diff --git a/LambdaRuntimeDockerfiles/Images/net8/arm64/Dockerfile b/LambdaRuntimeDockerfiles/Images/net8/arm64/Dockerfile index a22262ccd..6d1d8023c 100644 --- a/LambdaRuntimeDockerfiles/Images/net8/arm64/Dockerfile +++ b/LambdaRuntimeDockerfiles/Images/net8/arm64/Dockerfile @@ -1,7 +1,7 @@ # Based on Docker image from: https://github.com/dotnet/dotnet-docker/ -ARG ASPNET_VERSION=8.0.18 -ARG ASPNET_SHA512=997ce36180503fbd4dd86ed43b533f618be1db7cf170f500d0d12f899adff22e5b7714942aa2513eece6c12224761c143fbc91d6e97d83cccaed8a811ebcd835 +ARG ASPNET_VERSION=8.0.19 +ARG ASPNET_SHA512=cc14503e5c1d94a333fd8048f628760f6df2b2acd4e0d5ef465cbbfcc13517753d6fd5b1d5fe4b38b07704418a713e1338005453a7cbb8fb3f300760d00fc6e6 ARG LAMBDA_RUNTIME_NAME=dotnet8 ARG AMAZON_LINUX=public.ecr.aws/lambda/provided:al2023 diff --git a/LambdaRuntimeDockerfiles/Images/net9/amd64/Dockerfile b/LambdaRuntimeDockerfiles/Images/net9/amd64/Dockerfile index 63ede4b5b..4dc041c6b 100644 --- a/LambdaRuntimeDockerfiles/Images/net9/amd64/Dockerfile +++ b/LambdaRuntimeDockerfiles/Images/net9/amd64/Dockerfile @@ -1,7 +1,7 @@ # Based on Docker image from: https://github.com/dotnet/dotnet-docker/ -ARG ASPNET_VERSION=9.0.6 -ARG ASPNET_SHA512=54c122c4c6127ce7e0f0ad0479a101db1455484c9e5bffa8fdc0dd72d2db028be86861f331f2c7c1cb2eaee9a92e741e4e5da567795533e46af27e4e481c0451 +ARG ASPNET_VERSION=9.0.8 +ARG ASPNET_SHA512=08afdf924d00f875b44cc4eff68b55fb9b63e4cc68e6b5cde873da2bce9c5b5f4120e869b6a1dfdea4ab104ab0ac8783ef1577b4d3275aae899a53cd88130f1d ARG LAMBDA_RUNTIME_NAME=dotnet9 ARG AMAZON_LINUX=public.ecr.aws/lambda/provided:al2023 diff --git a/LambdaRuntimeDockerfiles/Images/net9/arm64/Dockerfile b/LambdaRuntimeDockerfiles/Images/net9/arm64/Dockerfile index 2d9630e83..28edaff80 100644 --- a/LambdaRuntimeDockerfiles/Images/net9/arm64/Dockerfile +++ b/LambdaRuntimeDockerfiles/Images/net9/arm64/Dockerfile @@ -1,7 +1,7 @@ # Based on Docker image from: https://github.com/dotnet/dotnet-docker/ -ARG ASPNET_VERSION=9.0.6 -ARG ASPNET_SHA512=8a7024bd144254f400c0758efd5c39854eba5d7e3187fbde2dc857cedd9012ae93aceeb1683bf6bf390cefba40c50f95cc3295a1a8eb83133a8e01b91289dfc5 +ARG ASPNET_VERSION=9.0.8 +ARG ASPNET_SHA512=cf1e72f4b327b93c1ac3f2def9ca83bee27a408e5b5913f84ed954cfd6c4639da1664fe3f4e3925883db77ed29fa5364b9ca8af3796f33ca73a4cb7484e326bc ARG LAMBDA_RUNTIME_NAME=dotnet9 ARG AMAZON_LINUX=public.ecr.aws/lambda/provided:al2023