Skip to content

Commit 25636d9

Browse files
committed
[CI] Add GHA to deploy stream apps to central in "chunks".
Adds a workflow to deploy stream apps to Maven Central in logical sections to avoid the upload limit imposed by Maven Central Portal Publish API. Signed-off-by: Chris Bono <[email protected]>
1 parent 0903bc5 commit 25636d9

File tree

5 files changed

+342
-2
lines changed

5 files changed

+342
-2
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: 'Deploy Artifacts To Maven Central'
2+
description: 'Downloads release files from Artifactory and deploys to Maven Central'
3+
inputs:
4+
buildName:
5+
description: "Artifactory build name"
6+
required: true
7+
buildNumber:
8+
description: "Artifactory build number"
9+
required: true
10+
appNamesPattern:
11+
description: "Patterns to match the artifact separated by commas (e.g. 'stream-applications-build*,other-app*')"
12+
required: true
13+
targetDir:
14+
description: "Folder to download the artifact (e.g. 'central_bundle/stream-applications-build')"
15+
required: true
16+
centralTokenName:
17+
description: "Central token name"
18+
required: true
19+
centralToken:
20+
description: "Central token"
21+
required: true
22+
runs:
23+
using: "composite"
24+
steps:
25+
- name: Download Release Files For (${{ inputs.appNamesPattern }}
26+
shell: bash
27+
run: |
28+
./scripts/release/deploy-artifacts-to-maven-central.sh \
29+
${{ inputs.buildName }} \
30+
${{ inputs.buildNumber }} \
31+
"${{ inputs.appNamesPattern }}" \
32+
${{ inputs.targetDir }}
33+
- name: Deploy ${{ inputs.appNamesPattern }} to Maven Central
34+
uses: spring-io/[email protected]
35+
with:
36+
token-name: ${{ inputs.centralTokenName }}
37+
token: ${{ inputs.centralToken }}
38+
dir: ${{ inputs.targetDir }}
39+
ignore-already-exists-error: true

.github/stream-apps-release-files-spec.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
{
88
"@buildName": "${buildname}",
99
"@buildNumber": "${buildnumber}",
10-
"path": {"$match": "org*"}
10+
"path": {"$match": "${appDirMatch}" }
1111
},
1212
{
1313
"$or": [
@@ -52,7 +52,7 @@
5252
]
5353
}
5454
},
55-
"target": "central_bundle/"
55+
"target": "${targetDir}"
5656
}
5757
]
5858
}
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: Stream Apps 2025.0.1 AdHoc (Release to Maven Central app-by-app)
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+
download-processors:
20+
runs-on: ubuntu-latest
21+
outputs:
22+
dirs: ${{ steps.get-artifact-dirs.outputs.dirs }}
23+
steps:
24+
- uses: actions/checkout@v5
25+
with:
26+
show-progress: false
27+
- uses: jfrog/setup-jfrog-cli@v4
28+
- name: Download Release Files
29+
run: |
30+
jfrog rt download \
31+
--spec ".github/stream-apps-release-files-spec.json" \
32+
--spec-vars "buildname=${{ inputs.buildName }};buildnumber=${{ inputs.buildNumber }};appDirMatch=org/springframework/cloud/stream/app/*processor*;targetDir=central_bundle/processors/"
33+
- name: Get artifacts dirs to upload
34+
id: get-artifact-dirs
35+
run: |
36+
pushd central_bundle/processors/org/springframework/cloud/stream/app
37+
DIRS=$(find . -maxdepth 1 -mindepth 1 -type d ! -path './stream-applications-postprocessor-common' | cut -c3- | jq -R -s -c 'split("\n")[:-1]')
38+
popd
39+
echo "dirs=$DIRS" >> $GITHUB_OUTPUT
40+
deploy-processors:
41+
needs: download-processors
42+
runs-on: ubuntu-latest
43+
strategy:
44+
matrix:
45+
app-dir: ${{ fromJson(needs.download-processors.outputs.dirs) }}
46+
steps:
47+
- uses: actions/checkout@v5
48+
with:
49+
show-progress: false
50+
- uses: jfrog/setup-jfrog-cli@v4
51+
- uses: ./.github/actions/deploy-artifacts-to-maven-central
52+
with:
53+
buildName: ${{ inputs.buildName }}
54+
buildNumber: ${{ inputs.buildNumber }}
55+
appNamesPattern: '${{ matrix.app-dir }}*'
56+
targetDir: 'central_bundle/processor/${{ matrix.app-dir }}'
57+
centralTokenName: ${{ secrets.CENTRAL_TOKEN_USERNAME }}
58+
centralToken: ${{ secrets.CENTRAL_TOKEN_PASSWORD }}
59+
deploy-release-train:
60+
needs: [ deploy-processors ]
61+
runs-on: ubuntu-latest
62+
steps:
63+
- uses: actions/checkout@v5
64+
with:
65+
show-progress: false
66+
- uses: jfrog/setup-jfrog-cli@v4
67+
- uses: ./.github/actions/deploy-artifacts-to-maven-central
68+
with:
69+
buildName: ${{ inputs.buildName }}
70+
buildNumber: ${{ inputs.buildNumber }}
71+
appNamesPattern: 'stream-applications-release-train*'
72+
targetDir: 'central_bundle/stream-applications-release-train'
73+
centralTokenName: ${{ secrets.CENTRAL_TOKEN_USERNAME }}
74+
centralToken: ${{ secrets.CENTRAL_TOKEN_PASSWORD }}
75+
- uses: ./.github/actions/deploy-artifacts-to-maven-central
76+
with:
77+
buildName: ${{ inputs.buildName }}
78+
buildNumber: ${{ inputs.buildNumber }}
79+
appNamesPattern: '*stream-applications-descriptor*,stream-applications-docs*'
80+
targetDir: 'central_bundle/stream-applications-descriptor'
81+
centralTokenName: ${{ secrets.CENTRAL_TOKEN_USERNAME }}
82+
centralToken: ${{ secrets.CENTRAL_TOKEN_PASSWORD }}
Lines changed: 196 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,196 @@
1+
name: Stream Apps (Release to Maven Central app-by-app)
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-core:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@v5
23+
with:
24+
show-progress: false
25+
- uses: jfrog/setup-jfrog-cli@v4
26+
- uses: ./.github/actions/deploy-artifacts-to-maven-central
27+
with:
28+
buildName: ${{ inputs.buildName }}
29+
buildNumber: ${{ inputs.buildNumber }}
30+
appNamesPattern: 'stream-applications-build*'
31+
targetDir: 'central_bundle/stream-applications-build'
32+
centralTokenName: ${{ secrets.CENTRAL_TOKEN_USERNAME }}
33+
centralToken: ${{ secrets.CENTRAL_TOKEN_PASSWORD }}
34+
- uses: ./.github/actions/deploy-artifacts-to-maven-central
35+
with:
36+
buildName: ${{ inputs.buildName }}
37+
buildNumber: ${{ inputs.buildNumber }}
38+
appNamesPattern: 'stream-applications-core*'
39+
targetDir: 'central_bundle/stream-applications-core'
40+
centralTokenName: ${{ secrets.CENTRAL_TOKEN_USERNAME }}
41+
centralToken: ${{ secrets.CENTRAL_TOKEN_PASSWORD }}
42+
- uses: ./.github/actions/deploy-artifacts-to-maven-central
43+
with:
44+
buildName: ${{ inputs.buildName }}
45+
buildNumber: ${{ inputs.buildNumber }}
46+
appNamesPattern: 'stream-applications-test-support*,stream-applications-postprocessor-common*,stream-applications-security-common*,stream-applications-composite-function-support*'
47+
targetDir: 'central_bundle/stream-applications-core-subs'
48+
centralTokenName: ${{ secrets.CENTRAL_TOKEN_USERNAME }}
49+
centralToken: ${{ secrets.CENTRAL_TOKEN_PASSWORD }}
50+
download-sources:
51+
needs: deploy-core
52+
runs-on: ubuntu-latest
53+
outputs:
54+
dirs: ${{ steps.get-artifact-dirs.outputs.dirs }}
55+
steps:
56+
- uses: actions/checkout@v5
57+
with:
58+
show-progress: false
59+
- uses: jfrog/setup-jfrog-cli@v4
60+
- name: Download Release Files
61+
run: |
62+
jfrog rt download \
63+
--spec ".github/stream-apps-release-files-spec.json" \
64+
--spec-vars "buildname=${{ inputs.buildName }};buildnumber=${{ inputs.buildNumber }};appDirMatch=org/springframework/cloud/stream/app/*source*;targetDir=central_bundle/sources/"
65+
- name: Get artifacts dirs to upload
66+
id: get-artifact-dirs
67+
run: |
68+
pushd central_bundle/sources/org/springframework/cloud/stream/app
69+
DIRS=$(find . -maxdepth 1 -mindepth 1 -type d | cut -c3- | jq -R -s -c 'split("\n")[:-1]')
70+
popd
71+
echo "dirs=$DIRS" >> $GITHUB_OUTPUT
72+
deploy-sources:
73+
needs: download-sources
74+
runs-on: ubuntu-latest
75+
strategy:
76+
matrix:
77+
app-dir: ${{ fromJson(needs.download-sources.outputs.dirs) }}
78+
steps:
79+
- uses: actions/checkout@v5
80+
with:
81+
show-progress: false
82+
- uses: jfrog/setup-jfrog-cli@v4
83+
- uses: ./.github/actions/deploy-artifacts-to-maven-central
84+
with:
85+
buildName: ${{ inputs.buildName }}
86+
buildNumber: ${{ inputs.buildNumber }}
87+
appNamesPattern: '${{ matrix.app-dir }}*'
88+
targetDir: 'central_bundle/source/${{ matrix.app-dir }}'
89+
centralTokenName: ${{ secrets.CENTRAL_TOKEN_USERNAME }}
90+
centralToken: ${{ secrets.CENTRAL_TOKEN_PASSWORD }}
91+
download-sinks:
92+
needs: deploy-core
93+
runs-on: ubuntu-latest
94+
outputs:
95+
dirs: ${{ steps.get-artifact-dirs.outputs.dirs }}
96+
steps:
97+
- uses: actions/checkout@v5
98+
with:
99+
show-progress: false
100+
- uses: jfrog/setup-jfrog-cli@v4
101+
- name: Download Release Files
102+
run: |
103+
jfrog rt download \
104+
--spec ".github/stream-apps-release-files-spec.json" \
105+
--spec-vars "buildname=${{ inputs.buildName }};buildnumber=${{ inputs.buildNumber }};appDirMatch=org/springframework/cloud/stream/app/*sink*;targetDir=central_bundle/sinks/"
106+
- name: Get artifacts dirs to upload
107+
id: get-artifact-dirs
108+
run: |
109+
pushd central_bundle/sinks/org/springframework/cloud/stream/app
110+
DIRS=$(find . -maxdepth 1 -mindepth 1 -type d | cut -c3- | jq -R -s -c 'split("\n")[:-1]')
111+
popd
112+
echo "dirs=$DIRS" >> $GITHUB_OUTPUT
113+
deploy-sinks:
114+
needs: download-sinks
115+
runs-on: ubuntu-latest
116+
strategy:
117+
matrix:
118+
app-dir: ${{ fromJson(needs.download-sinks.outputs.dirs) }}
119+
steps:
120+
- uses: actions/checkout@v5
121+
with:
122+
show-progress: false
123+
- uses: jfrog/setup-jfrog-cli@v4
124+
- uses: ./.github/actions/deploy-artifacts-to-maven-central
125+
with:
126+
buildName: ${{ inputs.buildName }}
127+
buildNumber: ${{ inputs.buildNumber }}
128+
appNamesPattern: '${{ matrix.app-dir }}*'
129+
targetDir: 'central_bundle/sink/${{ matrix.app-dir }}'
130+
centralTokenName: ${{ secrets.CENTRAL_TOKEN_USERNAME }}
131+
centralToken: ${{ secrets.CENTRAL_TOKEN_PASSWORD }}
132+
download-processors:
133+
needs: deploy-core
134+
runs-on: ubuntu-latest
135+
outputs:
136+
dirs: ${{ steps.get-artifact-dirs.outputs.dirs }}
137+
steps:
138+
- uses: actions/checkout@v5
139+
with:
140+
show-progress: false
141+
- uses: jfrog/setup-jfrog-cli@v4
142+
- name: Download Release Files
143+
run: |
144+
jfrog rt download \
145+
--spec ".github/stream-apps-release-files-spec.json" \
146+
--spec-vars "buildname=${{ inputs.buildName }};buildnumber=${{ inputs.buildNumber }};appDirMatch=org/springframework/cloud/stream/app/*processor*;targetDir=central_bundle/processors/"
147+
- name: Get artifacts dirs to upload
148+
id: get-artifact-dirs
149+
run: |
150+
pushd central_bundle/processors/org/springframework/cloud/stream/app
151+
DIRS=$(find . -maxdepth 1 -mindepth 1 -type d ! -path './stream-applications-postprocessor-common' | cut -c3- | jq -R -s -c 'split("\n")[:-1]')
152+
popd
153+
echo "dirs=$DIRS" >> $GITHUB_OUTPUT
154+
deploy-processors:
155+
needs: download-processors
156+
runs-on: ubuntu-latest
157+
strategy:
158+
matrix:
159+
app-dir: ${{ fromJson(needs.download-processors.outputs.dirs) }}
160+
steps:
161+
- uses: actions/checkout@v5
162+
with:
163+
show-progress: false
164+
- uses: jfrog/setup-jfrog-cli@v4
165+
- uses: ./.github/actions/deploy-artifacts-to-maven-central
166+
with:
167+
buildName: ${{ inputs.buildName }}
168+
buildNumber: ${{ inputs.buildNumber }}
169+
appNamesPattern: '${{ matrix.app-dir }}*'
170+
targetDir: 'central_bundle/processor/${{ matrix.app-dir }}'
171+
centralTokenName: ${{ secrets.CENTRAL_TOKEN_USERNAME }}
172+
centralToken: ${{ secrets.CENTRAL_TOKEN_PASSWORD }}
173+
deploy-release-train:
174+
needs: [ deploy-sources, deploy-sinks, deploy-processors ]
175+
runs-on: ubuntu-latest
176+
steps:
177+
- uses: actions/checkout@v5
178+
with:
179+
show-progress: false
180+
- uses: jfrog/setup-jfrog-cli@v4
181+
- uses: ./.github/actions/deploy-artifacts-to-maven-central
182+
with:
183+
buildName: ${{ inputs.buildName }}
184+
buildNumber: ${{ inputs.buildNumber }}
185+
appNamesPattern: 'stream-applications-release-train*'
186+
targetDir: 'central_bundle/stream-applications-release-train'
187+
centralTokenName: ${{ secrets.CENTRAL_TOKEN_USERNAME }}
188+
centralToken: ${{ secrets.CENTRAL_TOKEN_PASSWORD }}
189+
- uses: ./.github/actions/deploy-artifacts-to-maven-central
190+
with:
191+
buildName: ${{ inputs.buildName }}
192+
buildNumber: ${{ inputs.buildNumber }}
193+
appNamesPattern: '*stream-applications-descriptor*,stream-applications-docs*'
194+
targetDir: 'central_bundle/stream-applications-descriptor'
195+
centralTokenName: ${{ secrets.CENTRAL_TOKEN_USERNAME }}
196+
centralToken: ${{ secrets.CENTRAL_TOKEN_PASSWORD }}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/bash
2+
3+
if [ $# -ne 4 ]; then
4+
echo "usage: $(basename "$0") <buildName> <buildNumber> <appNamesPattern> <targetDir>"
5+
exit 1
6+
fi
7+
8+
buildName="$1"
9+
buildNumber="$2"
10+
appNamesPattern="$3"
11+
targetDir="$4"
12+
13+
OIFS="$IFS"
14+
IFS=','
15+
read -r -a appNames <<< "$appNamesPattern"
16+
IFS="$OIFS"
17+
18+
for appName in "${appNames[@]}"; do
19+
echo "Downloading $appName ..."
20+
jfrog rt download \
21+
--spec "./.github/stream-apps-release-files-spec.json" \
22+
--spec-vars "buildname=$buildName;buildnumber=$buildNumber;appDirMatch=org/springframework/cloud/stream/app/$appName;targetDir=$targetDir/"
23+
done

0 commit comments

Comments
 (0)