|
2 | 2 |
|
3 | 3 | User guide available on
|
4 | 4 | [posthog.com/docs/integrate/server/java](https://posthog.com/docs/libraries/java).
|
5 |
| - |
6 |
| - |
7 |
| -## Releasing |
8 |
| - |
9 |
| -We're using Sonatype OSSRH to host our open source project binaries. Docs: |
10 |
| -https://central.sonatype.org/publish/publish-guide/ |
11 |
| - |
12 |
| -### Manual deployment |
13 |
| - |
14 |
| -#### 1. Get access to be able to deploy |
15 |
| - |
16 |
| -1. First create an account to access JIRA and later the repository manager |
17 |
| - https://issues.sonatype.org/secure/Signup!default.jspa |
18 |
| -2. Create a ticket similar to https://issues.sonatype.org/browse/OSSRH-59076 & |
19 |
| - get one of the people who already have access to comment on the request with |
20 |
| - approval (you can ask in #team-platform channel). |
21 |
| -3. Log in to https://oss.sonatype.org/ |
22 |
| -4. Click on your user, then "User Profile" and then get the "User Token", this is the username and password you will use in the next steps. |
23 |
| - |
24 |
| -#### 2. Prepare your local setup |
25 |
| - |
26 |
| -1. Create a gpg key and distribute your public key, see docs here: |
27 |
| - https://central.sonatype.org/publish/requirements/gpg/ (we will need the |
28 |
| - passphase to be specified in the settings file below). |
29 |
| -3. Create a `~/.m2/settings.xml` file with this content (replace the capitalized |
30 |
| - terms) |
31 |
| -``` |
32 |
| -<settings> |
33 |
| - <servers> |
34 |
| - <server> |
35 |
| - <id>ossrh</id> |
36 |
| - <username>YOUR_SONATYPE_USERNAME</username> |
37 |
| - <password>YOUR_SONATYPE_PASSWORD</password> |
38 |
| - </server> |
39 |
| - </servers> |
40 |
| - <profiles> |
41 |
| - <profile> |
42 |
| - <id>ossrh</id> |
43 |
| - <activation> |
44 |
| - <activeByDefault>true</activeByDefault> |
45 |
| - </activation> |
46 |
| - <properties> |
47 |
| - <gpg.executable>gpg</gpg.executable> |
48 |
| - <gpg.keyname>GPG_KEY_ID</gpg.keyname> |
49 |
| - <gpg.passphrase>GPG_PASSPHRASE</gpg.passphrase> |
50 |
| - </properties> |
51 |
| - </profile> |
52 |
| - </profiles> |
53 |
| -</settings> |
54 |
| -``` |
55 |
| - |
56 |
| -If your password has special characters, use an environment variable instead (and omit the `<gpg.passphrase>` xml): |
57 |
| - |
58 |
| -```bash |
59 |
| -export GPG_PASSPHRASE="..." |
60 |
| -``` |
61 |
| - |
62 |
| -If maven complains your private key is not available on keyserver.ubuntu.com |
63 |
| - |
64 |
| -```bash |
65 |
| -gpg --list-secret-keys --keyid-format LONG |
66 |
| -# returns something like: |
67 |
| -# sec ed12345/123F1234FE56565 2023-09-22 [SC] |
68 |
| -# the ID will be the part after the slash, in this case `123F1234FE56565`. |
69 |
| -gpg --keyserver keyserver.ubuntu.com --send-keys 123F1234FE56565 |
70 |
| -``` |
71 |
| - |
72 |
| -#### 3. Deploy |
73 |
| - |
74 |
| -1. Change the version in `posthog/pom.xml` accordingly (latest versions can be |
75 |
| - found here: https://search.maven.org/search?q=com.posthog.java) |
76 |
| -2. Run `mvn deploy` in `posthog-java/posthog` folder. |
77 |
| - |
78 |
| -#### 4. Close and release |
79 |
| - |
80 |
| -1. In https://oss.sonatype.org/#stagingRepositories you should see your just |
81 |
| - pushed files. Click "Close" and check the activity tab to make sure all |
82 |
| - validations passed (wait and refresh). |
83 |
| -2. After all validations passed the Release button will become available to |
84 |
| - publish the new version. |
0 commit comments