Skip to content

Commit 95928d9

Browse files
authored
fix: releasing info (#64)
1 parent c39162b commit 95928d9

File tree

3 files changed

+79
-99
lines changed

3 files changed

+79
-99
lines changed

.github/workflows/ci.yaml

+1-19
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ on:
1515

1616
jobs:
1717
ci:
18-
name: Package, Test, and Release
18+
name: Package and Test
1919
runs-on: ubuntu-latest
2020

2121
steps:
@@ -27,24 +27,6 @@ jobs:
2727
with:
2828
java-version: 8
2929
distribution: 'adopt'
30-
server-id: ossrh
31-
server-username: MAVEN_USERNAME
32-
server-password: MAVEN_PASSWORD
33-
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
34-
gpg-passphrase: GPG_PASSPHRASE
35-
cache: maven
36-
37-
- name: Set POM version
38-
# Set the version in the POM to the short commit hash and append
39-
# -SNAPSHOT to the version. This allows us to test the release process
40-
# on branches without having to push a tag. If we are triggered by a
41-
# release event, we set the version to the release version as the tag.
42-
run: |
43-
if [[ $GITHUB_EVENT_NAME == release ]]; then
44-
mvn versions:set -DnewVersion=${GITHUB_REF#refs/tags/} --file posthog/pom.xml
45-
else
46-
mvn versions:set -DnewVersion=$(git rev-parse --short HEAD)-SNAPSHOT --file posthog/pom.xml
47-
fi
4830

4931
- name: Build with Maven
5032
run: mvn package --file posthog/pom.xml -DskipTests --batch-mode --show-version

README.md

-80
Original file line numberDiff line numberDiff line change
@@ -2,83 +2,3 @@
22

33
User guide available on
44
[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.

RELEASING.md

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

0 commit comments

Comments
 (0)