Skip to content

Commit a6dd522

Browse files
authored
docs: update manual release process (#126)
1 parent 393bbee commit a6dd522

File tree

1 file changed

+45
-9
lines changed

1 file changed

+45
-9
lines changed

README.md

+45-9
Original file line numberDiff line numberDiff line change
@@ -157,20 +157,56 @@ To enforce code style and formatting rules, run the Maven Spotless plugin:
157157
mvn spotless:apply
158158
```
159159

160-
## Release
160+
## Release Process
161161

162-
1. Tag the commit according to the [semantic versioning](https://semver.org/).
162+
### Step 1 - Create a Release Pull Request
163163

164-
1. Bump version in `pom.xml`.
164+
#### Step 1.a - Generate a JSON Web Token (JWT)
165165

166-
1. Run the following commands:
166+
To initiate the release process, start by generating a JSON Web Token (JWT) using one of the provided scripts in [Generate a JSON Web Token (JWT)](https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/generating-a-json-web-token-jwt-for-a-github-app). Ensure to specify the path where the `developer-experience-bot` private key is stored (can be found in password manager).
167167

168-
1. `mvn -P release clean deploy`.
168+
#### Step 1.b - Obtain an Access Token
169169

170-
1. `cd ./target`.
170+
Next, obtain an access token by executing the following command, replacing `<JSON_TOKEN>` and `<RELEASER_INSTALLATION_ID>` with the JWT token created in the previous step and the respective releaser installation id.
171171

172-
1. `jar -cvf bundle.jar push-api-client.java-1.0.0-javadoc.jar push-api-client.java-1.0.0-javadoc.jar.asc push-api-client.java-1.0.0-sources.jar push-api-client.java-1.0.0-sources.jar.asc push-api-client.java-1.0.0.jar push-api-client.java-1.0.0.jar.asc push-api-client.java-1.0.0.pom push-api-client.java-1.0.0.pom.asc`
172+
```bash
173+
curl -i -X POST \
174+
-H "Authorization: Bearer <JSON_TOKEN>" \
175+
-H "Accept: application/vnd.github.v3+json" \
176+
https://api.github.com/app/installations/<RELEASER_INSTALLATION_ID>/access_tokens
177+
```
178+
179+
#### Step 1.c - Create a Release Pull Request
180+
181+
Using the access token generated in the previous step, create a release Pull Request. This PR will automatically include the appropriate version bump and update the changelog. Initially, run the command with the `--dry-run` flag to ensure the PR is created with the correct version.
182+
183+
```bash
184+
release-please release-pr \
185+
--token=<ACCESS_TOKEN> \
186+
--repo-url=coveo/push-api-client.java \
187+
--release-type=maven \
188+
--target-branch=main \
189+
```
190+
191+
In case the command creates a pull request with an incorrect tag, manually create a pull request and perform an empty commit as follows:
192+
193+
```bash
194+
git commit --allow-empty -m "chore: release x.x.x" -m "Release-As: x.x.x"
195+
```
196+
197+
This action will prompt `release-please` to bump to the desired version on the next run. Finally, merge the pull request and repeat Step 1.c.
198+
199+
### Step 2 - Tag the Commit
200+
201+
1. Tag the commit according to [semantic versioning](https://semver.org/) principles.
202+
203+
```bash
204+
git tag -a vx.x.x <COMMIT_SHA> -m "chore(main): release x.x.x (#<PULL_REQUEST_NUMBER>)"
205+
git push --tags
206+
```
207+
208+
2. Merge the Pull Request.
173209

174-
1. Log in to https://oss.sonatype.org/.
210+
### Step 3 - Manually Create a Release
175211

176-
1. Upload the newly created `bundle.jar` file.
212+
Lastly, manually create a release on the [GitHub repository](https://github.com/coveo/push-api-client.java/releases). This action will trigger the package deploy workflow action.

0 commit comments

Comments
 (0)