Skip to content

Commit 2b60c0b

Browse files
committed
ci: add support for automated versioning and changelog creation
1 parent 2966add commit 2b60c0b

File tree

7 files changed

+410
-99
lines changed

7 files changed

+410
-99
lines changed

.autover/autover.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"Projects": [
3+
{
4+
"Name": "Amazon.Extensions.Configuration.SystemsManager",
5+
"Path": "src/Amazon.Extensions.Configuration.SystemsManager/Amazon.Extensions.Configuration.SystemsManager.csproj"
6+
}
7+
],
8+
"UseCommitsForChangelog": false,
9+
"DefaultIncrementType": "Patch",
10+
"ChangeFilesDetermineIncrementType": true
11+
}
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
# This GitHub Workflow will create a new release branch that contains the updated C# project versions and changelog.
2+
# The workflow will also create a PR that targets `dev` from the release branch.
3+
name: Create Release PR
4+
5+
# This workflow is manually triggered when in preparation for a release. The workflow should be dispatched from the `dev` branch.
6+
on:
7+
workflow_dispatch:
8+
inputs:
9+
OVERRIDE_VERSION:
10+
description: "Override Version"
11+
type: string
12+
required: false
13+
14+
permissions:
15+
id-token: write
16+
17+
jobs:
18+
release-pr:
19+
name: Release PR
20+
runs-on: ubuntu-latest
21+
22+
env:
23+
INPUT_OVERRIDE_VERSION: ${{ github.event.inputs.OVERRIDE_VERSION }}
24+
25+
steps:
26+
# Assume an AWS Role that provides access to the Access Token
27+
- name: Configure AWS Credentials
28+
uses: aws-actions/configure-aws-credentials@8c3f20df09ac63af7b3ae3d7c91f105f857d8497 #v4
29+
with:
30+
role-to-assume: ${{ secrets.RELEASE_WORKFLOW_ACCESS_TOKEN_ROLE_ARN }}
31+
aws-region: us-west-2
32+
# Retrieve the Access Token from Secrets Manager
33+
- name: Retrieve secret from AWS Secrets Manager
34+
uses: aws-actions/aws-secretsmanager-get-secrets@v2
35+
with:
36+
secret-ids: |
37+
AWS_SECRET, ${{ secrets.RELEASE_WORKFLOW_ACCESS_TOKEN_NAME }}
38+
parse-json-secrets: true
39+
# Checkout a full clone of the repo
40+
- name: Checkout
41+
uses: actions/checkout@v4
42+
with:
43+
fetch-depth: '0'
44+
token: ${{ env.AWS_SECRET_TOKEN }}
45+
# Install .NET8 which is needed for AutoVer
46+
- name: Setup .NET 8.0
47+
uses: actions/setup-dotnet@v4
48+
with:
49+
dotnet-version: 8.0.x
50+
# Install AutoVer to automate versioning and changelog creation
51+
- name: Install AutoVer
52+
run: dotnet tool install --global AutoVer --version 0.0.21
53+
# Set up a git user to be able to run git commands later on
54+
- name: Setup Git User
55+
run: |
56+
git config --global user.email "[email protected]"
57+
git config --global user.name "aws-sdk-dotnet-automation"
58+
# Create the release branch which will contain the version changes and updated changelog
59+
- name: Create Release Branch
60+
id: create-release-branch
61+
run: |
62+
branch=releases/next-release
63+
git checkout -b $branch
64+
echo "BRANCH=$branch" >> $GITHUB_OUTPUT
65+
# Update the version of projects based on the change files
66+
- name: Increment Version
67+
run: autover version
68+
if: env.INPUT_OVERRIDE_VERSION == ''
69+
# Update the version of projects based on the override version
70+
- name: Increment Version
71+
run: autover version --use-version "$INPUT_OVERRIDE_VERSION"
72+
if: env.INPUT_OVERRIDE_VERSION != ''
73+
# Update the changelog based on the change files
74+
- name: Update Changelog
75+
run: autover changelog
76+
# Push the release branch up as well as the created tag
77+
- name: Push Changes
78+
run: |
79+
branch=${{ steps.create-release-branch.outputs.BRANCH }}
80+
git push origin $branch
81+
git push origin $branch --tags
82+
# Get the release name that will be used to create a PR
83+
- name: Read Release Name
84+
id: read-release-name
85+
run: |
86+
version=$(autover changelog --release-name)
87+
echo "VERSION=$version" >> $GITHUB_OUTPUT
88+
# Get the changelog that will be used to create a PR
89+
- name: Read Changelog
90+
id: read-changelog
91+
run: |
92+
changelog=$(autover changelog --output-to-console)
93+
echo "CHANGELOG<<EOF"$'\n'"$changelog"$'\n'EOF >> "$GITHUB_OUTPUT"
94+
# Create the Release PR and label it
95+
- name: Create Pull Request
96+
env:
97+
GITHUB_TOKEN: ${{ env.AWS_SECRET_TOKEN }}
98+
run: |
99+
pr_url="$(gh pr create --title "${{ steps.read-release-name.outputs.VERSION }}" --body "${{ steps.read-changelog.outputs.CHANGELOG }}" --base dev --head ${{ steps.create-release-branch.outputs.BRANCH }})"
100+
gh label create "Release PR" --description "A Release PR that includes versioning and changelog changes" -c "#FF0000" -f
101+
gh pr edit $pr_url --add-label "Release PR"
Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
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-main:
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@8c3f20df09ac63af7b3ae3d7c91f105f857d8497 #v4
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@v2
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@v4
43+
with:
44+
ref: dev
45+
fetch-depth: 0
46+
token: ${{ env.AWS_SECRET_TOKEN }}
47+
# Install .NET8 which is needed for AutoVer
48+
- name: Setup .NET 8.0
49+
uses: actions/setup-dotnet@v4
50+
with:
51+
dotnet-version: 8.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.21
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 "[email protected]"
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+
git push origin --delete releases/next-release
96+
# This job will check if the PR was closed, it's source branch is `releases/next-release` and target branch is `dev`.
97+
# This indicates that the closed PR was the `Release PR`.
98+
# This job will delete the tag created by AutoVer and the release branch.
99+
clean-up-closed-release:
100+
name: Clean up closed release
101+
if: |
102+
github.event.pull_request.merged == false &&
103+
github.event.pull_request.head.ref == 'releases/next-release' &&
104+
github.event.pull_request.base.ref == 'dev'
105+
runs-on: ubuntu-latest
106+
steps:
107+
# Checkout a full clone of the repo
108+
- name: Checkout code
109+
uses: actions/checkout@v4
110+
with:
111+
ref: releases/next-release
112+
fetch-depth: 0
113+
# Install .NET8 which is needed for AutoVer
114+
- name: Setup .NET 8.0
115+
uses: actions/setup-dotnet@v4
116+
with:
117+
dotnet-version: 8.0.x
118+
# Install AutoVer which is needed to retrieve information about the current release.
119+
- name: Install AutoVer
120+
run: dotnet tool install --global AutoVer --version 0.0.21
121+
# Set up a git user to be able to run git commands later on
122+
- name: Setup Git User
123+
run: |
124+
git config --global user.email "[email protected]"
125+
git config --global user.name "aws-sdk-dotnet-automation"
126+
# Retrieve the tag name to be deleted
127+
- name: Read Tag Name
128+
id: read-tag-name
129+
run: |
130+
tag=$(autover changelog --tag-name)
131+
echo "TAG=$tag" >> $GITHUB_OUTPUT
132+
# Delete the tag created by AutoVer and the release branch
133+
- name: Clean up
134+
run: |
135+
git fetch origin
136+
git push --delete origin ${{ steps.read-tag-name.outputs.TAG }}
137+
git push origin --delete releases/next-release

CHANGELOG.md

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
## Release 2024-10-15
2+
3+
### Amazon.Extensions.Configuration.SystemsManager (6.2.2)
4+
* Update System.Text.Json for .NET Standard 2.0 target to version 8.0.5.
5+
6+
## Release 2024-07-30
7+
8+
### Amazon.Extensions.Configuration.SystemsManager (6.2.1)
9+
* For .NET Standard 2.0 target updated the dependency version of System.Text.Json to version 8.0.4
10+
11+
## Release 2024-06-19
12+
13+
### Amazon.Extensions.Configuration.SystemsManager (6.2.0)
14+
* **Breaking Change:** Throw exception if duplicate Systems Manager parameter keys (case insensitive) are detected irrespective of whether the parameter is optional or not.
15+
16+
## Release 2024-04-20
17+
18+
### Amazon.Extensions.Configuration.SystemsManager (6.1.1)
19+
* Update User-Agent string
20+
21+
## Release 2024-03-29
22+
23+
### Amazon.Extensions.Configuration.SystemsManager (6.1.0)
24+
* Pull request [#163](https://github.com/aws/aws-dotnet-extensions-configuration/pull/163) adding .NET 8 target. Thanks [Jon Armen](https://github.com/jon-armen)
25+
26+
## Release 2023-09-21
27+
28+
### Amazon.Extensions.Configuration.SystemsManager (6.0.0)
29+
* BREAKING CHANGE: Added StringList handling in default parameter processor.
30+
* Note: This is re-releasing 5.1.1 as a major version bump because it introduced a change in behavior if a user was already handling StringList parameters.
31+
32+
## Release 2023-09-11
33+
34+
### Amazon.Extensions.Configuration.SystemsManager (5.1.1)
35+
* Pull request [#142](https://github.com/aws/aws-dotnet-extensions-configuration/pull/142) Added StringList handling in default parameter processor. Thanks [ArtemMelnychenko](https://github.com/Plazmius)
36+
* Note: We have unlisted and re-released this as 6.0.0. due to the breaking change reported in [#156](https://github.com/aws/aws-dotnet-extensions-configuration/issues/156)
37+
38+
## Release 2023-05-31
39+
40+
### Amazon.Extensions.Configuration.SystemsManager (5.1.0)
41+
* Pull request [#150](https://github.com/aws/aws-dotnet-extensions-configuration/pull/150) Adding .NET Standard 2.0 support for .NET Framework applications. Thanks [Matthew Heaton](https://github.com/heatonmatthew)
42+
43+
## Release 2023-03-21
44+
45+
### Amazon.Extensions.Configuration.SystemsManager (5.0.2)
46+
* Fixed an issue where AppConfig JSON configuration with charset information in ContentType was not being parsed.
47+
48+
## Release 2023-03-06
49+
50+
### Amazon.Extensions.Configuration.SystemsManager (5.0.1)
51+
* Fixed an issue where JsonParameterProcessor was prefixing `:` character to parameter properties while retrieving parameter by name.
52+
53+
## Release 2023-02-07
54+
55+
### Amazon.Extensions.Configuration.SystemsManager (5.0.0)
56+
* **Breaking Change:** Fixed issue when parsing JSON SSM parameter values to include the relative SSM parameter name to the JSON property names.
57+
58+
## Release 2023-02-01
59+
60+
### Amazon.Extensions.Configuration.SystemsManager (4.0.1)
61+
* Merged PR [#128](https://github.com/aws/aws-dotnet-extensions-configuration/pull/128) fixed issue parsing AppConfig response when services returns empty response for no changes. Thanks [Tyler Ohlsen](https://github.com/tylerohlsen)
62+
63+
## Release 2022-06-28
64+
65+
### Amazon.Extensions.Configuration.SystemsManager (4.0.0)
66+
* Merged PR [#99](https://github.com/aws/aws-dotnet-extensions-configuration/pull/99) adding support for using AppConfig Lambda extension. Thanks [mgorski-mg](https://github.com/mgorski-mg)
67+
* Merged PR [#69](https://github.com/aws/aws-dotnet-extensions-configuration/pull/69) making IParameterProcessor used for customizing data from AWS into config values more genenric. Thanks [warej](https://github.com/warej)
68+
* Merged PR [#59](https://github.com/aws/aws-dotnet-extensions-configuration/pull/59) removing dependency on Newtonsoft.JSON and now use System.Text.Json. Thanks [Adilson de Almeida Junior](https://github.com/Adilson)
69+
* Accessing AppConfig data now uses the AWS AppConfig Data APIs StargConfigurationSession and GetLatestConfiguration
70+
* **Breaking Change:** The IncludeParameter, GetKey and GetValue methods were removed from IParameterProcessor in favor of the new generic ProcessParameters method allowing more flexibility in implementations.
71+
* **Breaking Change:** `ClientId` was removed from `AppConfigConfigurationSource`.
72+
* **Breaking Change:** When using AppConfig IAM permissions for `appconfig:StartConfigurationSession` and `appconfig:GetLatestConfiguration` are now required and `appconfig:GetConfiguration` is not longer required.
73+
74+
## Release 2021-08-18
75+
76+
### Amazon.Extensions.Configuration.SystemsManager (3.0.0)
77+
* Merged PR [#82](https://github.com/aws/aws-dotnet-extensions-configuration/pull/82) Adding [AWS AppConfig](https://docs.aws.amazon.com/appconfig/latest/userguide/what-is-appconfig.html) support. Thanks [Michał Górski](https://github.com/mgorski-mg)
78+
79+
## Release 2021-07-23
80+
81+
### Amazon.Extensions.Configuration.SystemsManager (2.1.1)
82+
* Update AWSSDK.Extensions.NETCore.Setup and AWSSDK.SimpleSystemsManagement package references for SSO credential support.
83+
84+
## Release 2021-03-30
85+
86+
### Amazon.Extensions.Configuration.SystemsManager (2.1.0)
87+
* Update AWS SDK dependencies to version 3.7
88+
89+
## Release 2020-10-09
90+
91+
### Amazon.Extensions.Configuration.SystemsManager (2.0.0)
92+
* Merged PR [#75](https://github.com/aws/aws-dotnet-extensions-configuration/pull/75) Update AWS SDK dependencies to 3.5. Thanks [Doug Ferris](https://github.com/doug-ferris)
93+
* Update Newtonsoft.Json to version 12.
94+
95+
## Release 2019-07-23
96+
97+
### Amazon.Extensions.Configuration.SystemsManager (1.2.0)
98+
* Merged PR [#41](https://github.com/aws/aws-dotnet-extensions-configuration/pull/41) Prevents stripping the first char when the Path is "/". Thanks [Ken Hundley](https://github.com/KenHundley)
99+
* Merged PR [#44](https://github.com/aws/aws-dotnet-extensions-configuration/pull/44) Added `Filters` property to SystemsManagerConfigurationSource. Thanks [Zahy Hwary](https://github.com/zahycs)
100+
101+
## Release 2019-04-09
102+
103+
### Amazon.Extensions.Configuration.SystemsManager (1.1.1)
104+
* Added AWS Secrets Manager support. Thanks [Ken Hundley](https://github.com/KenHundley)
105+
* Only trigger OnReload when values have changed.
106+
* Update version of the AWS SDK for .NET to 3.3.100
107+
108+
## Release 2019-01-11
109+
110+
### Amazon.Extensions.Configuration.SystemsManager (1.0.1)
111+
* Made Analysers for development/local only
112+
113+
114+
## Release 2019-12-17
115+
116+
### Amazon.Extensions.Configuration.SystemsManager (1.0.0)
117+
* Initial release

0 commit comments

Comments
 (0)