Skip to content

Commit 7987cac

Browse files
authored
Merge pull request #2036 from aws/dev
Master / Dev Sync
2 parents 29aa50f + 1e125b6 commit 7987cac

File tree

7 files changed

+162
-54
lines changed

7 files changed

+162
-54
lines changed

.github/workflows/create-release-pr.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,31 +25,31 @@ jobs:
2525
steps:
2626
# Assume an AWS Role that provides access to the Access Token
2727
- name: Configure AWS Credentials
28-
uses: aws-actions/configure-aws-credentials@8c3f20df09ac63af7b3ae3d7c91f105f857d8497 #v4
28+
uses: aws-actions/configure-aws-credentials@ececac1a45f3b08a01d2dd070d28d111c5fe6722 #v4.1.0
2929
with:
3030
role-to-assume: ${{ secrets.RELEASE_WORKFLOW_ACCESS_TOKEN_ROLE_ARN }}
3131
aws-region: us-west-2
3232
# Retrieve the Access Token from Secrets Manager
3333
- name: Retrieve secret from AWS Secrets Manager
34-
uses: aws-actions/aws-secretsmanager-get-secrets@v2
34+
uses: aws-actions/aws-secretsmanager-get-secrets@fbd65ea98e018858715f591f03b251f02b2316cb #v2.0.8
3535
with:
3636
secret-ids: |
3737
AWS_SECRET, ${{ secrets.RELEASE_WORKFLOW_ACCESS_TOKEN_NAME }}
3838
parse-json-secrets: true
3939
# Checkout a full clone of the repo
4040
- name: Checkout
41-
uses: actions/checkout@v4
41+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
4242
with:
4343
fetch-depth: '0'
4444
token: ${{ env.AWS_SECRET_TOKEN }}
4545
# Install .NET9 which is needed for AutoVer
4646
- name: Setup .NET 9.0
47-
uses: actions/setup-dotnet@v4
47+
uses: actions/setup-dotnet@67a3573c9a986a3f9c594539f4ab511d57bb3ce9 #v4.3.1
4848
with:
4949
dotnet-version: 9.0.x
5050
# Install AutoVer to automate versioning and changelog creation
5151
- name: Install AutoVer
52-
run: dotnet tool install --global AutoVer --version 0.0.24
52+
run: dotnet tool install --global AutoVer --version 0.0.25
5353
# Set up a git user to be able to run git commands later on
5454
- name: Setup Git User
5555
run: |
Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
# This GitHub Workflow is designed to run automatically after the Release PR, which was created by the `Create Release PR` workflow, is closed.
2+
# This workflow has 2 jobs. One will run if the `Release PR` is successfully merged, indicating that a release should go out.
3+
# The other will run if the `Release PR` was closed and a release is not intended to go out.
4+
name: Sync 'dev' and 'master'
5+
6+
# The workflow will automatically be triggered when any PR is closed.
7+
on:
8+
pull_request:
9+
types: [closed]
10+
11+
permissions:
12+
contents: write
13+
id-token: write
14+
15+
jobs:
16+
# This job will check if the PR was successfully merged, it's source branch is `releases/next-release` and target branch is `dev`.
17+
# This indicates that the merged PR was the `Release PR`.
18+
# This job will synchronize `dev` and `master`, create a GitHub Release and delete the `releases/next-release` branch.
19+
sync-dev-and-master:
20+
name: Sync dev and master
21+
if: |
22+
github.event.pull_request.merged == true &&
23+
github.event.pull_request.head.ref == 'releases/next-release' &&
24+
github.event.pull_request.base.ref == 'dev'
25+
runs-on: ubuntu-latest
26+
steps:
27+
# Assume an AWS Role that provides access to the Access Token
28+
- name: Configure AWS Credentials
29+
uses: aws-actions/configure-aws-credentials@ececac1a45f3b08a01d2dd070d28d111c5fe6722 #v4.1.0
30+
with:
31+
role-to-assume: ${{ secrets.RELEASE_WORKFLOW_ACCESS_TOKEN_ROLE_ARN }}
32+
aws-region: us-west-2
33+
# Retrieve the Access Token from Secrets Manager
34+
- name: Retrieve secret from AWS Secrets Manager
35+
uses: aws-actions/aws-secretsmanager-get-secrets@fbd65ea98e018858715f591f03b251f02b2316cb #v2.0.8
36+
with:
37+
secret-ids: |
38+
AWS_SECRET, ${{ secrets.RELEASE_WORKFLOW_ACCESS_TOKEN_NAME }}
39+
parse-json-secrets: true
40+
# Checkout a full clone of the repo
41+
- name: Checkout code
42+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
43+
with:
44+
ref: dev
45+
fetch-depth: 0
46+
token: ${{ env.AWS_SECRET_TOKEN }}
47+
# Install .NET9 which is needed for AutoVer
48+
- name: Setup .NET 9.0
49+
uses: actions/setup-dotnet@67a3573c9a986a3f9c594539f4ab511d57bb3ce9 #v4.3.1
50+
with:
51+
dotnet-version: 9.0.x
52+
# Install AutoVer which is needed to retrieve information about the current release.
53+
- name: Install AutoVer
54+
run: dotnet tool install --global AutoVer --version 0.0.25
55+
# Set up a git user to be able to run git commands later on
56+
- name: Setup Git User
57+
run: |
58+
git config --global user.email "github-aws-sdk-dotnet-automation@amazon.com"
59+
git config --global user.name "aws-sdk-dotnet-automation"
60+
# Retrieve the release name which is needed for the GitHub Release
61+
- name: Read Release Name
62+
id: read-release-name
63+
run: |
64+
version=$(autover changelog --release-name)
65+
echo "VERSION=$version" >> $GITHUB_OUTPUT
66+
# Retrieve the tag name which is needed for the GitHub Release
67+
- name: Read Tag Name
68+
id: read-tag-name
69+
run: |
70+
tag=$(autover changelog --tag-name)
71+
echo "TAG=$tag" >> $GITHUB_OUTPUT
72+
# Retrieve the changelog which is needed for the GitHub Release
73+
- name: Read Changelog
74+
id: read-changelog
75+
run: |
76+
changelog=$(autover changelog --output-to-console)
77+
echo "CHANGELOG<<EOF"$'\n'"$changelog"$'\n'EOF >> "$GITHUB_OUTPUT"
78+
# Merge dev into master in order to synchronize the 2 branches
79+
- name: Merge dev to master
80+
run: |
81+
git fetch origin
82+
git checkout master
83+
git merge dev
84+
git push origin master
85+
# Create the GitHub Release
86+
- name: Create GitHub Release
87+
env:
88+
GITHUB_TOKEN: ${{ env.AWS_SECRET_TOKEN }}
89+
run: |
90+
gh release create "${{ steps.read-tag-name.outputs.TAG }}" --title "${{ steps.read-release-name.outputs.VERSION }}" --notes "${{ steps.read-changelog.outputs.CHANGELOG }}"
91+
# Delete the `releases/next-release` branch
92+
- name: Clean up
93+
run: |
94+
git fetch origin
95+
if git ls-remote --exit-code --heads origin releases/next-release > /dev/null; then
96+
echo "Branch 'releases/next-release' exists on origin. Deleting..."
97+
git push origin --delete releases/next-release
98+
else
99+
echo "Branch 'releases/next-release' does not exist on origin, skipping deletion."
100+
fi
101+
# This job will check if the PR was closed, it's source branch is `releases/next-release` and target branch is `dev`.
102+
# This indicates that the closed PR was the `Release PR`.
103+
# This job will delete the tag created by AutoVer and the release branch.
104+
clean-up-closed-release:
105+
name: Clean up closed release
106+
if: |
107+
github.event.pull_request.merged == false &&
108+
github.event.pull_request.head.ref == 'releases/next-release' &&
109+
github.event.pull_request.base.ref == 'dev'
110+
runs-on: ubuntu-latest
111+
steps:
112+
# Checkout a full clone of the repo
113+
- name: Checkout code
114+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
115+
with:
116+
ref: releases/next-release
117+
fetch-depth: 0
118+
# Install .NET9 which is needed for AutoVer
119+
- name: Setup .NET 9.0
120+
uses: actions/setup-dotnet@67a3573c9a986a3f9c594539f4ab511d57bb3ce9 #v4.3.1
121+
with:
122+
dotnet-version: 9.0.x
123+
# Install AutoVer which is needed to retrieve information about the current release.
124+
- name: Install AutoVer
125+
run: dotnet tool install --global AutoVer --version 0.0.25
126+
# Set up a git user to be able to run git commands later on
127+
- name: Setup Git User
128+
run: |
129+
git config --global user.email "github-aws-sdk-dotnet-automation@amazon.com"
130+
git config --global user.name "aws-sdk-dotnet-automation"
131+
# Retrieve the tag name to be deleted
132+
- name: Read Tag Name
133+
id: read-tag-name
134+
run: |
135+
tag=$(autover changelog --tag-name)
136+
echo "TAG=$tag" >> $GITHUB_OUTPUT
137+
# Delete the tag created by AutoVer and the release branch
138+
- name: Clean up
139+
run: |
140+
git fetch origin
141+
git push --delete origin ${{ steps.read-tag-name.outputs.TAG }}
142+
if git ls-remote --exit-code --heads origin releases/next-release > /dev/null; then
143+
echo "Branch 'releases/next-release' exists on origin. Deleting..."
144+
git push origin --delete releases/next-release
145+
else
146+
echo "Branch 'releases/next-release' does not exist on origin, skipping deletion."
147+
fi

.github/workflows/update-Dockerfiles.yml

Lines changed: 2 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,6 @@ on:
44
# Allows to run this workflow manually from the Actions tab
55
workflow_dispatch:
66
inputs:
7-
NET_6_AMD64:
8-
description: ".NET 6 AMD64"
9-
type: boolean
10-
required: true
11-
default: "true"
12-
NET_6_ARM64:
13-
description: ".NET 6 ARM64"
14-
type: boolean
15-
required: true
16-
default: "true"
17-
NET_6_NEXT_VERSION:
18-
description: ".NET 6 Next Version"
19-
type: string
20-
required: true
217
NET_8_AMD64:
228
description: ".NET 8 AMD64"
239
type: boolean
@@ -51,8 +37,6 @@ jobs:
5137
build:
5238
runs-on: ubuntu-latest
5339
env:
54-
NET_6_AMD64_Dockerfile: "LambdaRuntimeDockerfiles/Images/net6/amd64/Dockerfile"
55-
NET_6_ARM64_Dockerfile: "LambdaRuntimeDockerfiles/Images/net6/arm64/Dockerfile"
5640
NET_8_AMD64_Dockerfile: "LambdaRuntimeDockerfiles/Images/net8/amd64/Dockerfile"
5741
NET_8_ARM64_Dockerfile: "LambdaRuntimeDockerfiles/Images/net8/arm64/Dockerfile"
5842
NET_9_AMD64_Dockerfile: "LambdaRuntimeDockerfiles/Images/net9/amd64/Dockerfile"
@@ -61,30 +45,10 @@ jobs:
6145
# Steps represent a sequence of tasks that will be executed as part of the job
6246
steps:
6347
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
64-
- uses: actions/checkout@v4
48+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
6549
with:
6650
ref: 'dev'
6751

68-
- name: Update .NET 6 AMD64
69-
id: update-net6-amd64
70-
shell: pwsh
71-
env:
72-
DOCKERFILE_PATH: ${{ env.NET_6_AMD64_Dockerfile }}
73-
NEXT_VERSION: ${{ github.event.inputs.NET_6_NEXT_VERSION }}
74-
run: |
75-
.\LambdaRuntimeDockerfiles\update-dockerfile.ps1 -DockerfilePath "${{ env.DOCKERFILE_PATH }}" -NextVersion "${{ env.NEXT_VERSION }}"
76-
if: ${{ github.event.inputs.NET_6_AMD64 == 'true' }}
77-
78-
- name: Update .NET 6 ARM64
79-
id: update-net6-arm64
80-
shell: pwsh
81-
env:
82-
DOCKERFILE_PATH: ${{ env.NET_6_ARM64_Dockerfile }}
83-
NEXT_VERSION: ${{ github.event.inputs.NET_6_NEXT_VERSION }}
84-
run: |
85-
.\LambdaRuntimeDockerfiles\update-dockerfile.ps1 -DockerfilePath "${{ env.DOCKERFILE_PATH }}" -NextVersion "${{ env.NEXT_VERSION }}"
86-
if: ${{ github.event.inputs.NET_6_ARM64 == 'true' }}
87-
8852
- name: Update .NET 8 AMD64
8953
id: update-net8-amd64
9054
shell: pwsh
@@ -155,15 +119,12 @@ jobs:
155119
\n\n*Description of changes:*
156120
\n${{ format
157121
(
158-
'{0}\n{1}\n{2}\n{3}\n{4}\n{5}',
159-
join(steps.update-net6-amd64.outputs.MESSAGE, '\n'),
160-
join(steps.update-net6-arm64.outputs.MESSAGE, '\n'),
122+
'{0}\n{1}\n{2}\n{3}',
161123
join(steps.update-net8-amd64.outputs.MESSAGE, '\n'),
162124
join(steps.update-net8-arm64.outputs.MESSAGE, '\n'),
163125
join(steps.update-net9-amd64.outputs.MESSAGE, '\n'),
164126
join(steps.update-net9-arm64.outputs.MESSAGE, '\n')
165127
)
166128
}}"
167129
github_token: ${{ secrets.GITHUB_TOKEN }}
168-
pr_label: "auto-pr"
169130

LambdaRuntimeDockerfiles/Images/net8/amd64/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Based on Docker image from: https://github.com/dotnet/dotnet-docker/
22

3-
ARG ASPNET_VERSION=8.0.14
4-
ARG ASPNET_SHA512=b8cd0640c2a7382330b44be3130327ff0036be87b620f9b8ae5b854fce346b60586dd7bba6a684d7b051dc934025170cb945c41ea3bc92115b30e67eeeafb920
3+
ARG ASPNET_VERSION=8.0.15
4+
ARG ASPNET_SHA512=3ca5669d4aff60f1bf8cecb99de05d6b489db150caa7c184d1a8bcdf085c611533e05ad7bd0c5091c726850611cff6b0477ef9b1dbb192ebe9055c03de1cf6d8
55

66
ARG LAMBDA_RUNTIME_NAME=dotnet8
77
ARG AMAZON_LINUX=public.ecr.aws/lambda/provided:al2023

LambdaRuntimeDockerfiles/Images/net8/arm64/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Based on Docker image from: https://github.com/dotnet/dotnet-docker/
22

3-
ARG ASPNET_VERSION=8.0.14
4-
ARG ASPNET_SHA512=64c2247ca84cce13525e54e2eb062ca25d7f8435b54543442b11673906ee998b147321ae720920deb8ed96f66c1ee917c7bea9b90b360108e045384e8da44923
3+
ARG ASPNET_VERSION=8.0.15
4+
ARG ASPNET_SHA512=967d43a9387d226ed804cfee35144a69f249f6206b73ed0d8915dad358fede3c5ddc3ec963a5c35400b62dc57265da1dbc07d793cf5e3940ce94e54783312f0e
55

66
ARG LAMBDA_RUNTIME_NAME=dotnet8
77
ARG AMAZON_LINUX=public.ecr.aws/lambda/provided:al2023

LambdaRuntimeDockerfiles/Images/net9/amd64/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Based on Docker image from: https://github.com/dotnet/dotnet-docker/
22

3-
ARG ASPNET_VERSION=9.0.3
4-
ARG ASPNET_SHA512=38a3b73a6c41ee6f67e9108ebf684ec082fc6dfaa941ea225f6eb200a1e34909c05fa47a087c35c18eab607350796ecd16c09f2e3774dba590083c93742e39a3
3+
ARG ASPNET_VERSION=9.0.4
4+
ARG ASPNET_SHA512=f3eae8863634a050b90b672b14d466a44c623ca06c6501a3a70efea93e540995e2fa348ae5ef7a3f278110a9ba24043a651150a378e4e5a84c25690b73364132
55

66
ARG LAMBDA_RUNTIME_NAME=dotnet9
77
ARG AMAZON_LINUX=public.ecr.aws/lambda/provided:al2023

LambdaRuntimeDockerfiles/Images/net9/arm64/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Based on Docker image from: https://github.com/dotnet/dotnet-docker/
22

3-
ARG ASPNET_VERSION=9.0.3
4-
ARG ASPNET_SHA512=8a027078b46b6ebb3f4beda2b3f3cf7960701b71b9f2b6704c17f2752279c764755cadfd30f3e2f3e3ab26869e50a35c567c2fbd41fd98d77ae2f6fecde18b50
3+
ARG ASPNET_VERSION=9.0.4
4+
ARG ASPNET_SHA512=7cca4084341c2e978e6d75e09cae308a35de7cd84c5b27d5246b9d1b3e6aaff200bae8de5a25b816e30c3ba354bef17b84bae0ce15144895518661e53af18331
55

66
ARG LAMBDA_RUNTIME_NAME=dotnet9
77
ARG AMAZON_LINUX=public.ecr.aws/lambda/provided:al2023

0 commit comments

Comments
 (0)