Skip to content

Commit 368eeec

Browse files
committed
chore: Initial stab at version bumps using conventional commits
1 parent e088c42 commit 368eeec

File tree

12 files changed

+203
-14
lines changed

12 files changed

+203
-14
lines changed

.github/dependabot.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,51 +6,77 @@ updates:
66
interval: monthly
77
open-pull-requests-limit: 10
88
versioning-strategy: increase
9+
commit-message:
10+
prefix: "chore(deps)"
11+
912
- package-ecosystem: pip
1013
directory: "/e2e_tests/python"
1114
schedule:
1215
interval: monthly
1316
open-pull-requests-limit: 10
1417
versioning-strategy: increase
18+
commit-message:
19+
prefix: "chore(deps)"
20+
1521
- package-ecosystem: pip
1622
directory: "/examples/chatbots/python"
1723
schedule:
1824
interval: monthly
1925
open-pull-requests-limit: 10
2026
versioning-strategy: increase
27+
commit-message:
28+
prefix: "chore(deps)"
29+
2130
- package-ecosystem: pip
2231
directory: "/examples/servers/time"
2332
schedule:
2433
interval: monthly
2534
open-pull-requests-limit: 10
2635
versioning-strategy: increase
36+
commit-message:
37+
prefix: "chore(deps)"
38+
2739
- package-ecosystem: pip
2840
directory: "/examples/servers/time/function"
2941
schedule:
3042
interval: monthly
3143
open-pull-requests-limit: 10
3244
versioning-strategy: increase
45+
commit-message:
46+
prefix: "chore(deps)"
47+
3348
- package-ecosystem: npm
3449
directory: "/src/typescript"
3550
schedule:
3651
interval: monthly
3752
open-pull-requests-limit: 10
3853
versioning-strategy: increase
54+
commit-message:
55+
prefix: "chore(deps)"
56+
3957
- package-ecosystem: npm
4058
directory: "/examples/chatbots/typescript"
4159
schedule:
4260
interval: monthly
4361
open-pull-requests-limit: 10
4462
versioning-strategy: increase
63+
commit-message:
64+
prefix: "chore(deps)"
65+
4566
- package-ecosystem: npm
4667
directory: "/examples/servers/weather-alerts"
4768
schedule:
4869
interval: monthly
4970
open-pull-requests-limit: 10
5071
versioning-strategy: increase
72+
commit-message:
73+
prefix: "chore(deps)"
74+
5175
- package-ecosystem: npm
5276
directory: "/e2e_tests/typescript"
5377
schedule:
5478
interval: monthly
5579
open-pull-requests-limit: 10
5680
versioning-strategy: increase
81+
commit-message:
82+
prefix: "chore(deps)"

.github/workflows/checks.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
push:
55
branches:
66
- main
7+
workflow_call:
78

89
jobs:
910
python:

.github/workflows/lint-pr.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: "Lint PR"
2+
3+
on:
4+
pull_request_target:
5+
types:
6+
- opened
7+
- edited
8+
- synchronize
9+
10+
jobs:
11+
semanticpr:
12+
name: Semantic Pull Request
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: amannn/action-semantic-pull-request@v5
16+
env:
17+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/release.yml

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
name: Release mcp-lambda
2+
3+
on:
4+
workflow_dispatch: {}
5+
# schedule:
6+
# - cron: "0 18 * * 2" # Tuesdays at 10 am PST, 11 am PDT
7+
8+
jobs:
9+
determine_release:
10+
name: "Determine if release is needed"
11+
runs-on: ubuntu-latest
12+
outputs:
13+
pending_version_number: ${{ steps.versiondetails.outputs.pendingversion }}
14+
pending_version_available: ${{ steps.versiondetails.outputs.pendingversionavailable }}
15+
steps:
16+
- uses: actions/checkout@v4
17+
with:
18+
fetch-depth: 0
19+
- name: Setup Node
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: 20
23+
- name: Install commit-and-tag-version
24+
run: |
25+
npm install -g commit-and-tag-version@^12.5.0
26+
27+
- name: Configure git
28+
run: |
29+
git config user.name "github-actions[bot]"
30+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
31+
32+
- name: Check for new commits to release
33+
run: |
34+
CURRENT_VERSION=$(cat VERSION)
35+
COMMITS_TO_RELEASE=$(git log --pretty=oneline v$CURRENT_VERSION..HEAD | wc -l)
36+
37+
echo Current version: v$CURRENT_VERSION
38+
echo Commits to release: $COMMITS_TO_RELEASE
39+
40+
echo "CURRENT_VERSION=${CURRENT_VERSION}" >> $GITHUB_ENV
41+
echo "COMMITS_TO_RELEASE=${COMMITS_TO_RELEASE}" >> $GITHUB_ENV
42+
43+
- name: Check if no release needed
44+
if: ${{ env.COMMITS_TO_RELEASE == 0 }}
45+
run: |
46+
echo No changes to release!
47+
echo Current release: $CURRENT_VERSION
48+
49+
- name: Determine new version number
50+
if: ${{ env.COMMITS_TO_RELEASE != 0 }}
51+
run: |
52+
commit-and-tag-version
53+
54+
NEW_VERSION=$(cat VERSION)
55+
RELEASE_COMMIT_ID=$(git rev-parse HEAD)
56+
57+
echo "NEW_VERSION=${NEW_VERSION}" >> $GITHUB_ENV
58+
echo "RELEASE_COMMIT_ID=${RELEASE_COMMIT_ID}" >> $GITHUB_ENV
59+
60+
- name: Check if version was bumped
61+
if: ${{ env.COMMITS_TO_RELEASE != 0 && env.NEW_VERSION == env.CURRENT_VERSION }}
62+
run: |
63+
echo No changes to release!
64+
echo Current release: $CURRENT_VERSION
65+
66+
- name: "Show pending version details"
67+
if: ${{ env.COMMITS_TO_RELEASE != 0 && env.NEW_VERSION != env.CURRENT_VERSION }}
68+
id: versiondetails
69+
shell: bash
70+
run: |
71+
echo New version: v$NEW_VERSION
72+
echo Commit ID: $RELEASE_COMMIT_ID
73+
echo Previous version: v$CURRENT_VERSION
74+
echo Changes to be released:
75+
git log --pretty=oneline v$CURRENT_VERSION..v$NEW_VERSION
76+
77+
git show v$NEW_VERSION
78+
79+
echo "pendingversion=${NEW_VERSION}" >> $GITHUB_OUTPUT
80+
echo "pendingversionavailable=true" >> $GITHUB_OUTPUT
81+
82+
run_unit_tests:
83+
name: "Run unit tests"
84+
needs: determine_release
85+
if: needs.determine_release.outputs.pending_version_available == 'true'
86+
uses: ./.github/workflows/cdk-checks.yml
87+
88+
run_integration_tests:
89+
name: "Run integration tests"
90+
needs: determine_release
91+
if: needs.determine_release.outputs.pending_version_available == 'true'
92+
permissions:
93+
id-token: write
94+
contents: read
95+
uses: ./.github/workflows/integ-tests.yml
96+
97+
release_new_version:
98+
name: "Release the new version"
99+
needs: [determine_release, run_unit_tests, run_integration_tests]
100+
if: needs.determine_release.outputs.pending_version_available == 'true'
101+
runs-on: ubuntu-latest
102+
permissions:
103+
contents: write
104+
id-token: write
105+
steps:
106+
- uses: actions/checkout@v4
107+
with:
108+
fetch-depth: 0
109+
- name: Setup Node
110+
uses: actions/setup-node@v4
111+
with:
112+
node-version: 20
113+
- name: Install commit-and-tag-version
114+
run: |
115+
npm install -g commit-and-tag-version@^12.5.0
116+
117+
- name: Configure git
118+
run: |
119+
git config user.name "github-actions[bot]"
120+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"

.versionrc

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"packageFiles": [
3+
{
4+
"filename": "VERSION",
5+
"type": "plain-text"
6+
}
7+
],
8+
"bumpFiles": [
9+
{
10+
"filename": "src/python/pyproject.toml",
11+
"type": "python"
12+
},
13+
{
14+
"filename": "src/typescript/package.json",
15+
"type": "json"
16+
},
17+
{
18+
"filename": "e2e_tests/typescript/package.json",
19+
"type": "json"
20+
},
21+
{
22+
"filename": "examples/servers/weather-alerts/package.json",
23+
"type": "json"
24+
},
25+
{
26+
"filename": "examples/chatbots/typescript/package.json",
27+
"type": "json"
28+
}
29+
],
30+
"tagPrefix": "v"
31+
}

VERSION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
0.0.1

e2e_tests/typescript/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mcp-e2e-test-typescript",
3-
"version": "0.1.0",
3+
"version": "0.0.1",
44
"main": "build/main.js",
55
"types": "build/main.d.ts",
66
"scripts": {

examples/chatbots/typescript/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mcp-chatbot-typescript",
3-
"version": "0.1.0",
3+
"version": "0.0.1",
44
"main": "build/main.js",
55
"types": "build/main.d.ts",
66
"scripts": {

examples/servers/time/cdk_stack.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def after_bundling(self, input_dir: str, output_dir: str) -> list[str]:
2525
f"cp /mcp_lambda_src/pyproject.toml {output_dir}/mcp_lambda_build/pyproject.toml",
2626
f"cp /mcp_lambda_src/uv.lock {output_dir}/mcp_lambda_build/uv.lock",
2727
f"cp -r /mcp_lambda_src/src {output_dir}/mcp_lambda_build/src",
28-
f"UV_CACHE_DIR={output_dir}/.cache UV_DYNAMIC_VERSIONING_BYPASS=0.0.1 {output_dir}/uv build --wheel --directory {output_dir}/mcp_lambda_build",
28+
f"UV_CACHE_DIR={output_dir}/.cache {output_dir}/uv build --wheel --directory {output_dir}/mcp_lambda_build",
2929
f"python -m pip install {output_dir}/mcp_lambda_build/dist/*.whl -t {output_dir}",
3030
f"rm -r {output_dir}/mcp_lambda_build {output_dir}/.cache uv",
3131
]

examples/servers/weather-alerts/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "weather-alerts",
3-
"version": "0.1.0",
3+
"version": "0.0.1",
44
"main": "lib/weather-alerts-mcp-server.js",
55
"types": "lib/weather-alerts-mcp-server.d.ts",
66
"scripts": {

0 commit comments

Comments
 (0)