Skip to content

Automatically deploy snapshots to central (attempt 3) #219

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 6, 2024
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
11 changes: 5 additions & 6 deletions .github/workflows/snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,14 @@ jobs:
distribution: 'temurin'
java-version: '17'
cache: maven
server-id: central
server-id: central # Value of the distributionManagement/repository/id field of the pom.xml
server-username: SONATYPE_USERNAME
server-password: SONATYPE_PASSWORD
gpg-private-key: GPG_PRIVATE_KEY
gpg-passphrase: GPG_PASSPHRASE
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} # has to be read directly from secrets
gpg-passphrase: MAVEN_GPG_PASSPHRASE # default name used by maven-gpg-plugin
- name: Deploy snapshot
run: mvn -ntp clean deploy -P release
run: mvn -Dmaven.test.skip=true -ntp -B clean deploy -P release
env:
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -476,8 +476,10 @@ Go to one of them and run `mvn site`.

## Development

### Manual deployment
### Snapshot deployment
A new snapshot is deployed to sonatype on each commit merged to `main` branch. See [snapshot.yml](.github/workflows/snapshot.yml) workflow for details.

### Manual Release deployment
Set sonatype credentials in `~/.m2/settings.xml`:

```xml
Expand All @@ -492,11 +494,9 @@ Set sonatype credentials in `~/.m2/settings.xml`:
</settings>
```

#### Snapshot deployment
To deploy snapshot to sonatype snapshot repo run `mvn clean deploy -P release`.

#### Release deployment
To deploy release to sonatype release repo run `mvn release:clean release:prepare release:perform -P release`.
To deploy release to sonatype release repo run `mvn release:clean release:prepare release:perform -P release`.
Make sure you have proper pgp keys set up.
This process will be automated in the future.

## License
```
Expand Down
Loading