Skip to content
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
193 changes: 193 additions & 0 deletions .github/workflows/auto-update-Dockerfiles.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,193 @@
name: Auto-Update Lambda Dockerfiles Daily
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ignore this file it was picked up because of manual testing


permissions:
contents: write
pull-requests: write

on:
# Run daily at midnight UTC
schedule:
- cron: '0 0 * * *'
# 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'


# Update .NET 8 AMD64 Dockerfile
- name: Update .NET 8 AMD64
id: update-net8-amd64
shell: pwsh
env:
DOCKERFILE_PATH: ${{ env.NET_8_AMD64_Dockerfile }}
run: |
$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"
}

# Update .NET 8 ARM64 Dockerfile
- name: Update .NET 8 ARM64
id: update-net8-arm64
shell: pwsh
env:
DOCKERFILE_PATH: ${{ env.NET_8_ARM64_Dockerfile }}
run: |
$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"
}

# Update .NET 9 AMD64 Dockerfile
- name: Update .NET 9 AMD64
id: update-net9-amd64
shell: pwsh
env:
DOCKERFILE_PATH: ${{ env.NET_9_AMD64_Dockerfile }}
run: |
$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"
}

# Update .NET 9 ARM64 Dockerfile
- name: Update .NET 9 ARM64
id: update-net9-arm64
shell: pwsh
env:
DOCKERFILE_PATH: ${{ env.NET_9_ARM64_Dockerfile }}
run: |
$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"
}

# Update .NET 10 AMD64 Dockerfile
- name: Update .NET 10 AMD64
id: update-net10-amd64
shell: pwsh
env:
DOCKERFILE_PATH: ${{ env.NET_10_AMD64_Dockerfile }}
run: |
$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"
}

# Update .NET 10 ARM64 Dockerfile
- name: Update .NET 10 ARM64
id: update-net10-arm64
shell: pwsh
env:
DOCKERFILE_PATH: ${{ env.NET_10_ARM64_Dockerfile }}
run: |
$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"
}

# 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"
$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: 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"
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: 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.

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.7.25380.108
ARG ASPNET_SHA512=f689f386f7fa56b9b53bd7d510abecf2b9c22358fb29367846c23fbba7b0a61a47d86dbceef96b73a728af076e55c346838497402e0cd80b8695d9dc1ea3c2b9

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.7.25380.108
ARG ASPNET_SHA512=81358ed46adffd1a4e2e095e3d23d67d1d289a6c4c50ab20e1e71161b2823c8c44dd5a6c241ac9b3fcd4a2af518dbffbccdb7b3acd07a42af9ff24c5fd62c6a3

ARG LAMBDA_RUNTIME_NAME=dotnet10
ARG AMAZON_LINUX=public.ecr.aws/lambda/provided:al2023
Expand Down
4 changes: 2 additions & 2 deletions LambdaRuntimeDockerfiles/Images/net8/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=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
Expand Down
4 changes: 2 additions & 2 deletions LambdaRuntimeDockerfiles/Images/net8/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=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
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.8
ARG ASPNET_SHA512=08afdf924d00f875b44cc4eff68b55fb9b63e4cc68e6b5cde873da2bce9c5b5f4120e869b6a1dfdea4ab104ab0ac8783ef1577b4d3275aae899a53cd88130f1d

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.8
ARG ASPNET_SHA512=cf1e72f4b327b93c1ac3f2def9ca83bee27a408e5b5913f84ed954cfd6c4639da1664fe3f4e3925883db77ed29fa5364b9ca8af3796f33ca73a4cb7484e326bc

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