Skip to content
This repository was archived by the owner on Feb 14, 2025. It is now read-only.

Commit ad8bcb5

Browse files
committed
Add github actions for artifactory staging and maven central release
1 parent 586f132 commit ad8bcb5

File tree

2 files changed

+100
-0
lines changed

2 files changed

+100
-0
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Artifactory Staging
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
releaseVersion:
7+
description: "Release version"
8+
required: true
9+
10+
jobs:
11+
build:
12+
name: Stage release to Artifactory
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout source code
16+
uses: actions/checkout@v4
17+
18+
- name: Set up JDK 17
19+
uses: actions/setup-java@v4
20+
with:
21+
java-version: '17'
22+
distribution: 'temurin'
23+
cache: 'maven'
24+
25+
- name: Capture release version
26+
run: echo RELEASE_VERSION=${{ github.event.inputs.releaseVersion }} >> $GITHUB_ENV
27+
28+
- name: Update release version
29+
run: mvn versions:set -DgenerateBackupPoms=false -DnewVersion=$RELEASE_VERSION
30+
31+
- name: Enforce release rules
32+
run: mvn org.apache.maven.plugins:maven-enforcer-plugin:enforce -Drules=requireReleaseDeps
33+
34+
- name: Build with Maven and deploy to Artifactory staging repository
35+
env:
36+
ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }}
37+
ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
38+
run: mvn -P artifactory-staging -s settings.xml --batch-mode -Dmaven.test.skip=true deploy
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Maven Central Release
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
releaseVersion:
7+
description: "Release version"
8+
required: true
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
steps:
14+
15+
- name: Capture release version
16+
run: echo RELEASE_VERSION=${{ github.event.inputs.releaseVersion }} >> $GITHUB_ENV
17+
18+
- name: Prepare directory structure
19+
run: |
20+
mkdir -p nexus/org/springframework/experimental/spring-ai-mcp/$RELEASE_VERSION
21+
mkdir -p nexus/org/springframework/experimental/spring-ai-mcp-core/$RELEASE_VERSION
22+
mkdir -p nexus/org/springframework/experimental/spring-ai-mcp-spring/$RELEASE_VERSION
23+
24+
- name: Download release files from Artifactory
25+
env:
26+
ARTIFACTORY_URL: "https://repo.spring.io/libs-staging-local/org/springframework/experimental"
27+
ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }}
28+
ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
29+
run: |
30+
echo "Downloading parent POM artifacts"
31+
cd nexus/org/springframework/experimental/spring-ai-mcp/$RELEASE_VERSION
32+
wget --user="$ARTIFACTORY_USERNAME" --password="$ARTIFACTORY_PASSWORD" $ARTIFACTORY_URL/spring-ai-mcp/$RELEASE_VERSION/spring-ai-mcp-$RELEASE_VERSION.pom
33+
34+
echo "Downloading core artifacts"
35+
cd ../../../../../..
36+
cd nexus/org/springframework/experimental/spring-ai-mcp-core/$RELEASE_VERSION
37+
wget --user="$ARTIFACTORY_USERNAME" --password="$ARTIFACTORY_PASSWORD" $ARTIFACTORY_URL/spring-ai-mcp-core/$RELEASE_VERSION/spring-ai-mcp-core-$RELEASE_VERSION.pom
38+
wget --user="$ARTIFACTORY_USERNAME" --password="$ARTIFACTORY_PASSWORD" $ARTIFACTORY_URL/spring-ai-mcp-core/$RELEASE_VERSION/spring-ai-mcp-core-$RELEASE_VERSION.jar
39+
wget --user="$ARTIFACTORY_USERNAME" --password="$ARTIFACTORY_PASSWORD" $ARTIFACTORY_URL/spring-ai-mcp-core/$RELEASE_VERSION/spring-ai-mcp-core-$RELEASE_VERSION-javadoc.jar
40+
wget --user="$ARTIFACTORY_USERNAME" --password="$ARTIFACTORY_PASSWORD" $ARTIFACTORY_URL/spring-ai-mcp-core/$RELEASE_VERSION/spring-ai-mcp-core-$RELEASE_VERSION-sources.jar
41+
42+
echo "Downloading spring artifacts"
43+
cd ../../../../../..
44+
cd nexus/org/springframework/experimental/spring-ai-mcp-spring/$RELEASE_VERSION
45+
wget --user="$ARTIFACTORY_USERNAME" --password="$ARTIFACTORY_PASSWORD" $ARTIFACTORY_URL/spring-ai-mcp-spring/$RELEASE_VERSION/spring-ai-mcp-spring-$RELEASE_VERSION.pom
46+
wget --user="$ARTIFACTORY_USERNAME" --password="$ARTIFACTORY_PASSWORD" $ARTIFACTORY_URL/spring-ai-mcp-spring/$RELEASE_VERSION/spring-ai-mcp-spring-$RELEASE_VERSION.jar
47+
wget --user="$ARTIFACTORY_USERNAME" --password="$ARTIFACTORY_PASSWORD" $ARTIFACTORY_URL/spring-ai-mcp-spring/$RELEASE_VERSION/spring-ai-mcp-spring-$RELEASE_VERSION-javadoc.jar
48+
wget --user="$ARTIFACTORY_USERNAME" --password="$ARTIFACTORY_PASSWORD" $ARTIFACTORY_URL/spring-ai-mcp-spring/$RELEASE_VERSION/spring-ai-mcp-spring-$RELEASE_VERSION-sources.jar
49+
50+
- name: Sign artifacts and release them to Maven Central
51+
uses: spring-io/nexus-sync-action@main
52+
id: nexus
53+
with:
54+
url: ${{ secrets.OSSRH_URL }}
55+
username: ${{ secrets.OSSRH_S01_TOKEN_USERNAME }}
56+
password: ${{ secrets.OSSRH_S01_TOKEN_PASSWORD }}
57+
staging-profile-name: ${{ secrets.OSSRH_STAGING_PROFILE_NAME }}
58+
create: true
59+
upload: true
60+
close: true
61+
release: true
62+
generate-checksums: true

0 commit comments

Comments
 (0)