Skip to content

Commit

Permalink
Switch to using token user name and password (#792)
Browse files Browse the repository at this point in the history
  • Loading branch information
bryan-aguilar authored Apr 19, 2024
1 parent a7eb7b1 commit dc29a0c
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/main-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ jobs:
with:
arguments: build integrationTests snapshot --stacktrace -PenableCoverage=true -PlocalDocker=true
env:
PUBLISH_USERNAME: ${{ secrets.PUBLISH_USERNAME }}
PUBLISH_PASSWORD: ${{ secrets.PUBLISH_PASSWORD }}
PUBLISH_TOKEN_USERNAME: ${{ secrets.PUBLISH_TOKEN_USERNAME }}
PUBLISH_TOKEN_PASSWORD: ${{ secrets.PUBLISH_TOKEN_PASSWORD }}
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/nightly-upstream-snapshot-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ jobs:
with:
arguments: build --stacktrace -PenableCoverage=true -PtestUpstreamSnapshots=true
env:
PUBLISH_USERNAME: ${{ secrets.PUBLISH_USERNAME }}
PUBLISH_PASSWORD: ${{ secrets.PUBLISH_PASSWORD }}
PUBLISH_TOKEN_USERNAME: ${{ secrets.PUBLISH_TOKEN_USERNAME }}
PUBLISH_TOKEN_PASSWORD: ${{ secrets.PUBLISH_TOKEN_PASSWORD }}
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/patch-release-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,8 @@ jobs:
with:
arguments: build final closeAndReleaseSonatypeStagingRepository -Prelease.version=${{ github.event.inputs.version }} --stacktrace
env:
PUBLISH_USERNAME: ${{ secrets.PUBLISH_USERNAME }}
PUBLISH_PASSWORD: ${{ secrets.PUBLISH_PASSWORD }}
PUBLISH_TOKEN_USERNAME: ${{ secrets.PUBLISH_TOKEN_USERNAME }}
PUBLISH_TOKEN_PASSWORD: ${{ secrets.PUBLISH_TOKEN_PASSWORD }}
GRGIT_USER: ${{ secrets.GITHUB_TOKEN }}
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ jobs:
with:
arguments: build final closeAndReleaseSonatypeStagingRepository -Prelease.version=${{ github.event.inputs.version }} --stacktrace
env:
PUBLISH_USERNAME: ${{ secrets.PUBLISH_USERNAME }}
PUBLISH_PASSWORD: ${{ secrets.PUBLISH_PASSWORD }}
PUBLISH_TOKEN_USERNAME: ${{ secrets.PUBLISH_TOKEN_USERNAME }}
PUBLISH_TOKEN_PASSWORD: ${{ secrets.PUBLISH_TOKEN_PASSWORD }}
GRGIT_USER: ${{ secrets.GITHUB_TOKEN }}
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
Expand Down
8 changes: 4 additions & 4 deletions RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,16 +81,16 @@ is`v1.2.3-RC$`, where `$` denotes a release candidate version, e.g. `v1.2.3-RC1`

The following credentials are required for publishing (and automatically set in CI):

* `PUBLISH_USERNAME` and `PUBLISH_PASSWORD`: Sonatype credentials for publishing.
* `PUBLISH_TOKEN_USERNAME` and `PUBLISH_TOKEN_PASSWORD`: Sonatype credentials for publishing.

## Releasing from the local setup

Releasing from the local setup can be done providing the previously mentioned four credential values, i.e.
`PUBLISH_USERNAME`, `PUBLISH_PASSWORD`
`PUBLISH_TOKEN_USERNAME`, `PUBLISH_TOKEN_PASSWORD`

```sh
export PUBLISH_USERNAME=my_sonatype_user
export PUBLISH_PASSWORD=my_sonatype_key
export PUBLISH_TOKEN_USERNAME=my_sonatype_user
export PUBLISH_TOKEN_PASSWORD=my_sonatype_key
export RELEASE_VERSION=2.4.5 # Set version you want to release
./gradlew build final -Prelease.version=${RELEASE_VERSION}
```
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ nexusPublishing {
sonatype {
nexusUrl.set(uri("https://aws.oss.sonatype.org/service/local/"))
snapshotRepositoryUrl.set(uri("https://aws.oss.sonatype.org/content/repositories/snapshots/"))
username.set(System.getenv("PUBLISH_USERNAME"))
password.set(System.getenv("PUBLISH_PASSWORD"))
username.set(System.getenv("PUBLISH_TOKEN_USERNAME"))
password.set(System.getenv("PUBLISH_TOKEN_PASSWORD"))
}
}
}
Expand Down

0 comments on commit dc29a0c

Please sign in to comment.