Skip to content

Commit 7b4fbb5

Browse files
authored
feat: support release jar to apache nexus (#176)
1 parent 4194525 commit 7b4fbb5

15 files changed

Lines changed: 93 additions & 92 deletions

File tree

.github/workflows/runner-e2e.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,6 @@ on:
2727
branches:
2828
- main
2929

30-
env:
31-
JAVA_RUNNER_VERSION: 0.2.0
32-
33-
3430
jobs:
3531
run-test:
3632
runs-on: ubuntu-latest
@@ -51,13 +47,14 @@ jobs:
5147

5248
- name: build runner
5349
run: |
50+
sed -i 's/apisix-runner-plugin-sdk/apisix-runner-plugin/' runner-core/pom.xml
5451
cp ./sample/src/main/java/org/apache/apisix/plugin/runner/filter/* ./runner-plugin/src/main/java/org/apache/apisix/plugin/runner/filter/
5552
./mvnw clean install -Dgpg.skip=true
5653
5754
- name: startup runner
5855
run: |
5956
cd dist
60-
tar -zxvf apache-apisix-java-plugin-runner-$JAVA_RUNNER_VERSION-bin.tar.gz
57+
tar -zxvf apache-apisix-java-plugin-runner-*bin.tar.gz
6158
java -jar -DAPISIX_LISTEN_ADDRESS=unix:/tmp/runner.sock -DAPISIX_CONF_EXPIRE_TIME=3600 ./apisix-runner-bin/apisix-java-plugin-runner.jar &
6259
6360
- name: startup apisix

MAINTAIN.md

Lines changed: 8 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -20,55 +20,15 @@
2020
Project Maintenance
2121
=================
2222

23-
Publishing to Maven Central Repository:
23+
## Release steps
2424

25-
1. Create a Jira account by signing up at: https://issues.sonatype.org/secure/Signup!default.jspa
26-
2. Create a new project ticket at: https://issues.sonatype.org/secure/CreateIssue.jspa?issuetype=21&pid=10134 (make sure the Issue Type is *New Project*)
27-
3. Generate a PGP Signature and distribute it to one or more public key servers. To generate a PGP Signature:
28-
```
29-
$ gpg2 --gen-key
25+
### Publish Maven Artifacts
26+
Apache projects release all software packages through the ASF distribution system.
3027

31-
$ gpg: key YOUR_KEY_ID marked as ultimately trusted
32-
```
33-
To distribute:
34-
```
35-
$ gpg2 --keyserver SERVER_NAME --send-keys YOUR_KEY_ID
36-
```
28+
1. Set up your development environment. For more details, see the [Publishing Maven Releases to Maven Central Repository](https://infra.apache.org/publishing-maven-artifacts.html).
3729

38-
4. Find your ~.m2 folder (this folder is hidden on some systems)
39-
5. Update or create your settings.xml to contain your Jira and public key information:
40-
```xml
41-
<settings>
42-
<servers>
43-
<server>
44-
<id>ossrh</id>
45-
<username>jira_username</username>
46-
<password>jira_password</password>
47-
</server>
48-
</servers>
49-
<profiles>
50-
<profile>
51-
<id>ossrh</id>
52-
<activation>
53-
<activeByDefault>true</activeByDefault>
54-
</activation>
55-
<properties>
56-
<gpg.executable>gpg2</gpg.executable>
57-
<gpg.passphrase>your_key_passphrase</gpg.passphrase>
58-
</properties>
59-
</profile>
60-
</profiles>
61-
</settings>
62-
```
63-
6. Run Maven from the project directory
64-
```
65-
$ mvn clean deploy
66-
```
67-
7. Login to nexus repository manager using your Jira account created in step 1 (https://s01.oss.sonatype.org/#welcome)
68-
8. Click on *Staging Repositories* on the left sidebar, your staging repository should be available
69-
9. Click on your staging repository and ensure it contains the correct contents, click *Close*, include a relevant description
70-
10. Wait a few seconds for Sonatype to buffer
71-
11. Click *Release*, include a relevant description
72-
12. Comment your Jira ticket to sync Maven Central with your Group ID
30+
2. Deploy the snapshot artifacts to Apache Nexus
7331

74-
Congratulations! You have released to Maven Central Repository. The search query should sync within a few hours to a day.
32+
```shell
33+
make deploy
34+
```

Makefile

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
SHELL := /bin/bash -o pipefail
1919

20-
VERSION ?= 0.2.0
20+
VERSION ?= 0.3.0-SNAPSHOT
2121
RELEASE_SRC = apisix-java-plugin-runner-${VERSION}-src
2222

2323
.PHONY: release-src
@@ -34,3 +34,12 @@ release-src: compress-tar
3434
compress-tar:
3535
./mvnw package
3636

37+
.PHONY: dry-run
38+
dry-run:
39+
./mvnw release:prepare -pl runner-starter -DdryRun=true -DautoVersionSubmodules=true
40+
./mvnw release:prepare -pl runner-core -DdryRun=true -DautoVersionSubmodules=true
41+
./mvnw release:prepare -pl runner-plugin-sdk -DdryRun=true -DautoVersionSubmodules=true
42+
43+
.PHONY: deploy
44+
deploy:
45+
./mvnw clean deploy -pl runner-starter,runner-core,runner-plugin-sdk -DskipTests=true

pom.xml

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,7 @@
2222

2323
<groupId>org.apache.apisix</groupId>
2424
<artifactId>apisix-plugin-runner</artifactId>
25-
<version>0.2.0</version>
26-
27-
<distributionManagement>
28-
<snapshotRepository>
29-
<id>ossrh</id>
30-
<url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
31-
</snapshotRepository>
32-
<repository>
33-
<id>ossrh</id>
34-
<url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
35-
</repository>
36-
</distributionManagement>
25+
<version>0.3.0-SNAPSHOT</version>
3726

3827
<parent>
3928
<groupId>org.apache</groupId>

runner-core/pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<parent>
2525
<groupId>org.apache.apisix</groupId>
2626
<artifactId>apisix-plugin-runner</artifactId>
27-
<version>0.2.0</version>
27+
<version>0.3.0-SNAPSHOT</version>
2828
</parent>
2929

3030
<artifactId>apisix-runner-core</artifactId>
@@ -35,8 +35,8 @@
3535
<dependencies>
3636
<dependency>
3737
<groupId>org.apache.apisix</groupId>
38-
<artifactId>apisix-runner-plugin</artifactId>
39-
<version>0.2.0</version>
38+
<artifactId>apisix-runner-plugin-sdk</artifactId>
39+
<version>0.3.0-SNAPSHOT</version>
4040
</dependency>
4141
<dependency>
4242
<groupId>org.springframework.boot</groupId>

runner-dist/apisix-runner-bin-dist/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<parent>
2424
<groupId>org.apache.apisix</groupId>
2525
<artifactId>apisix-runner-dist</artifactId>
26-
<version>0.2.0</version>
26+
<version>0.3.0-SNAPSHOT</version>
2727
</parent>
2828

2929
<artifactId>apisix-runner-bin-dist</artifactId>

runner-dist/apisix-runner-src-dist/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<parent>
2424
<groupId>org.apache.apisix</groupId>
2525
<artifactId>apisix-runner-dist</artifactId>
26-
<version>0.2.0</version>
26+
<version>0.3.0-SNAPSHOT</version>
2727
</parent>
2828

2929
<artifactId>apisix-runner-src-dist</artifactId>
@@ -64,7 +64,7 @@
6464
<configuration>
6565
<target>
6666
<copy file="${project.build.directory}/apisix-java-plugin-runner.tgz"
67-
tofile="${project.basedir}/../../apisix-java-plugin-runner-${project.version}-src.tgz"
67+
tofile="${project.basedir}/../../dist/apisix-java-plugin-runner-${project.version}-src.tgz"
6868
overwrite="true" />
6969
</target>
7070
</configuration>

runner-dist/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<parent>
2424
<groupId>org.apache.apisix</groupId>
2525
<artifactId>apisix-plugin-runner</artifactId>
26-
<version>0.2.0</version>
26+
<version>0.3.0-SNAPSHOT</version>
2727
</parent>
2828

2929
<artifactId>apisix-runner-dist</artifactId>
@@ -35,7 +35,7 @@
3535
<dependency>
3636
<groupId>org.apache.apisix</groupId>
3737
<artifactId>apisix-runner-starter</artifactId>
38-
<version>0.2.0</version>
38+
<version>0.3.0-SNAPSHOT</version>
3939
</dependency>
4040
</dependencies>
4141
<modules>

runner-plugin-sdk/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<parent>
2525
<groupId>org.apache.apisix</groupId>
2626
<artifactId>apisix-plugin-runner</artifactId>
27-
<version>0.2.0</version>
27+
<version>0.3.0-SNAPSHOT</version>
2828
</parent>
2929

3030
<artifactId>apisix-runner-plugin-sdk</artifactId>

runner-plugin/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<parent>
2424
<groupId>org.apache.apisix</groupId>
2525
<artifactId>apisix-plugin-runner</artifactId>
26-
<version>0.2.0</version>
26+
<version>0.3.0-SNAPSHOT</version>
2727
</parent>
2828

2929
<artifactId>apisix-runner-plugin</artifactId>
@@ -35,7 +35,7 @@
3535
<dependency>
3636
<groupId>org.apache.apisix</groupId>
3737
<artifactId>apisix-runner-plugin-sdk</artifactId>
38-
<version>0.2.0</version>
38+
<version>0.3.0-SNAPSHOT</version>
3939
</dependency>
4040
<dependency>
4141
<groupId>com.google.code.gson</groupId>

0 commit comments

Comments
 (0)