You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/secrets.md
+46-4Lines changed: 46 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,38 @@
1
1
# Publishing Secrets
2
2
3
-
## Generate a PGP key
3
+
To publish to [Sonatype/Maven Central](https://central.sonatype.org/) you must obtain and install the following secrets on your repository:
4
4
5
-
Key generation occurs locally in your browser using [OpenPGP.js](https://github.com/openpgpjs/openpgpjs).
5
+
-`SONATYPE_USERNAME` and `SONATYPE_PASSWORD`
6
+
-`PGP_SECRET`
7
+
8
+
Note that `PGP_PASSPHRASE` is not required for publishing with **sbt-typelevel**, although it is supported if you already have a passphrase-protected key.
9
+
10
+
The instructions provided here are adapted from [sbt/sbt-ci-release](https://github.com/sbt/sbt-ci-release/blob/9625d103cfe9fc0f727ee7903957acdf3ef85fcf/readme.md#sonatype) and [@SystemFw/base.g8
If this is your first time publishing, first follow the [Initial Setup](https://central.sonatype.org/publish/publish-guide/#initial-setup) directions in Sonatype's [Publishing Guide](https://central.sonatype.org/publish/publish-guide/) to create an account and request publishing rights for your domain name. If you do not have a domain, you may use `io.github.your_gh_handle` as your **Group Id**.
16
+
17
+
After you've been granted publishing rights for your domain, log in to either:
-https://oss.sonatype.org (domains registered before February 2021)
21
+
22
+
Then:
23
+
24
+
1. Click your username in the top right, then click **Profile**
25
+
2. In the drop-down menu in the top left, select **User Token**
26
+
3. Click the **Access User Token** button to obtain your Sonatype credentials
27
+
4. Set these as the `SONATYPE_USERNAME` and `SONATYPE_PASSWORD` secrets on your repository
28
+
29
+
## PGP Key
30
+
31
+
[Sonatype requires](https://central.sonatype.org/publish/requirements/#sign-files-with-gpgpgp) that all artifacts published to Central are cryptographically signed. **sbt-typelevel** automatically signs your artifacts in CI during publishing but you must provide a secret key.
32
+
33
+
### Option 1: Generate a key pair in your browser
34
+
35
+
You can use the following form to easily generate a key pair locally in your browser with [OpenPGP.js](https://github.com/openpgpjs/openpgpjs).
First, follow the directions provided by [Sonatype](https://central.sonatype.org/publish/requirements/gpg/) to generate a key pair and submit the public key to a key server.
76
+
77
+
Then, export your secret key with the following command and set it as the `PGP_SECRET` repository secret.
0 commit comments