Skip to content

Commit a3c508a

Browse files
committed
testing deploy action
1 parent a32f878 commit a3c508a

File tree

2 files changed

+43
-50
lines changed

2 files changed

+43
-50
lines changed

.github/workflows/deploy-action.yml

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,30 +5,33 @@ on:
55
branches:
66
- main
77
- develop
8+
release:
9+
types: [ created ]
810

911
jobs:
10-
deploy:
12+
publish:
1113
runs-on: ubuntu-latest
1214
steps:
13-
- name: Check out Git repository
15+
- name: Check out git repository
1416
uses: actions/checkout@v4
1517

16-
- name: Install Java and Maven
18+
- name: Install java and maven
1719
uses: actions/setup-java@v4
1820
with:
19-
java-version: 11
2021
distribution: 'zulu'
22+
java-version: '11'
23+
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
24+
gpg-passphrase: ${{ secrets.GPG_PASSPHRASE }}
2125

2226
- name: Test Maven package
2327
run: mvn -B test --file pom.xml
2428

2529
- name: Build Maven package
2630
run: mvn -B package --file pom.xml -DskipTests
2731

28-
- name: Deploy Sonatype
29-
run: mvn -P deploy --batch-mode deploy -DskipTests
32+
- name: Publish Sonatype
33+
run: mvn --batch-mode deploy -DskipTests
3034
env:
31-
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
32-
gpg_passphrase: ${{ secrets.GPG_PASSPHRASE }}
33-
nexus_username: ${{ secrets.OSSRH_USERNAME }}
34-
nexus_password: ${{ secrets.OSSRH_PASSWORD }}
35+
MAVEN_USERNAME: ${{ secrets.CENTRAL_TOKEN_USERNAME }}
36+
MAVEN_PASSWORD: ${{ secrets.CENTRAL_TOKEN_PASSWORD }}
37+
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}

pom.xml

Lines changed: 30 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,36 @@
101101
</execution>
102102
</executions>
103103
</plugin>
104+
<plugin>
105+
<groupId>org.apache.maven.plugins</groupId>
106+
<artifactId>maven-gpg-plugin</artifactId>
107+
<version>3.2.7</version>
108+
<executions>
109+
<execution>
110+
<id>sign-artifacts</id>
111+
<phase>verify</phase>
112+
<goals>
113+
<goal>sign</goal>
114+
</goals>
115+
<configuration>
116+
<gpgArguments>
117+
<arg>--pinentry-mode</arg>
118+
<arg>loopback</arg>
119+
</gpgArguments>
120+
</configuration>
121+
</execution>
122+
</executions>
123+
</plugin>
124+
<plugin>
125+
<groupId>org.sonatype.central</groupId>
126+
<artifactId>central-publishing-maven-plugin</artifactId>
127+
<version>0.7.0</version>
128+
<extensions>true</extensions>
129+
<configuration>
130+
<publishingServerId>central</publishingServerId>
131+
<autoPublish>true</autoPublish>
132+
</configuration>
133+
</plugin>
104134
</plugins>
105135
<resources>
106136
<resource>
@@ -109,44 +139,4 @@
109139
</resource>
110140
</resources>
111141
</build>
112-
<profiles>
113-
<profile>
114-
<id>deploy</id>
115-
<build>
116-
<plugins>
117-
<plugin>
118-
<groupId>org.sonatype.central</groupId>
119-
<artifactId>central-publishing-maven-plugin</artifactId>
120-
<version>0.7.0</version>
121-
<extensions>true</extensions>
122-
<configuration>
123-
<publishingServerId>central</publishingServerId>
124-
<tokenAuth>true</tokenAuth>
125-
<autoPublish>true</autoPublish>
126-
</configuration>
127-
</plugin>
128-
<plugin>
129-
<groupId>org.apache.maven.plugins</groupId>
130-
<artifactId>maven-gpg-plugin</artifactId>
131-
<version>3.2.7</version>
132-
<executions>
133-
<execution>
134-
<id>sign-artifacts</id>
135-
<phase>verify</phase>
136-
<goals>
137-
<goal>sign</goal>
138-
</goals>
139-
<configuration>
140-
<gpgArguments>
141-
<arg>--pinentry-mode</arg>
142-
<arg>loopback</arg>
143-
</gpgArguments>
144-
</configuration>
145-
</execution>
146-
</executions>
147-
</plugin>
148-
</plugins>
149-
</build>
150-
</profile>
151-
</profiles>
152142
</project>

0 commit comments

Comments
 (0)