-
Notifications
You must be signed in to change notification settings - Fork 494
chore: Daily ASP.NET Core version update in Dockerfiles #2127
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
Closed
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
d05d45f
auto update lambda runtime images
GarrettBeatty b404e9e
temp add on github
GarrettBeatty 2eb7a4d
update
GarrettBeatty 28c5b2c
fix pathing
GarrettBeatty fb53e71
temp branch update
GarrettBeatty 997f128
update branch back to dev
GarrettBeatty cf2ec85
add permissions
GarrettBeatty e510555
add permissions and label
GarrettBeatty 6312c87
temp branch update
GarrettBeatty 5538207
temp branch update
GarrettBeatty a574dcd
fix permissions
GarrettBeatty 1263f4b
temp branch update
GarrettBeatty 733c469
temp branch update
GarrettBeatty 3e36ac2
PR comments
GarrettBeatty 2d2787e
fix pathing
GarrettBeatty ac67228
fix pathing
GarrettBeatty b801be5
add logs
GarrettBeatty deaa0dc
testing
GarrettBeatty 90f61bb
chore: Daily ASP.NET Core version update in Dockerfiles
aws-sdk-dotnet-automation File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,193 @@ | ||
| name: Auto-Update Lambda Dockerfiles Daily | ||
|
|
||
| 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'] | ||
| }) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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