diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 1e1c987..9337f7f 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -15,7 +15,7 @@ on: jobs: ci: - name: Package, Test, and Release + name: Package and Test runs-on: ubuntu-latest steps: @@ -27,24 +27,6 @@ jobs: with: java-version: 8 distribution: 'adopt' - server-id: ossrh - server-username: MAVEN_USERNAME - server-password: MAVEN_PASSWORD - gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} - gpg-passphrase: GPG_PASSPHRASE - cache: maven - - - name: Set POM version - # Set the version in the POM to the short commit hash and append - # -SNAPSHOT to the version. This allows us to test the release process - # on branches without having to push a tag. If we are triggered by a - # release event, we set the version to the release version as the tag. - run: | - if [[ $GITHUB_EVENT_NAME == release ]]; then - mvn versions:set -DnewVersion=${GITHUB_REF#refs/tags/} --file posthog/pom.xml - else - mvn versions:set -DnewVersion=$(git rev-parse --short HEAD)-SNAPSHOT --file posthog/pom.xml - fi - name: Build with Maven run: mvn package --file posthog/pom.xml -DskipTests --batch-mode --show-version diff --git a/README.md b/README.md index 9a63d02..e9a6ce8 100644 --- a/README.md +++ b/README.md @@ -2,83 +2,3 @@ User guide available on [posthog.com/docs/integrate/server/java](https://posthog.com/docs/libraries/java). - - -## Releasing - -We're using Sonatype OSSRH to host our open source project binaries. Docs: -https://central.sonatype.org/publish/publish-guide/ - -### Manual deployment - -#### 1. Get access to be able to deploy - -1. First create an account to access JIRA and later the repository manager - https://issues.sonatype.org/secure/Signup!default.jspa -2. Create a ticket similar to https://issues.sonatype.org/browse/OSSRH-59076 & - get one of the people who already have access to comment on the request with - approval (you can ask in #team-platform channel). -3. Log in to https://oss.sonatype.org/ -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. - -#### 2. Prepare your local setup - -1. Create a gpg key and distribute your public key, see docs here: - https://central.sonatype.org/publish/requirements/gpg/ (we will need the - passphase to be specified in the settings file below). -3. Create a `~/.m2/settings.xml` file with this content (replace the capitalized - terms) -``` - - - - ossrh - YOUR_SONATYPE_USERNAME - YOUR_SONATYPE_PASSWORD - - - - - ossrh - - true - - - gpg - GPG_KEY_ID - GPG_PASSPHRASE - - - - -``` - -If your password has special characters, use an environment variable instead (and omit the `` xml): - -```bash -export GPG_PASSPHRASE="..." -``` - -If maven complains your private key is not available on keyserver.ubuntu.com - -```bash -gpg --list-secret-keys --keyid-format LONG -# returns something like: -# sec ed12345/123F1234FE56565 2023-09-22 [SC] -# the ID will be the part after the slash, in this case `123F1234FE56565`. -gpg --keyserver keyserver.ubuntu.com --send-keys 123F1234FE56565 -``` - -#### 3. Deploy - -1. Change the version in `posthog/pom.xml` accordingly (latest versions can be - found here: https://search.maven.org/search?q=com.posthog.java) -2. Run `mvn deploy` in `posthog-java/posthog` folder. - -#### 4. Close and release - -1. In https://oss.sonatype.org/#stagingRepositories you should see your just - pushed files. Click "Close" and check the activity tab to make sure all - validations passed (wait and refresh). -2. After all validations passed the Release button will become available to - publish the new version. diff --git a/RELEASING.md b/RELEASING.md new file mode 100644 index 0000000..df03629 --- /dev/null +++ b/RELEASING.md @@ -0,0 +1,78 @@ +## Releasing + +We're using Sonatype OSSRH to host our open source project binaries. Docs: +https://central.sonatype.org/publish/publish-guide/ + +### Manual deployment + +#### 1. Get access to be able to deploy + +1. First create an account to access JIRA and later the repository manager + https://issues.sonatype.org/secure/Signup!default.jspa +2. Create a ticket similar to https://issues.sonatype.org/browse/OSSRH-59076 & + get one of the people who already have access to comment on the request with + approval (you can ask in #team-platform channel). +3. Log in to https://oss.sonatype.org/ +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. + +#### 2. Prepare your local setup + +1. Create a gpg key and distribute your public key, see docs here: + https://central.sonatype.org/publish/requirements/gpg/ (we will need the + passphase to be specified in the settings file below). +3. Create a `~/.m2/settings.xml` file with this content (replace the capitalized + terms) +``` + + + + ossrh + YOUR_SONATYPE_USERNAME + YOUR_SONATYPE_PASSWORD + + + + + ossrh + + true + + + gpg + GPG_KEY_ID + GPG_PASSPHRASE + + + + +``` + +If your password has special characters, use an environment variable instead (and omit the `` xml): + +```bash +export GPG_PASSPHRASE="..." +``` + +If maven complains your private key is not available on keyserver.ubuntu.com + +```bash +gpg --list-secret-keys --keyid-format LONG +# returns something like: +# sec ed12345/123F1234FE56565 2023-09-22 [SC] +# the ID will be the part after the slash, in this case `123F1234FE56565`. +gpg --keyserver keyserver.ubuntu.com --send-keys 123F1234FE56565 +``` + +#### 3. Deploy + +1. Change the version in `posthog/pom.xml` accordingly (latest versions can be + found here: https://search.maven.org/search?q=com.posthog.java) +2. Run `mvn deploy` in `posthog-java/posthog` folder. + +#### 4. Close and release + +1. In https://oss.sonatype.org/#stagingRepositories you should see your just + pushed files. Click "Close" and check the activity tab to make sure all + validations passed (wait and refresh). +2. After all validations passed the Release button will become available to + publish the new version.