Skip to content

chore: Monthly ASP.NET Core version update in Dockerfiles #2114

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

Closed
wants to merge 13 commits into from
Closed
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
195 changes: 195 additions & 0 deletions .github/workflows/auto-update-Dockerfiles.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,195 @@
name: Auto-Update Lambda Dockerfiles Monthly

permissions:
contents: write
pull-requests: write

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: 'gcbeatty/runtime2'

# 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 "[email protected]"
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 }}

# 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']
})
31 changes: 24 additions & 7 deletions .github/workflows/update-Dockerfiles.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
name: Update Lambda Dockerfiles

permissions:
contents: write
pull-requests: write

on:
# Allows to run this workflow manually from the Actions tab
workflow_dispatch:
Expand All @@ -8,12 +12,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
Expand All @@ -22,12 +26,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
Expand All @@ -36,12 +40,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
Expand Down Expand Up @@ -165,4 +169,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']
})
4 changes: 2 additions & 2 deletions LambdaRuntimeDockerfiles/Images/net10/amd64/Dockerfile
Original file line number Diff line number Diff line change
@@ -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.6.25358.103
ARG ASPNET_SHA512=15ccea434f5e33b4af872bda00d30d3fee4494113a1e5d7b1e8ce206ab0a2e09384fa5a223afdde4b94ea3b7e12b796c1a45138be833288bd68741ae843fb6c8

ARG LAMBDA_RUNTIME_NAME=dotnet10
ARG AMAZON_LINUX=public.ecr.aws/lambda/provided:al2023
Expand Down
4 changes: 2 additions & 2 deletions LambdaRuntimeDockerfiles/Images/net10/arm64/Dockerfile
Original file line number Diff line number Diff line change
@@ -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.6.25358.103
ARG ASPNET_SHA512=88667d66d90aaba30649f84d10d057da7c0db479cdb36b76824dc8e0f02a44a6bf5d269d74daa0d6b78376f2dc66b60238558267555e2ced40cbd06aac745d6a

ARG LAMBDA_RUNTIME_NAME=dotnet10
ARG AMAZON_LINUX=public.ecr.aws/lambda/provided:al2023
Expand Down
4 changes: 2 additions & 2 deletions LambdaRuntimeDockerfiles/Images/net9/amd64/Dockerfile
Original file line number Diff line number Diff line change
@@ -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.7
ARG ASPNET_SHA512=b175d4d0578f9f5d735d59def3f44459462ef36b4bd07d9ca0ed9853bf42d90c7bace195ff264a9dcf6dd4d6d452c87059085146268fce3540ed58eaf39629eb

ARG LAMBDA_RUNTIME_NAME=dotnet9
ARG AMAZON_LINUX=public.ecr.aws/lambda/provided:al2023
Expand Down
4 changes: 2 additions & 2 deletions LambdaRuntimeDockerfiles/Images/net9/arm64/Dockerfile
Original file line number Diff line number Diff line change
@@ -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.7
ARG ASPNET_SHA512=79b28df2bc522d47bd0ea3f8b4aaa447102f92019d038670743fbbc1e6b31dd206499ff6dfc2d31623dedb64a9e2ca23608c7ea7225f1f071745de72c9f81bf4

ARG LAMBDA_RUNTIME_NAME=dotnet9
ARG AMAZON_LINUX=public.ecr.aws/lambda/provided:al2023
Expand Down
Loading