Skip to content

Commit

Permalink
Add Maven Central staging workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
fmbenhassine committed Dec 1, 2023
1 parent ad5d368 commit eb5c9bf
Show file tree
Hide file tree
Showing 2 changed files with 88 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .github/release-files-spec.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"files": [
{
"aql": {
"items.find": {
"$and": [
{
"@build.name": "${buildname}",
"@build.number": "${buildnumber}",
"path": {"$match": "org*"}
},
{
"$or": [
{
"name": {"$match": "*.pom"}
},
{
"name": {"$match": "*.jar"}
}
]
}
]
}
},
"target": "nexus/"
}
]
}
60 changes: 60 additions & 0 deletions .github/workflows/maven-central-staging-43x.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Maven Central Staging for 4.3.x

on:
workflow_dispatch:
inputs:
buildName:
description: "Artifactory build name"
required: true
buildNumber:
description: "Artifactory build number"
required: true

jobs:
build:
runs-on: ubuntu-latest
steps:

- name: Checkout source code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
ref: '4.3.x'

# Setup jfrog cli
- uses: jfrog/setup-jfrog-cli@v1
with:
version: 1.43.2
env:
JF_ARTIFACTORY_SPRING: ${{ secrets.JF_ARTIFACTORY_SPRING }}

# Extract build id from input
- name: Extract Build Id
run: |
echo JFROG_CLI_BUILD_NAME=${{ github.event.inputs.buildName }} >> $GITHUB_ENV
echo JFROG_CLI_BUILD_NUMBER=${{ github.event.inputs.buildNumber }} >> $GITHUB_ENV
# Download released files
- name: Download Release Files
run: |
jfrog rt download \
--spec .github/release-files-spec.json \
--spec-vars "buildname=$JFROG_CLI_BUILD_NAME;buildnumber=$JFROG_CLI_BUILD_NUMBER"
# Create checksums, signatures and create staging repo on central and upload
- uses: jvalkeal/nexus-sync@v0
id: nexus
with:
url: ${{ secrets.OSSRH_URL }}
username: ${{ secrets.OSSRH_S01_TOKEN_USERNAME }}
password: ${{ secrets.OSSRH_S01_TOKEN_PASSWORD }}
staging-profile-name: ${{ secrets.OSSRH_STAGING_PROFILE_NAME }}
create: true
upload: true
generate-checksums: true
pgp-sign: true
pgp-sign-passphrase: ${{ secrets.GPG_PASSPHRASE }}
pgp-sign-private-key: ${{ secrets.GPG_PRIVATE_KEY }}

# Print staging repo id
- name: Print Staging Repo Id
run: echo ${{ steps.nexus.outputs.staged-repository-id }}

0 comments on commit eb5c9bf

Please sign in to comment.