Skip to content

Commit 38c9cf1

Browse files
authored
Improve GitHub Actions
* Use maven wrapper in actions * Use --no-transfer-progress, which avoids download progress tracking in logs * Do not run conformance, docs and publish snapshot worfklows on forks
1 parent ed02736 commit 38c9cf1

File tree

5 files changed

+36
-15
lines changed

5 files changed

+36
-15
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ name: CI
33
on:
44
pull_request: {}
55

6+
env:
7+
MAVEN_ARGS: --no-transfer-progress
8+
69
jobs:
710
build:
811
name: Build and Test
@@ -19,7 +22,7 @@ jobs:
1922
cache: 'maven'
2023

2124
- name: Build
22-
run: mvn verify
25+
run: ./mvnw verify
2326

2427
jackson2-tests:
2528
name: Jackson 2 Integration Tests
@@ -36,4 +39,4 @@ jobs:
3639
cache: 'maven'
3740

3841
- name: Jackson 2 Integration Tests
39-
run: mvn -pl mcp-test -am -Pjackson2 test
42+
run: ./mvnw -pl mcp-test -am -Pjackson2 test

.github/workflows/conformance.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,12 @@ on:
66
branches: [main]
77
workflow_dispatch:
88

9+
env:
10+
MAVEN_ARGS: --no-transfer-progress
11+
912
jobs:
1013
server:
14+
if: ${{ github.repository_owner == 'modelcontextprotocol' }}
1115
name: Server Conformance
1216
runs-on: ubuntu-latest
1317
steps:
@@ -20,10 +24,11 @@ jobs:
2024
distribution: 'temurin'
2125
cache: 'maven'
2226

23-
- name: Build and start server
27+
- name: Build
28+
run: ./mvnw clean install -DskipTests
29+
- name: Start server
2430
run: |
25-
mvn clean install -DskipTests
26-
mvn exec:java -pl conformance-tests/server-servlet -Dexec.mainClass="io.modelcontextprotocol.conformance.server.ConformanceServlet" &
31+
./mvnw exec:java -pl conformance-tests/server-servlet -Dexec.mainClass="io.modelcontextprotocol.conformance.server.ConformanceServlet" &
2732
timeout 30 bash -c 'until curl -s http://localhost:8080/mcp > /dev/null 2>&1; do sleep 0.5; done'
2833
2934
- name: Run conformance tests
@@ -35,6 +40,7 @@ jobs:
3540
expected-failures: ./conformance-tests/conformance-baseline.yml
3641

3742
client:
43+
if: ${{ github.repository_owner == 'modelcontextprotocol' }}
3844
name: Client Conformance
3945
runs-on: ubuntu-latest
4046
strategy:
@@ -51,7 +57,7 @@ jobs:
5157
cache: 'maven'
5258

5359
- name: Build client
54-
run: mvn clean install -DskipTests
60+
run: ./mvnw clean install -DskipTests -T 1C
5561

5662
- name: Run conformance test
5763
uses: modelcontextprotocol/conformance@v0.1.11
@@ -62,6 +68,7 @@ jobs:
6268
expected-failures: ./conformance-tests/conformance-baseline.yml
6369

6470
auth:
71+
if: ${{ github.repository_owner == 'modelcontextprotocol' }}
6572
name: Auth Conformance
6673
runs-on: ubuntu-latest
6774
strategy:
@@ -92,7 +99,7 @@ jobs:
9299
cache: 'maven'
93100

94101
- name: Build client
95-
run: mvn clean install -DskipTests
102+
run: ./mvnw clean install -DskipTests
96103

97104
- name: Run conformance test
98105
uses: modelcontextprotocol/conformance@v0.1.15

.github/workflows/docs.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,12 @@ on:
1515
permissions:
1616
contents: write
1717

18+
env:
19+
MAVEN_ARGS: --no-transfer-progress
20+
1821
jobs:
1922
deploy:
23+
if: ${{ github.repository_owner == 'modelcontextprotocol' }}
2024
runs-on: ubuntu-latest
2125
steps:
2226
- uses: actions/checkout@v4
@@ -37,7 +41,7 @@ jobs:
3741
- name: Deploy docs (push to main)
3842
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
3943
run: |
40-
PROJECT_VERSION=$(mvn help:evaluate -Dexpression=project.version --quiet -DforceStdout)
44+
PROJECT_VERSION=$(./mvnw help:evaluate -Dexpression=project.version --quiet -DforceStdout)
4145
if [[ "${PROJECT_VERSION}" == *-SNAPSHOT ]]; then
4246
ALIAS="latest-snapshot"
4347
else

.github/workflows/maven-central-release.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ name: Release to Maven Central
33
on:
44
workflow_dispatch:
55

6+
env:
7+
MAVEN_ARGS: --no-transfer-progress
8+
69
jobs:
710
publish:
811
runs-on: ubuntu-latest
@@ -27,14 +30,14 @@ jobs:
2730
node-version: '20'
2831

2932
- name: Jackson 2 Integration Tests
30-
run: mvn -pl mcp-test -am -Pjackson2 test
33+
run: ./mvnw -pl mcp-test -am -Pjackson2 test
3134

3235
- name: Build and Test
33-
run: mvn clean verify
36+
run: ./mvnw clean verify
3437

3538
- name: Publish to Maven Central
3639
run: |
37-
mvn --batch-mode \
40+
./mvnw --batch-mode \
3841
-Prelease \
3942
-Pjavadoc \
4043
deploy

.github/workflows/publish-snapshot.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,12 @@ on:
44
push:
55
branches: [ "main" ]
66

7+
env:
8+
MAVEN_ARGS: --no-transfer-progress
9+
710
jobs:
811
build:
12+
if: ${{ github.repository_owner == 'modelcontextprotocol' }}
913
name: Build branch
1014
runs-on: ubuntu-latest
1115
steps:
@@ -30,18 +34,18 @@ jobs:
3034
node-version: '20'
3135

3236
- name: Generate Java docs
33-
run: mvn -Pjavadoc -B javadoc:aggregate
37+
run: ./mvnw -Pjavadoc -B javadoc:aggregate
3438

3539
- name: Jackson 2 Integration Tests
36-
run: mvn -pl mcp-test -am -Pjackson2 test
40+
run: ./mvnw -pl mcp-test -am -Pjackson2 test
3741

3842
- name: Build with Maven and deploy to Sonatype snapshot repository
3943
env:
4044
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
4145
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
4246
MAVEN_GPG_PASSPHRASE: ${{ secrets.SIGNING_PASSPHRASE }}
4347
run: |
44-
mvn -Pjavadoc -Prelease --batch-mode --update-snapshots deploy
48+
./mvnw -Pjavadoc -Prelease --batch-mode --update-snapshots deploy
4549
4650
- name: Capture project version
47-
run: echo PROJECT_VERSION=$(mvn help:evaluate -Dexpression=project.version --quiet -DforceStdout) >> $GITHUB_ENV
51+
run: echo PROJECT_VERSION=$(./mvnw help:evaluate -Dexpression=project.version --quiet -DforceStdout) >> $GITHUB_ENV

0 commit comments

Comments
 (0)