Skip to content

Commit 894bd80

Browse files
committed
Add Maven Publish Workflows
1 parent 3af7a40 commit 894bd80

File tree

4 files changed

+130
-0
lines changed

4 files changed

+130
-0
lines changed

.github/release-files-spec.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"files": [
3+
{
4+
"aql": {
5+
"items.find": {
6+
"$and": [
7+
{
8+
"@build.name": "${buildname}",
9+
"@build.number": "${buildnumber}",
10+
"path": {"$match": "org*"}
11+
},
12+
{
13+
"$or": [
14+
{
15+
"name": {"$match": "*.pom"}
16+
},
17+
{
18+
"name": {"$match": "*.jar"}
19+
}
20+
]
21+
}
22+
]
23+
}
24+
},
25+
"target": "nexus/"
26+
}
27+
]
28+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Central Sync Close
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
stagedRepositoryId:
7+
description: "Staged repository id"
8+
required: true
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
steps:
14+
15+
# Request close promotion repo
16+
- uses: jvalkeal/nexus-sync@v0
17+
with:
18+
username: ${{ secrets.OSSRH_S01_TOKEN_USERNAME }}
19+
password: ${{ secrets.OSSRH_S01_TOKEN_PASSWORD }}
20+
staging-profile-name: ${{ secrets.OSSRH_STAGING_PROFILE_NAME }}
21+
staging-repo-id: ${{ github.event.inputs.stagedRepositoryId }}
22+
close: true
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Central Sync Create
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
buildName:
7+
description: "Artifactory build name"
8+
required: true
9+
buildNumber:
10+
description: "Artifactory build number"
11+
required: true
12+
13+
jobs:
14+
build:
15+
runs-on: ubuntu-latest
16+
steps:
17+
18+
# to get spec file in .github
19+
- uses: actions/checkout@v2
20+
21+
# Setup jfrog cli
22+
- uses: jfrog/setup-jfrog-cli@v1
23+
with:
24+
version: 1.43.2
25+
env:
26+
JF_ARTIFACTORY_SPRING: ${{ secrets.JF_ARTIFACTORY_SPRING }}
27+
28+
# Extract build id from input
29+
- name: Extract Build Id
30+
run: |
31+
echo JFROG_CLI_BUILD_NAME=${{ github.event.inputs.buildName }} >> $GITHUB_ENV
32+
echo JFROG_CLI_BUILD_NUMBER=${{ github.event.inputs.buildNumber }} >> $GITHUB_ENV
33+
34+
# Download released files
35+
- name: Download Release Files
36+
run: |
37+
jfrog rt download \
38+
--spec .github/release-files-spec.json \
39+
--spec-vars "buildname=$JFROG_CLI_BUILD_NAME;buildnumber=$JFROG_CLI_BUILD_NUMBER"
40+
41+
# Create checksums, signatures and create staging repo on central and upload
42+
- uses: jvalkeal/nexus-sync@v0
43+
id: nexus
44+
with:
45+
url: ${{ secrets.OSSRH_URL }}
46+
username: ${{ secrets.OSSRH_S01_TOKEN_USERNAME }}
47+
password: ${{ secrets.OSSRH_S01_TOKEN_PASSWORD }}
48+
staging-profile-name: ${{ secrets.OSSRH_STAGING_PROFILE_NAME }}
49+
create: true
50+
upload: true
51+
generate-checksums: true
52+
pgp-sign: true
53+
pgp-sign-passphrase: ${{ secrets.GPG_PASSPHRASE }}
54+
pgp-sign-private-key: ${{ secrets.GPG_PRIVATE_KEY_WITH_HEADER }}
55+
56+
# Print staging repo id
57+
- name: Print Staging Repo Id
58+
run: echo ${{ steps.nexus.outputs.staged-repository-id }}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Central Sync Release
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
stagedRepositoryId:
7+
description: "Staged repository id"
8+
required: true
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
steps:
14+
15+
# Request release promotion repo
16+
- uses: jvalkeal/nexus-sync@v0
17+
with:
18+
username: ${{ secrets.OSSRH_S01_TOKEN_USERNAME }}
19+
password: ${{ secrets.OSSRH_S01_TOKEN_PASSWORD }}
20+
staging-profile-name: ${{ secrets.OSSRH_STAGING_PROFILE_NAME }}
21+
staging-repo-id: ${{ github.event.inputs.stagedRepositoryId }}
22+
release: true

0 commit comments

Comments
 (0)