Skip to content

Helps discard staging repos when publishing to Maven Central

Notifications You must be signed in to change notification settings

nexus-actions/drop-nexus-staging-repo

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

drop-nexus-staging-repo Github Action

This action drops an existing staged repository, generally to discard previously uploaded artifacts after a job failure.

How to use it

Here is an example of how to use this action in your workflows.

on: [push]

jobs:
  create_staging_repository:
    #...
  build:
    needs: create_staging_repository
    # ...
  discard:
    runs-on: ubuntu-latest
    needs: [create_staging_repository, build]
    if: ${{ always() && needs.build.result != 'success' }}
    steps:
      - name: Discard
        # replace '@main' with the latest commit sha, see https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-third-party-actions
        uses: nexus-actions/drop-nexus-staging-repo@main
        with:
          username: ${{ secrets.SONATYPE_USERNAME }}
          password: ${{ secrets.SONATYPE_PASSWORD }}
          staging_repository_id: ${{ needs.create_staging_repository.outputs.repository-id }}

The different arguments are:

  • username: Your Sonatype username, same the Sonatype Jira one
  • password: Your Sonatype password, same the Sonatype Jira one
  • staging_repository_id: The ID of the staged repository to drop.
  • base_url: The url of your nexus repository, default to OSSRH (https://oss.sonatype.org/service/local/)

See the nexus-actions-demo repo for more details and use cases.


This action is brought to you by ...