Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 1 addition & 50 deletions docs/publish-sdk.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,6 @@ Java and C# require additional setup after running `speakeasy configure publishi

#### Java Maven: Sonatype Central Portal (recommended)

For legacy OSSRH publishing support, see the next section.

1. Create a [Sonatype Central Portal account](https://central.sonatype.org/register/central-portal/) (if needed).
2. Generate a [Sonatype username and password for authentication](https://central.sonatype.org/publish/generate-portal-token/). Save these for step 5.
3. Create a [Sonatype namespace](https://central.sonatype.org/register/central-portal/#choosing-a-namespace).
Expand Down Expand Up @@ -137,55 +135,8 @@ For legacy OSSRH publishing support, see the next section.
companyEmail: info@mycompany.com
```

#### Java Maven: Sonatype legacy OSSRH

1. Create an [OSSRH staging repository](https://central.sonatype.org/publish/publish-guide/).
2. Create a GPG key to [sign the artifacts](https://central.sonatype.org/publish/requirements/gpg/). Save these for step 3.
- Install GnuPG: `brew install gnupg`
- Generate a key: `gpg --gen-key`. Note the key ID (e.g., `CA925CD6C9E8D064FF05B4728190C4130ABA0F98`) and short ID (e.g., `0ABA0F98`).
- Send the key: `gpg --keyserver keys.openpgp.org --send-keys <keyId>`
- Note: The following key servers can also be used: `keyserver.ubuntu.com`, `keys.openpgp.org`, or `pgp.mit.edu`
- Export the secret key: `gpg --export-secret-keys --armor <shortId> > secret_key.asc`
- The file `secret_key.asc` will contain the GPG secret key.
3. Store the following secrets Github actions secrets:
- `OSSRH_USERNAME`
- `OSSRH_PASSWORD`
- `JAVA_GPG_SECRET_KEY`
- `JAVA_GPG_PASSPHRASE`
4. In the [Speakeasy workflow file](/docs/workflow-file-reference), add `useSonatypeLegacy: true`:
```yaml
workflowVersion: 1.0.0
speakeasyVersion: latest
sources:
my_source.yaml:
inputs:
- location: my_source.yaml
targets:
java:
target: java
source: my_source.yaml
publish:
java:
#add useSonatypeLegacy: true
useSonatypeLegacy: true
ossrhUsername: test
ossrhPassword: $ossrh_password
gpgSecretKey: $java_gpg_secret_key
gpgPassPhrase: $java_gpg_passphrase
```
5. In the java section of `gen.yaml`, provide the additional configuration required for publishing to Sonatype legacy:
```yaml
java:
#ensure the `groupID` matches the OSSRH org
groupID: com.example
#ensure the `artificatID` matches the artifact name:
artifactID: example-sdk
ossrhURL: https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/
githubURL: github.com/org/repo
companyName: My Company
companyURL: https://www.mycompany.com
companyEmail: info@mycompany.com
```


#### C# NuGet

Expand Down
4 changes: 2 additions & 2 deletions docs/speakeasy-reference/generation/ci-cd-pipeline.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -169,12 +169,12 @@ secrets:
{
name: "ossrh_username",
description:
"Username for publishing the Java package to the OSSRH repository.",
"Username for publishing the Java package to Sonatype Central Portal.",
},
{
name: "ossrh_password",
description:
"Password for publishing the Java package to the OSSRH repository.",
"Password for publishing the Java package to Sonatype Central Portal.",
},
{
name: "java_gpg_secret_key",
Expand Down
9 changes: 1 addition & 8 deletions docs/speakeasy-reference/generation/java-config.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ java:
java:
groupID: "com.mycompany"
artifactID: "my-sdk"
ossrhURL: "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
githubURL: "https://github.com/mycompany/my-sdk"
companyName: "My Company"
companyURL: "https://www.mycompany.com"
Expand All @@ -65,13 +64,7 @@ java:
description:
"The artifact ID used for namespacing the package, usually the name of the project.",
},
{
name: "ossrhURL",
required: "false",
default: "N/A",
description:
"The URL of the staging repository to publish the SDK artifact to.",
},

{
name: "githubURL",
required: "for publishing",
Expand Down
Loading