1
- name : Maven Central Release
1
+ name : Release to Maven Central
2
2
3
3
on :
4
4
workflow_dispatch :
9
9
10
10
jobs :
11
11
build :
12
+ name : Release project
12
13
runs-on : ubuntu-latest
14
+
13
15
steps :
14
16
15
- - name : Capture release version
16
- run : echo RELEASE_VERSION=${{ github.event.inputs.releaseVersion }} >> $GITHUB_ENV
17
+ - name : Check out sources
18
+ uses : actions/checkout@v4
19
+
20
+ - name : Set up JDK 17
21
+ uses : actions/setup-java@v3
22
+ with :
23
+ distribution : ' temurin'
24
+ java-version : 17
25
+ cache : ' maven'
17
26
18
- - name : Prepare directory structure
27
+ - name : Install GPG key
19
28
run : |
20
- mkdir -p nexus/org/springframework/ai/spring-ai-core/$RELEASE_VERSION
21
- mkdir -p nexus/org/springframework/ai/spring-ai-openai/$RELEASE_VERSION
22
- mkdir -p nexus/org/springframework/ai/spring-ai-azure-openai/$RELEASE_VERSION
23
- mkdir -p nexus/org/springframework/ai/spring-ai-spring-boot-autoconfigure/$RELEASE_VERSION
29
+ echo "${{ secrets.GPG_PRIVATE_KEY }}" > gpg.asc
30
+ echo "${{ secrets.GPG_PASSPHRASE }}" | gpg --batch --yes --passphrase-fd 0 --import gpg.asc
24
31
25
- - name : Download release files from Artifactory
32
+ - name : Release to Sonatype OSSRH
26
33
env :
27
- ARTIFACTORY_URL : " https://repo.spring.io/libs-staging-local/org/springframework/ai"
28
- run : |
29
- echo "Downloading core artifacts"
30
- cd ../../../../../..
31
- cd nexus/org/springframework/ai/spring-ai-core/$RELEASE_VERSION
32
- wget $ARTIFACTORY_URL/spring-ai-core/$RELEASE_VERSION/spring-ai-core-$RELEASE_VERSION.pom
33
- wget $ARTIFACTORY_URL/spring-ai-core/$RELEASE_VERSION/spring-ai-core-$RELEASE_VERSION.jar
34
- wget $ARTIFACTORY_URL/spring-ai-core/$RELEASE_VERSION/spring-ai-core-$RELEASE_VERSION-javadoc.jar
35
- wget $ARTIFACTORY_URL/spring-ai-core/$RELEASE_VERSION/spring-ai-core-$RELEASE_VERSION-sources.jar
36
-
37
- echo "Downloading openai artifacts"
38
- cd ../../../../../..
39
- cd nexus/org/springframework/batch/spring-ai-openai/$RELEASE_VERSION
40
- wget $ARTIFACTORY_URL/spring-ai-openai/$RELEASE_VERSION/spring-ai-openai-$RELEASE_VERSION.pom
41
- wget $ARTIFACTORY_URL/spring-ai-openai/$RELEASE_VERSION/spring-ai-openai-$RELEASE_VERSION.jar
42
- wget $ARTIFACTORY_URL/spring-ai-openai/$RELEASE_VERSION/spring-ai-openai-$RELEASE_VERSION-javadoc.jar
43
- wget $ARTIFACTORY_URL/spring-ai-openai/$RELEASE_VERSION/spring-ai-openai-$RELEASE_VERSION-sources.jar
44
-
45
- echo "Downloading azure openai artifacts"
46
- cd ../../../../../..
47
- cd nexus/org/springframework/batch/spring-ai-azure-openai/$RELEASE_VERSION
48
- wget $ARTIFACTORY_URL/spring-ai-azure-openai/$RELEASE_VERSION/spring-ai-azure-openai-$RELEASE_VERSION.pom
49
- wget $ARTIFACTORY_URL/spring-ai-azure-openai/$RELEASE_VERSION/spring-ai-azure-openai-$RELEASE_VERSION.jar
50
- wget $ARTIFACTORY_URL/spring-ai-azure-openai/$RELEASE_VERSION/spring-ai-azure-openai-$RELEASE_VERSION-javadoc.jar
51
- wget $ARTIFACTORY_URL/spring-ai-azure-openai/$RELEASE_VERSION/spring-ai-azure-openai-$RELEASE_VERSION-sources.jar
34
+ SONATYPE_USER : ${{ secrets.OSSRH_S01_TOKEN_USERNAME }}
35
+ SONATYPE_PASSWORD : ${{ secrets.OSSRH_S01_TOKEN_PASSWORD }}
36
+ MAVEN_GPG_PASSPHRASE : ${{ secrets.GPG_PASSPHRASE }}
37
+ run : |
38
+ ./mvnw -B clean install -DskipTests
39
+ ./mvnw -B clean deploy -Psonatype -s settings.xml
52
40
53
- echo "Downloading autoconfiguration artifacts"
54
- cd ../../../../../..
55
- cd nexus/org/springframework/batch/spring-ai-spring-boot-autoconfigure/$RELEASE_VERSION
56
- wget $ARTIFACTORY_URL/spring-ai-spring-boot-autoconfigure/$RELEASE_VERSION/spring-ai-spring-boot-autoconfigure-$RELEASE_VERSION.pom
57
- wget $ARTIFACTORY_URL/spring-ai-spring-boot-autoconfigure/$RELEASE_VERSION/spring-ai-spring-boot-autoconfigure-$RELEASE_VERSION.jar
58
- wget $ARTIFACTORY_URL/spring-ai-spring-boot-autoconfigure/$RELEASE_VERSION/spring-ai-spring-boot-autoconfigure-$RELEASE_VERSION-javadoc.jar
59
- wget $ARTIFACTORY_URL/spring-ai-spring-boot-autoconfigure/$RELEASE_VERSION/spring-ai-spring-boot-autoconfigure-$RELEASE_VERSION-sources.jar
41
+ - name : Setup Graphviz
42
+ uses : ts-graphviz/setup-graphviz@v1
60
43
61
- - name : Sign artifacts and release them to Maven Central
62
- uses : jvalkeal/nexus-sync@v0
63
- id : nexus
64
- with :
65
- url : ${{ secrets.OSSRH_URL }}
66
- username : ${{ secrets.OSSRH_S01_TOKEN_USERNAME }}
67
- password : ${{ secrets.OSSRH_S01_TOKEN_PASSWORD }}
68
- staging-profile-name : ${{ secrets.OSSRH_STAGING_PROFILE_NAME }}
69
- create : true
70
- upload : true
71
- close : true
72
- release : true
73
- generate-checksums : true
74
- pgp-sign : true
75
- pgp-sign-passphrase : ${{ secrets.GPG_PASSPHRASE }}
76
- pgp-sign-private-key : ${{ secrets.GPG_PRIVATE_KEY }}
44
+ - name : Deploy documentation
45
+ env :
46
+ ARTIFACTORY_USERNAME : ${{ secrets.ARTIFACTORY_USERNAME }}
47
+ ARTIFACTORY_PASSWORD : ${{ secrets.ARTIFACTORY_PASSWORD }}
48
+ run : ./mvnw -B clean deploy -Pdocumentation
0 commit comments