Skip to content

Commit a630b0d

Browse files
committed
[CI] Add workflow to release task3 apps to central
Signed-off-by: onobc <chris.bono@gmail.com>
1 parent 4c2463a commit a630b0d

2 files changed

Lines changed: 80 additions & 0 deletions

File tree

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
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+
"name": {"$match": "*.asc"}
22+
}
23+
]
24+
}
25+
]
26+
}
27+
},
28+
"target": "central_bundle/"
29+
}
30+
]
31+
}
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Task/Batch 3 Apps (Release to Maven Central)
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+
env:
14+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
15+
JF_ENV_SPRING: ${{ secrets.JF_ARTIFACTORY_SPRING }}
16+
CENTRAL_TOKEN_USERNAME: ${{ secrets.CENTRAL_TOKEN_USERNAME }}
17+
18+
jobs:
19+
deploy-to-maven-central:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@v5
23+
with:
24+
show-progress: false
25+
26+
- name: Verify Maven Secrets
27+
run: |
28+
if [[ -z $CENTRAL_TOKEN_USERNAME ]]
29+
then
30+
gh run cancel ${{ github.run_id }}
31+
echo "::error title=Cannot deploy to Maven Central:: The 'CENTRAL_TOKEN_USERNAME' & 'CENTRAL_TOKEN_PASSWORD' must be provided"
32+
exit 1
33+
fi
34+
35+
- uses: jfrog/setup-jfrog-cli@v4
36+
37+
- name: Download Release Files
38+
run: |
39+
jfrog rt download \
40+
--spec '.github/artifactory-release-files-spec.json' \
41+
--spec-vars "buildname=${{ inputs.buildName }};buildnumber=${{ inputs.buildNumber }}"
42+
43+
- name: Deploy to Maven Central
44+
if: env.CENTRAL_TOKEN_USERNAME
45+
uses: spring-io/central-publish-action@v0.3.0
46+
with:
47+
token-name: ${{ secrets.CENTRAL_TOKEN_USERNAME }}
48+
token: ${{ secrets.CENTRAL_TOKEN_PASSWORD }}
49+
dir: central_bundle

0 commit comments

Comments
 (0)