|
| 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 }} |
0 commit comments