diff --git a/.github/workflows/build_airflow.yaml b/.github/workflows/build_airflow.yaml index 72b02c2c4..bc53a8907 100644 --- a/.github/workflows/build_airflow.yaml +++ b/.github/workflows/build_airflow.yaml @@ -3,10 +3,6 @@ name: Build Airflow run-name: | Build Airflow (attempt #${{ github.run_attempt }}) -env: - PRODUCT_NAME: airflow - SDP_VERSION: ${{ github.ref_type == 'tag' && github.ref_name || '0.0.0-dev' }} - on: workflow_dispatch: schedule: @@ -22,130 +18,15 @@ on: - stackable-base/** - .github/actions/** - .github/workflows/build_airflow.yaml + - .github/workflows/reusable_build_image.yaml jobs: - generate_matrix: - name: Generate Version List - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - with: - persist-credentials: false - - id: shard - uses: stackabletech/actions/shard@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - with: - product-name: ${{ env.PRODUCT_NAME }} - outputs: - versions: ${{ steps.shard.outputs.versions }} - - build: - name: Build/Publish ${{ matrix.versions }}-${{ matrix.runner.arch }} Image - needs: [generate_matrix] - permissions: - id-token: write - runs-on: ${{ matrix.runner.name }} - strategy: - fail-fast: false - matrix: - runner: - - {name: "ubuntu-latest", arch: "amd64"} - - {name: "ubicloud-standard-8-arm", arch: "arm64"} - versions: ${{ fromJson(needs.generate_matrix.outputs.versions) }} - steps: - - name: Checkout Repository - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - with: - persist-credentials: false - - - name: Free Disk Space - uses: stackabletech/actions/free-disk-space@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - - - name: Build Product Image - id: build - uses: stackabletech/actions/build-product-image@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - with: - product-name: ${{ env.PRODUCT_NAME }} - product-version: ${{ matrix.versions }} - build-cache-password: ${{ secrets.BUILD_CACHE_NEXUS_PASSWORD }} - sdp-version: ${{ env.SDP_VERSION }} - - - name: Publish Container Image on oci.stackable.tech - uses: stackabletech/actions/publish-image@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - with: - image-registry-uri: oci.stackable.tech - image-registry-username: robot$sdp+github-action-build - image-registry-password: ${{ secrets.HARBOR_ROBOT_SDP_GITHUB_ACTION_BUILD_SECRET }} - image-repository: sdp/${{ env.PRODUCT_NAME }} - image-manifest-tag: ${{ steps.build.outputs.image-manifest-tag }} - source-image-uri: localhost/${{ env.PRODUCT_NAME }}:${{ steps.build.outputs.image-manifest-tag }} - - publish_manifests: - name: Build/Publish ${{ matrix.versions }} Manifests - needs: [generate_matrix, build] - permissions: - id-token: write - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - versions: ${{ fromJson(needs.generate_matrix.outputs.versions) }} - steps: - - name: Checkout Repository - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - with: - persist-credentials: false - - - name: Publish and Sign Image Index Manifest to oci.stackable.tech - uses: stackabletech/actions/publish-index-manifest@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - with: - image-registry-uri: oci.stackable.tech - image-registry-username: robot$sdp+github-action-build - image-registry-password: ${{ secrets.HARBOR_ROBOT_SDP_GITHUB_ACTION_BUILD_SECRET }} - image-repository: sdp/${{ env.PRODUCT_NAME }} - image-index-manifest-tag: ${{ matrix.versions }}-stackable${{ env.SDP_VERSION }} - - notify: - name: Failure Notification - needs: [generate_matrix, build, publish_manifests] - runs-on: ubuntu-latest - if: failure() - steps: - - uses: slackapi/slack-github-action@37ebaef184d7626c5f204ab8d3baff4262dd30f0 # v1.27.0 - with: - channel-id: "C07UG6JH44F" # notifications-container-images - payload: | - { - "text": "*${{ github.workflow }}* failed (attempt ${{ github.run_attempt }})", - "attachments": [ - { - "pretext": "See the details below for a summary of which job(s) failed.", - "color": "#aa0000", - "fields": [ - { - "title": "Generate Version List", - "short": true, - "value": "${{ needs.generate_matrix.result }}" - }, - { - "title": "Build/Publish Image", - "short": true, - "value": "${{ needs.build.result }}" - }, - { - "title": "Build/Publish Manifests", - "short": true, - "value": "${{ needs.publish_manifests.result }}" - } - ], - "actions": [ - { - "type": "button", - "text": "Go to workflow run", - "url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}/attempts/${{ github.run_attempt }}" - } - ] - } - ] - } - env: - SLACK_BOT_TOKEN: ${{ secrets.SLACK_CONTAINER_IMAGE_TOKEN }} + build_image: + name: Reusable Workflow + uses: ./.github/workflows/reusable_build_image.yaml + secrets: + harbor-robot-secret: ${{ secrets.HARBOR_ROBOT_SDP_GITHUB_ACTION_BUILD_SECRET }} + slack-token: ${{ secrets.SLACK_CONTAINER_IMAGE_TOKEN }} + with: + product-name: airflow + sdp-version: ${{ github.ref_type == 'tag' && github.ref_name || '0.0.0-dev' }} diff --git a/.github/workflows/build_druid.yaml b/.github/workflows/build_druid.yaml index 043bfd541..424b74bb8 100644 --- a/.github/workflows/build_druid.yaml +++ b/.github/workflows/build_druid.yaml @@ -3,10 +3,6 @@ name: Build Druid run-name: | Build Druid (attempt #${{ github.run_attempt }}) -env: - PRODUCT_NAME: druid - SDP_VERSION: ${{ github.ref_type == 'tag' && github.ref_name || '0.0.0-dev' }} - on: workflow_dispatch: schedule: @@ -24,130 +20,15 @@ on: - java-devel/** - .github/actions/** - .github/workflows/build_druid.yaml + - .github/workflows/reusable_build_image.yaml jobs: - generate_matrix: - name: Generate Version List - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - with: - persist-credentials: false - - id: shard - uses: stackabletech/actions/shard@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - with: - product-name: ${{ env.PRODUCT_NAME }} - outputs: - versions: ${{ steps.shard.outputs.versions }} - - build: - name: Build/Publish ${{ matrix.versions }}-${{ matrix.runner.arch }} Image - needs: [generate_matrix] - permissions: - id-token: write - runs-on: ${{ matrix.runner.name }} - strategy: - fail-fast: false - matrix: - runner: - - {name: "ubuntu-latest", arch: "amd64"} - - {name: "ubicloud-standard-8-arm", arch: "arm64"} - versions: ${{ fromJson(needs.generate_matrix.outputs.versions) }} - steps: - - name: Checkout Repository - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - with: - persist-credentials: false - - - name: Free Disk Space - uses: stackabletech/actions/free-disk-space@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - - - name: Build Product Image - id: build - uses: stackabletech/actions/build-product-image@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - with: - product-name: ${{ env.PRODUCT_NAME }} - product-version: ${{ matrix.versions }} - build-cache-password: ${{ secrets.BUILD_CACHE_NEXUS_PASSWORD }} - sdp-version: ${{ env.SDP_VERSION }} - - - name: Publish Container Image on oci.stackable.tech - uses: stackabletech/actions/publish-image@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - with: - image-registry-uri: oci.stackable.tech - image-registry-username: robot$sdp+github-action-build - image-registry-password: ${{ secrets.HARBOR_ROBOT_SDP_GITHUB_ACTION_BUILD_SECRET }} - image-repository: sdp/${{ env.PRODUCT_NAME }} - image-manifest-tag: ${{ steps.build.outputs.image-manifest-tag }} - source-image-uri: localhost/${{ env.PRODUCT_NAME }}:${{ steps.build.outputs.image-manifest-tag }} - - publish_manifests: - name: Build/Publish ${{ matrix.versions }} Manifests - needs: [generate_matrix, build] - permissions: - id-token: write - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - versions: ${{ fromJson(needs.generate_matrix.outputs.versions) }} - steps: - - name: Checkout Repository - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - with: - persist-credentials: false - - - name: Publish and Sign Image Index Manifest to oci.stackable.tech - uses: stackabletech/actions/publish-index-manifest@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - with: - image-registry-uri: oci.stackable.tech - image-registry-username: robot$sdp+github-action-build - image-registry-password: ${{ secrets.HARBOR_ROBOT_SDP_GITHUB_ACTION_BUILD_SECRET }} - image-repository: sdp/${{ env.PRODUCT_NAME }} - image-index-manifest-tag: ${{ matrix.versions }}-stackable${{ env.SDP_VERSION }} - - notify: - name: Failure Notification - needs: [generate_matrix, build, publish_manifests] - runs-on: ubuntu-latest - if: failure() - steps: - - uses: slackapi/slack-github-action@37ebaef184d7626c5f204ab8d3baff4262dd30f0 # v1.27.0 - with: - channel-id: "C07UG6JH44F" # notifications-container-images - payload: | - { - "text": "*${{ github.workflow }}* failed (attempt ${{ github.run_attempt }})", - "attachments": [ - { - "pretext": "See the details below for a summary of which job(s) failed.", - "color": "#aa0000", - "fields": [ - { - "title": "Generate Version List", - "short": true, - "value": "${{ needs.generate_matrix.result }}" - }, - { - "title": "Build/Publish Image", - "short": true, - "value": "${{ needs.build.result }}" - }, - { - "title": "Build/Publish Manifests", - "short": true, - "value": "${{ needs.publish_manifests.result }}" - } - ], - "actions": [ - { - "type": "button", - "text": "Go to workflow run", - "url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}/attempts/${{ github.run_attempt }}" - } - ] - } - ] - } - env: - SLACK_BOT_TOKEN: ${{ secrets.SLACK_CONTAINER_IMAGE_TOKEN }} + build_image: + name: Reusable Workflow + uses: ./.github/workflows/reusable_build_image.yaml + secrets: + harbor-robot-secret: ${{ secrets.HARBOR_ROBOT_SDP_GITHUB_ACTION_BUILD_SECRET }} + slack-token: ${{ secrets.SLACK_CONTAINER_IMAGE_TOKEN }} + with: + product-name: druid + sdp-version: ${{ github.ref_type == 'tag' && github.ref_name || '0.0.0-dev' }} diff --git a/.github/workflows/build_hadoop.yaml b/.github/workflows/build_hadoop.yaml index 9489a41f0..2a77fb2e9 100644 --- a/.github/workflows/build_hadoop.yaml +++ b/.github/workflows/build_hadoop.yaml @@ -3,10 +3,6 @@ name: Build Hadoop run-name: | Build Hadoop (attempt #${{ github.run_attempt }}) -env: - PRODUCT_NAME: hadoop - SDP_VERSION: ${{ github.ref_type == 'tag' && github.ref_name || '0.0.0-dev' }} - on: workflow_dispatch: schedule: @@ -24,130 +20,15 @@ on: - java-devel/** - .github/actions/** - .github/workflows/build_hadoop.yaml + - .github/workflows/reusable_build_image.yaml jobs: - generate_matrix: - name: Generate Version List - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - with: - persist-credentials: false - - id: shard - uses: stackabletech/actions/shard@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - with: - product-name: ${{ env.PRODUCT_NAME }} - outputs: - versions: ${{ steps.shard.outputs.versions }} - - build: - name: Build/Publish ${{ matrix.versions }}-${{ matrix.runner.arch }} Image - needs: [generate_matrix] - permissions: - id-token: write - runs-on: ${{ matrix.runner.name }} - strategy: - fail-fast: false - matrix: - runner: - - {name: "ubuntu-latest", arch: "amd64"} - - {name: "ubicloud-standard-8-arm", arch: "arm64"} - versions: ${{ fromJson(needs.generate_matrix.outputs.versions) }} - steps: - - name: Checkout Repository - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - with: - persist-credentials: false - - - name: Free Disk Space - uses: stackabletech/actions/free-disk-space@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - - - name: Build Product Image - id: build - uses: stackabletech/actions/build-product-image@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - with: - product-name: ${{ env.PRODUCT_NAME }} - product-version: ${{ matrix.versions }} - build-cache-password: ${{ secrets.BUILD_CACHE_NEXUS_PASSWORD }} - sdp-version: ${{ env.SDP_VERSION }} - - - name: Publish Container Image on oci.stackable.tech - uses: stackabletech/actions/publish-image@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - with: - image-registry-uri: oci.stackable.tech - image-registry-username: robot$sdp+github-action-build - image-registry-password: ${{ secrets.HARBOR_ROBOT_SDP_GITHUB_ACTION_BUILD_SECRET }} - image-repository: sdp/${{ env.PRODUCT_NAME }} - image-manifest-tag: ${{ steps.build.outputs.image-manifest-tag }} - source-image-uri: localhost/${{ env.PRODUCT_NAME }}:${{ steps.build.outputs.image-manifest-tag }} - - publish_manifests: - name: Build/Publish ${{ matrix.versions }} Manifests - needs: [generate_matrix, build] - permissions: - id-token: write - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - versions: ${{ fromJson(needs.generate_matrix.outputs.versions) }} - steps: - - name: Checkout Repository - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - with: - persist-credentials: false - - - name: Publish and Sign Image Index Manifest to oci.stackable.tech - uses: stackabletech/actions/publish-index-manifest@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - with: - image-registry-uri: oci.stackable.tech - image-registry-username: robot$sdp+github-action-build - image-registry-password: ${{ secrets.HARBOR_ROBOT_SDP_GITHUB_ACTION_BUILD_SECRET }} - image-repository: sdp/${{ env.PRODUCT_NAME }} - image-index-manifest-tag: ${{ matrix.versions }}-stackable${{ env.SDP_VERSION }} - - notify: - name: Failure Notification - needs: [generate_matrix, build, publish_manifests] - runs-on: ubuntu-latest - if: failure() - steps: - - uses: slackapi/slack-github-action@37ebaef184d7626c5f204ab8d3baff4262dd30f0 # v1.27.0 - with: - channel-id: "C07UG6JH44F" # notifications-container-images - payload: | - { - "text": "*${{ github.workflow }}* failed (attempt ${{ github.run_attempt }})", - "attachments": [ - { - "pretext": "See the details below for a summary of which job(s) failed.", - "color": "#aa0000", - "fields": [ - { - "title": "Generate Version List", - "short": true, - "value": "${{ needs.generate_matrix.result }}" - }, - { - "title": "Build/Publish Image", - "short": true, - "value": "${{ needs.build.result }}" - }, - { - "title": "Build/Publish Manifests", - "short": true, - "value": "${{ needs.publish_manifests.result }}" - } - ], - "actions": [ - { - "type": "button", - "text": "Go to workflow run", - "url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}/attempts/${{ github.run_attempt }}" - } - ] - } - ] - } - env: - SLACK_BOT_TOKEN: ${{ secrets.SLACK_CONTAINER_IMAGE_TOKEN }} + build_image: + name: Reusable Workflow + uses: ./.github/workflows/reusable_build_image.yaml + secrets: + harbor-robot-secret: ${{ secrets.HARBOR_ROBOT_SDP_GITHUB_ACTION_BUILD_SECRET }} + slack-token: ${{ secrets.SLACK_CONTAINER_IMAGE_TOKEN }} + with: + product-name: hadoop + sdp-version: ${{ github.ref_type == 'tag' && github.ref_name || '0.0.0-dev' }} diff --git a/.github/workflows/build_hbase.yaml b/.github/workflows/build_hbase.yaml index dbfd5acfa..9e8b1cb95 100644 --- a/.github/workflows/build_hbase.yaml +++ b/.github/workflows/build_hbase.yaml @@ -3,10 +3,6 @@ name: Build HBase run-name: | Build HBase (attempt #${{ github.run_attempt }}) -env: - PRODUCT_NAME: hbase - SDP_VERSION: ${{ github.ref_type == 'tag' && github.ref_name || '0.0.0-dev' }} - on: workflow_dispatch: schedule: @@ -25,130 +21,15 @@ on: - java-devel/** - .github/actions/** - .github/workflows/build_hbase.yaml + - .github/workflows/reusable_build_image.yaml jobs: - generate_matrix: - name: Generate Version List - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - with: - persist-credentials: false - - id: shard - uses: stackabletech/actions/shard@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - with: - product-name: ${{ env.PRODUCT_NAME }} - outputs: - versions: ${{ steps.shard.outputs.versions }} - - build: - name: Build/Publish ${{ matrix.versions }}-${{ matrix.runner.arch }} Image - needs: [generate_matrix] - permissions: - id-token: write - runs-on: ${{ matrix.runner.name }} - strategy: - fail-fast: false - matrix: - runner: - - {name: "ubuntu-latest", arch: "amd64"} - - {name: "ubicloud-standard-8-arm", arch: "arm64"} - versions: ${{ fromJson(needs.generate_matrix.outputs.versions) }} - steps: - - name: Checkout Repository - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - with: - persist-credentials: false - - - name: Free Disk Space - uses: stackabletech/actions/free-disk-space@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - - - name: Build Product Image - id: build - uses: stackabletech/actions/build-product-image@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - with: - product-name: ${{ env.PRODUCT_NAME }} - product-version: ${{ matrix.versions }} - build-cache-password: ${{ secrets.BUILD_CACHE_NEXUS_PASSWORD }} - sdp-version: ${{ env.SDP_VERSION }} - - - name: Publish Container Image on oci.stackable.tech - uses: stackabletech/actions/publish-image@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - with: - image-registry-uri: oci.stackable.tech - image-registry-username: robot$sdp+github-action-build - image-registry-password: ${{ secrets.HARBOR_ROBOT_SDP_GITHUB_ACTION_BUILD_SECRET }} - image-repository: sdp/${{ env.PRODUCT_NAME }} - image-manifest-tag: ${{ steps.build.outputs.image-manifest-tag }} - source-image-uri: localhost/${{ env.PRODUCT_NAME }}:${{ steps.build.outputs.image-manifest-tag }} - - publish_manifests: - name: Build/Publish ${{ matrix.versions }} Manifests - needs: [generate_matrix, build] - permissions: - id-token: write - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - versions: ${{ fromJson(needs.generate_matrix.outputs.versions) }} - steps: - - name: Checkout Repository - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - with: - persist-credentials: false - - - name: Publish and Sign Image Index Manifest to oci.stackable.tech - uses: stackabletech/actions/publish-index-manifest@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - with: - image-registry-uri: oci.stackable.tech - image-registry-username: robot$sdp+github-action-build - image-registry-password: ${{ secrets.HARBOR_ROBOT_SDP_GITHUB_ACTION_BUILD_SECRET }} - image-repository: sdp/${{ env.PRODUCT_NAME }} - image-index-manifest-tag: ${{ matrix.versions }}-stackable${{ env.SDP_VERSION }} - - notify: - name: Failure Notification - needs: [generate_matrix, build, publish_manifests] - runs-on: ubuntu-latest - if: failure() - steps: - - uses: slackapi/slack-github-action@37ebaef184d7626c5f204ab8d3baff4262dd30f0 # v1.27.0 - with: - channel-id: "C07UG6JH44F" # notifications-container-images - payload: | - { - "text": "*${{ github.workflow }}* failed (attempt ${{ github.run_attempt }})", - "attachments": [ - { - "pretext": "See the details below for a summary of which job(s) failed.", - "color": "#aa0000", - "fields": [ - { - "title": "Generate Version List", - "short": true, - "value": "${{ needs.generate_matrix.result }}" - }, - { - "title": "Build/Publish Image", - "short": true, - "value": "${{ needs.build.result }}" - }, - { - "title": "Build/Publish Manifests", - "short": true, - "value": "${{ needs.publish_manifests.result }}" - } - ], - "actions": [ - { - "type": "button", - "text": "Go to workflow run", - "url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}/attempts/${{ github.run_attempt }}" - } - ] - } - ] - } - env: - SLACK_BOT_TOKEN: ${{ secrets.SLACK_CONTAINER_IMAGE_TOKEN }} + build_image: + name: Reusable Workflow + uses: ./.github/workflows/reusable_build_image.yaml + secrets: + harbor-robot-secret: ${{ secrets.HARBOR_ROBOT_SDP_GITHUB_ACTION_BUILD_SECRET }} + slack-token: ${{ secrets.SLACK_CONTAINER_IMAGE_TOKEN }} + with: + product-name: hbase + sdp-version: ${{ github.ref_type == 'tag' && github.ref_name || '0.0.0-dev' }} diff --git a/.github/workflows/build_hello-world.yaml b/.github/workflows/build_hello-world.yaml index 0038e3018..0a5bf28c5 100644 --- a/.github/workflows/build_hello-world.yaml +++ b/.github/workflows/build_hello-world.yaml @@ -3,10 +3,6 @@ name: Build Hello-World run-name: | Build Hello-World (attempt #${{ github.run_attempt }}) -env: - PRODUCT_NAME: hello-world - SDP_VERSION: ${{ github.ref_type == 'tag' && github.ref_name || '0.0.0-dev' }} - on: workflow_dispatch: schedule: @@ -20,130 +16,15 @@ on: - hello-world/** - .github/actions/** - .github/workflows/build_hello-world.yaml + - .github/workflows/reusable_build_image.yaml jobs: - generate_matrix: - name: Generate Version List - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - with: - persist-credentials: false - - id: shard - uses: stackabletech/actions/shard@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - with: - product-name: ${{ env.PRODUCT_NAME }} - outputs: - versions: ${{ steps.shard.outputs.versions }} - - build: - name: Build/Publish ${{ matrix.versions }}-${{ matrix.runner.arch }} Image - needs: [generate_matrix] - permissions: - id-token: write - runs-on: ${{ matrix.runner.name }} - strategy: - fail-fast: false - matrix: - runner: - - {name: "ubuntu-latest", arch: "amd64"} - - {name: "ubicloud-standard-8-arm", arch: "arm64"} - versions: ${{ fromJson(needs.generate_matrix.outputs.versions) }} - steps: - - name: Checkout Repository - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - with: - persist-credentials: false - - - name: Free Disk Space - uses: stackabletech/actions/free-disk-space@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - - - name: Build Product Image - id: build - uses: stackabletech/actions/build-product-image@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - with: - product-name: ${{ env.PRODUCT_NAME }} - product-version: ${{ matrix.versions }} - build-cache-password: ${{ secrets.BUILD_CACHE_NEXUS_PASSWORD }} - sdp-version: ${{ env.SDP_VERSION }} - - - name: Publish Container Image on oci.stackable.tech - uses: stackabletech/actions/publish-image@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - with: - image-registry-uri: oci.stackable.tech - image-registry-username: robot$sdp+github-action-build - image-registry-password: ${{ secrets.HARBOR_ROBOT_SDP_GITHUB_ACTION_BUILD_SECRET }} - image-repository: sdp/${{ env.PRODUCT_NAME }} - image-manifest-tag: ${{ steps.build.outputs.image-manifest-tag }} - source-image-uri: localhost/${{ env.PRODUCT_NAME }}:${{ steps.build.outputs.image-manifest-tag }} - - publish_manifests: - name: Build/Publish ${{ matrix.versions }} Manifests - needs: [generate_matrix, build] - permissions: - id-token: write - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - versions: ${{ fromJson(needs.generate_matrix.outputs.versions) }} - steps: - - name: Checkout Repository - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - with: - persist-credentials: false - - - name: Publish and Sign Image Index Manifest to oci.stackable.tech - uses: stackabletech/actions/publish-index-manifest@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - with: - image-registry-uri: oci.stackable.tech - image-registry-username: robot$sdp+github-action-build - image-registry-password: ${{ secrets.HARBOR_ROBOT_SDP_GITHUB_ACTION_BUILD_SECRET }} - image-repository: sdp/${{ env.PRODUCT_NAME }} - image-index-manifest-tag: ${{ matrix.versions }}-stackable${{ env.SDP_VERSION }} - - notify: - name: Failure Notification - needs: [generate_matrix, build, publish_manifests] - runs-on: ubuntu-latest - if: failure() - steps: - - uses: slackapi/slack-github-action@37ebaef184d7626c5f204ab8d3baff4262dd30f0 # v1.27.0 - with: - channel-id: "C07UG6JH44F" # notifications-container-images - payload: | - { - "text": "*${{ github.workflow }}* failed (attempt ${{ github.run_attempt }})", - "attachments": [ - { - "pretext": "See the details below for a summary of which job(s) failed.", - "color": "#aa0000", - "fields": [ - { - "title": "Generate Version List", - "short": true, - "value": "${{ needs.generate_matrix.result }}" - }, - { - "title": "Build/Publish Image", - "short": true, - "value": "${{ needs.build.result }}" - }, - { - "title": "Build/Publish Manifests", - "short": true, - "value": "${{ needs.publish_manifests.result }}" - } - ], - "actions": [ - { - "type": "button", - "text": "Go to workflow run", - "url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}/attempts/${{ github.run_attempt }}" - } - ] - } - ] - } - env: - SLACK_BOT_TOKEN: ${{ secrets.SLACK_CONTAINER_IMAGE_TOKEN }} + build_image: + name: Reusable Workflow + uses: ./.github/workflows/reusable_build_image.yaml + secrets: + harbor-robot-secret: ${{ secrets.HARBOR_ROBOT_SDP_GITHUB_ACTION_BUILD_SECRET }} + slack-token: ${{ secrets.SLACK_CONTAINER_IMAGE_TOKEN }} + with: + product-name: hello-world + sdp-version: ${{ github.ref_type == 'tag' && github.ref_name || '0.0.0-dev' }} diff --git a/.github/workflows/build_hive.yaml b/.github/workflows/build_hive.yaml index 542f75bbd..a13f26be8 100644 --- a/.github/workflows/build_hive.yaml +++ b/.github/workflows/build_hive.yaml @@ -3,10 +3,6 @@ name: Build Hive run-name: | Build Hive (attempt #${{ github.run_attempt }}) -env: - PRODUCT_NAME: hive - SDP_VERSION: ${{ github.ref_type == 'tag' && github.ref_name || '0.0.0-dev' }} - on: workflow_dispatch: schedule: @@ -25,130 +21,15 @@ on: - java-devel/** - .github/actions/** - .github/workflows/build_hive.yaml + - .github/workflows/reusable_build_image.yaml jobs: - generate_matrix: - name: Generate Version List - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - with: - persist-credentials: false - - id: shard - uses: stackabletech/actions/shard@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - with: - product-name: ${{ env.PRODUCT_NAME }} - outputs: - versions: ${{ steps.shard.outputs.versions }} - - build: - name: Build/Publish ${{ matrix.versions }}-${{ matrix.runner.arch }} Image - needs: [generate_matrix] - permissions: - id-token: write - runs-on: ${{ matrix.runner.name }} - strategy: - fail-fast: false - matrix: - runner: - - {name: "ubuntu-latest", arch: "amd64"} - - {name: "ubicloud-standard-8-arm", arch: "arm64"} - versions: ${{ fromJson(needs.generate_matrix.outputs.versions) }} - steps: - - name: Checkout Repository - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - with: - persist-credentials: false - - - name: Free Disk Space - uses: stackabletech/actions/free-disk-space@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - - - name: Build Product Image - id: build - uses: stackabletech/actions/build-product-image@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - with: - product-name: ${{ env.PRODUCT_NAME }} - product-version: ${{ matrix.versions }} - build-cache-password: ${{ secrets.BUILD_CACHE_NEXUS_PASSWORD }} - sdp-version: ${{ env.SDP_VERSION }} - - - name: Publish Container Image on oci.stackable.tech - uses: stackabletech/actions/publish-image@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - with: - image-registry-uri: oci.stackable.tech - image-registry-username: robot$sdp+github-action-build - image-registry-password: ${{ secrets.HARBOR_ROBOT_SDP_GITHUB_ACTION_BUILD_SECRET }} - image-repository: sdp/${{ env.PRODUCT_NAME }} - image-manifest-tag: ${{ steps.build.outputs.image-manifest-tag }} - source-image-uri: localhost/${{ env.PRODUCT_NAME }}:${{ steps.build.outputs.image-manifest-tag }} - - publish_manifests: - name: Build/Publish ${{ matrix.versions }} Manifests - needs: [generate_matrix, build] - permissions: - id-token: write - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - versions: ${{ fromJson(needs.generate_matrix.outputs.versions) }} - steps: - - name: Checkout Repository - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - with: - persist-credentials: false - - - name: Publish and Sign Image Index Manifest to oci.stackable.tech - uses: stackabletech/actions/publish-index-manifest@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - with: - image-registry-uri: oci.stackable.tech - image-registry-username: robot$sdp+github-action-build - image-registry-password: ${{ secrets.HARBOR_ROBOT_SDP_GITHUB_ACTION_BUILD_SECRET }} - image-repository: sdp/${{ env.PRODUCT_NAME }} - image-index-manifest-tag: ${{ matrix.versions }}-stackable${{ env.SDP_VERSION }} - - notify: - name: Failure Notification - needs: [generate_matrix, build, publish_manifests] - runs-on: ubuntu-latest - if: failure() - steps: - - uses: slackapi/slack-github-action@37ebaef184d7626c5f204ab8d3baff4262dd30f0 # v1.27.0 - with: - channel-id: "C07UG6JH44F" # notifications-container-images - payload: | - { - "text": "*${{ github.workflow }}* failed (attempt ${{ github.run_attempt }})", - "attachments": [ - { - "pretext": "See the details below for a summary of which job(s) failed.", - "color": "#aa0000", - "fields": [ - { - "title": "Generate Version List", - "short": true, - "value": "${{ needs.generate_matrix.result }}" - }, - { - "title": "Build/Publish Image", - "short": true, - "value": "${{ needs.build.result }}" - }, - { - "title": "Build/Publish Manifests", - "short": true, - "value": "${{ needs.publish_manifests.result }}" - } - ], - "actions": [ - { - "type": "button", - "text": "Go to workflow run", - "url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}/attempts/${{ github.run_attempt }}" - } - ] - } - ] - } - env: - SLACK_BOT_TOKEN: ${{ secrets.SLACK_CONTAINER_IMAGE_TOKEN }} + build_image: + name: Reusable Workflow + uses: ./.github/workflows/reusable_build_image.yaml + secrets: + harbor-robot-secret: ${{ secrets.HARBOR_ROBOT_SDP_GITHUB_ACTION_BUILD_SECRET }} + slack-token: ${{ secrets.SLACK_CONTAINER_IMAGE_TOKEN }} + with: + product-name: hive + sdp-version: ${{ github.ref_type == 'tag' && github.ref_name || '0.0.0-dev' }} diff --git a/.github/workflows/build_java-base.yaml b/.github/workflows/build_java-base.yaml index c54f15fcb..07795d94c 100644 --- a/.github/workflows/build_java-base.yaml +++ b/.github/workflows/build_java-base.yaml @@ -3,10 +3,6 @@ name: Build Java Base run-name: | Build Java Base (attempt #${{ github.run_attempt }}) -env: - PRODUCT_NAME: java-base - SDP_VERSION: ${{ github.ref_type == 'tag' && github.ref_name || '0.0.0-dev' }} - on: workflow_dispatch: schedule: @@ -20,130 +16,15 @@ on: - java-base/** - .github/actions/** - .github/workflows/build_java-base.yaml + - .github/workflows/reusable_build_image.yaml jobs: - generate_matrix: - name: Generate Version List - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - with: - persist-credentials: false - - id: shard - uses: stackabletech/actions/shard@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - with: - product-name: ${{ env.PRODUCT_NAME }} - outputs: - versions: ${{ steps.shard.outputs.versions }} - - build: - name: Build/Publish ${{ matrix.versions }}-${{ matrix.runner.arch }} Image - needs: [generate_matrix] - permissions: - id-token: write - runs-on: ${{ matrix.runner.name }} - strategy: - fail-fast: false - matrix: - runner: - - {name: "ubuntu-latest", arch: "amd64"} - - {name: "ubicloud-standard-8-arm", arch: "arm64"} - versions: ${{ fromJson(needs.generate_matrix.outputs.versions) }} - steps: - - name: Checkout Repository - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - with: - persist-credentials: false - - - name: Free Disk Space - uses: stackabletech/actions/free-disk-space@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - - - name: Build Product Image - id: build - uses: stackabletech/actions/build-product-image@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - with: - product-name: ${{ env.PRODUCT_NAME }} - product-version: ${{ matrix.versions }} - build-cache-password: ${{ secrets.BUILD_CACHE_NEXUS_PASSWORD }} - sdp-version: ${{ env.SDP_VERSION }} - - - name: Publish Container Image on oci.stackable.tech - uses: stackabletech/actions/publish-image@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - with: - image-registry-uri: oci.stackable.tech - image-registry-username: robot$sdp+github-action-build - image-registry-password: ${{ secrets.HARBOR_ROBOT_SDP_GITHUB_ACTION_BUILD_SECRET }} - image-repository: sdp/${{ env.PRODUCT_NAME }} - image-manifest-tag: ${{ steps.build.outputs.image-manifest-tag }} - source-image-uri: localhost/${{ env.PRODUCT_NAME }}:${{ steps.build.outputs.image-manifest-tag }} - - publish_manifests: - name: Build/Publish ${{ matrix.versions }} Manifests - needs: [generate_matrix, build] - permissions: - id-token: write - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - versions: ${{ fromJson(needs.generate_matrix.outputs.versions) }} - steps: - - name: Checkout Repository - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - with: - persist-credentials: false - - - name: Publish and Sign Image Index Manifest to oci.stackable.tech - uses: stackabletech/actions/publish-index-manifest@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - with: - image-registry-uri: oci.stackable.tech - image-registry-username: robot$sdp+github-action-build - image-registry-password: ${{ secrets.HARBOR_ROBOT_SDP_GITHUB_ACTION_BUILD_SECRET }} - image-repository: sdp/${{ env.PRODUCT_NAME }} - image-index-manifest-tag: ${{ matrix.versions }}-stackable${{ env.SDP_VERSION }} - - notify: - name: Failure Notification - needs: [generate_matrix, build, publish_manifests] - runs-on: ubuntu-latest - if: failure() - steps: - - uses: slackapi/slack-github-action@37ebaef184d7626c5f204ab8d3baff4262dd30f0 # v1.27.0 - with: - channel-id: "C07UG6JH44F" # notifications-container-images - payload: | - { - "text": "*${{ github.workflow }}* failed (attempt ${{ github.run_attempt }})", - "attachments": [ - { - "pretext": "See the details below for a summary of which job(s) failed.", - "color": "#aa0000", - "fields": [ - { - "title": "Generate Version List", - "short": true, - "value": "${{ needs.generate_matrix.result }}" - }, - { - "title": "Build/Publish Image", - "short": true, - "value": "${{ needs.build.result }}" - }, - { - "title": "Build/Publish Manifests", - "short": true, - "value": "${{ needs.publish_manifests.result }}" - } - ], - "actions": [ - { - "type": "button", - "text": "Go to workflow run", - "url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}/attempts/${{ github.run_attempt }}" - } - ] - } - ] - } - env: - SLACK_BOT_TOKEN: ${{ secrets.SLACK_CONTAINER_IMAGE_TOKEN }} + build_image: + name: Reusable Workflow + uses: ./.github/workflows/reusable_build_image.yaml + secrets: + harbor-robot-secret: ${{ secrets.HARBOR_ROBOT_SDP_GITHUB_ACTION_BUILD_SECRET }} + slack-token: ${{ secrets.SLACK_CONTAINER_IMAGE_TOKEN }} + with: + product-name: java-base + sdp-version: ${{ github.ref_type == 'tag' && github.ref_name || '0.0.0-dev' }} diff --git a/.github/workflows/build_java-devel.yaml b/.github/workflows/build_java-devel.yaml index b7d9da698..78eaab939 100644 --- a/.github/workflows/build_java-devel.yaml +++ b/.github/workflows/build_java-devel.yaml @@ -3,10 +3,6 @@ name: Build Java Development run-name: | Build Java Development (attempt #${{ github.run_attempt }}) -env: - PRODUCT_NAME: java-devel - SDP_VERSION: ${{ github.ref_type == 'tag' && github.ref_name || '0.0.0-dev' }} - on: workflow_dispatch: schedule: @@ -20,130 +16,15 @@ on: - java-devel/** - .github/actions/** - .github/workflows/build_java-devel.yaml + - .github/workflows/reusable_build_image.yaml jobs: - generate_matrix: - name: Generate Version List - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - with: - persist-credentials: false - - id: shard - uses: stackabletech/actions/shard@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - with: - product-name: ${{ env.PRODUCT_NAME }} - outputs: - versions: ${{ steps.shard.outputs.versions }} - - build: - name: Build/Publish ${{ matrix.versions }}-${{ matrix.runner.arch }} Image - needs: [generate_matrix] - permissions: - id-token: write - runs-on: ${{ matrix.runner.name }} - strategy: - fail-fast: false - matrix: - runner: - - {name: "ubuntu-latest", arch: "amd64"} - - {name: "ubicloud-standard-8-arm", arch: "arm64"} - versions: ${{ fromJson(needs.generate_matrix.outputs.versions) }} - steps: - - name: Checkout Repository - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - with: - persist-credentials: false - - - name: Free Disk Space - uses: stackabletech/actions/free-disk-space@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - - - name: Build Product Image - id: build - uses: stackabletech/actions/build-product-image@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - with: - product-name: ${{ env.PRODUCT_NAME }} - product-version: ${{ matrix.versions }} - build-cache-password: ${{ secrets.BUILD_CACHE_NEXUS_PASSWORD }} - sdp-version: ${{ env.SDP_VERSION }} - - - name: Publish Container Image on oci.stackable.tech - uses: stackabletech/actions/publish-image@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - with: - image-registry-uri: oci.stackable.tech - image-registry-username: robot$sdp+github-action-build - image-registry-password: ${{ secrets.HARBOR_ROBOT_SDP_GITHUB_ACTION_BUILD_SECRET }} - image-repository: sdp/${{ env.PRODUCT_NAME }} - image-manifest-tag: ${{ steps.build.outputs.image-manifest-tag }} - source-image-uri: localhost/${{ env.PRODUCT_NAME }}:${{ steps.build.outputs.image-manifest-tag }} - - publish_manifests: - name: Build/Publish ${{ matrix.versions }} Manifests - needs: [generate_matrix, build] - permissions: - id-token: write - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - versions: ${{ fromJson(needs.generate_matrix.outputs.versions) }} - steps: - - name: Checkout Repository - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - with: - persist-credentials: false - - - name: Publish and Sign Image Index Manifest to oci.stackable.tech - uses: stackabletech/actions/publish-index-manifest@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - with: - image-registry-uri: oci.stackable.tech - image-registry-username: robot$sdp+github-action-build - image-registry-password: ${{ secrets.HARBOR_ROBOT_SDP_GITHUB_ACTION_BUILD_SECRET }} - image-repository: sdp/${{ env.PRODUCT_NAME }} - image-index-manifest-tag: ${{ matrix.versions }}-stackable${{ env.SDP_VERSION }} - - notify: - name: Failure Notification - needs: [generate_matrix, build, publish_manifests] - runs-on: ubuntu-latest - if: failure() - steps: - - uses: slackapi/slack-github-action@37ebaef184d7626c5f204ab8d3baff4262dd30f0 # v1.27.0 - with: - channel-id: "C07UG6JH44F" # notifications-container-images - payload: | - { - "text": "*${{ github.workflow }}* failed (attempt ${{ github.run_attempt }})", - "attachments": [ - { - "pretext": "See the details below for a summary of which job(s) failed.", - "color": "#aa0000", - "fields": [ - { - "title": "Generate Version List", - "short": true, - "value": "${{ needs.generate_matrix.result }}" - }, - { - "title": "Build/Publish Image", - "short": true, - "value": "${{ needs.build.result }}" - }, - { - "title": "Build/Publish Manifests", - "short": true, - "value": "${{ needs.publish_manifests.result }}" - } - ], - "actions": [ - { - "type": "button", - "text": "Go to workflow run", - "url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}/attempts/${{ github.run_attempt }}" - } - ] - } - ] - } - env: - SLACK_BOT_TOKEN: ${{ secrets.SLACK_CONTAINER_IMAGE_TOKEN }} + build_image: + name: Reusable Workflow + uses: ./.github/workflows/reusable_build_image.yaml + secrets: + harbor-robot-secret: ${{ secrets.HARBOR_ROBOT_SDP_GITHUB_ACTION_BUILD_SECRET }} + slack-token: ${{ secrets.SLACK_CONTAINER_IMAGE_TOKEN }} + with: + product-name: java-devel + sdp-version: ${{ github.ref_type == 'tag' && github.ref_name || '0.0.0-dev' }} diff --git a/.github/workflows/build_kafka-testing-tools.yaml b/.github/workflows/build_kafka-testing-tools.yaml index 8b7d74d19..881e6bc56 100644 --- a/.github/workflows/build_kafka-testing-tools.yaml +++ b/.github/workflows/build_kafka-testing-tools.yaml @@ -3,10 +3,6 @@ name: Build Kafka Testing Tools run-name: | Build Kafka Testing Tools (attempt #${{ github.run_attempt }}) -env: - PRODUCT_NAME: kafka-testing-tools - SDP_VERSION: ${{ github.ref_type == 'tag' && github.ref_name || '0.0.0-dev' }} - on: workflow_dispatch: schedule: @@ -24,130 +20,15 @@ on: - java-base/** - .github/actions/** - .github/workflows/build_kafka-testing-tools.yaml + - .github/workflows/reusable_build_image.yaml jobs: - generate_matrix: - name: Generate Version List - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - with: - persist-credentials: false - - id: shard - uses: stackabletech/actions/shard@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - with: - product-name: ${{ env.PRODUCT_NAME }} - outputs: - versions: ${{ steps.shard.outputs.versions }} - - build: - name: Build/Publish ${{ matrix.versions }}-${{ matrix.runner.arch }} Image - needs: [generate_matrix] - permissions: - id-token: write - runs-on: ${{ matrix.runner.name }} - strategy: - fail-fast: false - matrix: - runner: - - {name: "ubuntu-latest", arch: "amd64"} - - {name: "ubicloud-standard-8-arm", arch: "arm64"} - versions: ${{ fromJson(needs.generate_matrix.outputs.versions) }} - steps: - - name: Checkout Repository - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - with: - persist-credentials: false - - - name: Free Disk Space - uses: stackabletech/actions/free-disk-space@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - - - name: Build Product Image - id: build - uses: stackabletech/actions/build-product-image@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - with: - product-name: ${{ env.PRODUCT_NAME }} - product-version: ${{ matrix.versions }} - build-cache-password: ${{ secrets.BUILD_CACHE_NEXUS_PASSWORD }} - sdp-version: ${{ env.SDP_VERSION }} - - - name: Publish Container Image on oci.stackable.tech - uses: stackabletech/actions/publish-image@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - with: - image-registry-uri: oci.stackable.tech - image-registry-username: robot$sdp+github-action-build - image-registry-password: ${{ secrets.HARBOR_ROBOT_SDP_GITHUB_ACTION_BUILD_SECRET }} - image-repository: sdp/${{ env.PRODUCT_NAME }} - image-manifest-tag: ${{ steps.build.outputs.image-manifest-tag }} - source-image-uri: localhost/${{ env.PRODUCT_NAME }}:${{ steps.build.outputs.image-manifest-tag }} - - publish_manifests: - name: Build/Publish ${{ matrix.versions }} Manifests - needs: [generate_matrix, build] - permissions: - id-token: write - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - versions: ${{ fromJson(needs.generate_matrix.outputs.versions) }} - steps: - - name: Checkout Repository - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - with: - persist-credentials: false - - - name: Publish and Sign Image Index Manifest to oci.stackable.tech - uses: stackabletech/actions/publish-index-manifest@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - with: - image-registry-uri: oci.stackable.tech - image-registry-username: robot$sdp+github-action-build - image-registry-password: ${{ secrets.HARBOR_ROBOT_SDP_GITHUB_ACTION_BUILD_SECRET }} - image-repository: sdp/${{ env.PRODUCT_NAME }} - image-index-manifest-tag: ${{ matrix.versions }}-stackable${{ env.SDP_VERSION }} - - notify: - name: Failure Notification - needs: [generate_matrix, build, publish_manifests] - runs-on: ubuntu-latest - if: failure() - steps: - - uses: slackapi/slack-github-action@37ebaef184d7626c5f204ab8d3baff4262dd30f0 # v1.27.0 - with: - channel-id: "C07UG6JH44F" # notifications-container-images - payload: | - { - "text": "*${{ github.workflow }}* failed (attempt ${{ github.run_attempt }})", - "attachments": [ - { - "pretext": "See the details below for a summary of which job(s) failed.", - "color": "#aa0000", - "fields": [ - { - "title": "Generate Version List", - "short": true, - "value": "${{ needs.generate_matrix.result }}" - }, - { - "title": "Build/Publish Image", - "short": true, - "value": "${{ needs.build.result }}" - }, - { - "title": "Build/Publish Manifests", - "short": true, - "value": "${{ needs.publish_manifests.result }}" - } - ], - "actions": [ - { - "type": "button", - "text": "Go to workflow run", - "url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}/attempts/${{ github.run_attempt }}" - } - ] - } - ] - } - env: - SLACK_BOT_TOKEN: ${{ secrets.SLACK_CONTAINER_IMAGE_TOKEN }} + build_image: + name: Reusable Workflow + uses: ./.github/workflows/reusable_build_image.yaml + secrets: + harbor-robot-secret: ${{ secrets.HARBOR_ROBOT_SDP_GITHUB_ACTION_BUILD_SECRET }} + slack-token: ${{ secrets.SLACK_CONTAINER_IMAGE_TOKEN }} + with: + product-name: kafka-testing-tools + sdp-version: ${{ github.ref_type == 'tag' && github.ref_name || '0.0.0-dev' }} diff --git a/.github/workflows/build_kafka.yaml b/.github/workflows/build_kafka.yaml index 250bf630a..b3e2434e2 100644 --- a/.github/workflows/build_kafka.yaml +++ b/.github/workflows/build_kafka.yaml @@ -3,10 +3,6 @@ name: Build Kafka run-name: | Build Kafka (attempt #${{ github.run_attempt }}) -env: - PRODUCT_NAME: kafka - SDP_VERSION: ${{ github.ref_type == 'tag' && github.ref_name || '0.0.0-dev' }} - on: workflow_dispatch: schedule: @@ -26,130 +22,15 @@ on: - java-devel/** - .github/actions/** - .github/workflows/build_kafka.yaml + - .github/workflows/reusable_build_image.yaml jobs: - generate_matrix: - name: Generate Version List - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - with: - persist-credentials: false - - id: shard - uses: stackabletech/actions/shard@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - with: - product-name: ${{ env.PRODUCT_NAME }} - outputs: - versions: ${{ steps.shard.outputs.versions }} - - build: - name: Build/Publish ${{ matrix.versions }}-${{ matrix.runner.arch }} Image - needs: [generate_matrix] - permissions: - id-token: write - runs-on: ${{ matrix.runner.name }} - strategy: - fail-fast: false - matrix: - runner: - - {name: "ubuntu-latest", arch: "amd64"} - - {name: "ubicloud-standard-8-arm", arch: "arm64"} - versions: ${{ fromJson(needs.generate_matrix.outputs.versions) }} - steps: - - name: Checkout Repository - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - with: - persist-credentials: false - - - name: Free Disk Space - uses: stackabletech/actions/free-disk-space@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - - - name: Build Product Image - id: build - uses: stackabletech/actions/build-product-image@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - with: - product-name: ${{ env.PRODUCT_NAME }} - product-version: ${{ matrix.versions }} - build-cache-password: ${{ secrets.BUILD_CACHE_NEXUS_PASSWORD }} - sdp-version: ${{ env.SDP_VERSION }} - - - name: Publish Container Image on oci.stackable.tech - uses: stackabletech/actions/publish-image@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - with: - image-registry-uri: oci.stackable.tech - image-registry-username: robot$sdp+github-action-build - image-registry-password: ${{ secrets.HARBOR_ROBOT_SDP_GITHUB_ACTION_BUILD_SECRET }} - image-repository: sdp/${{ env.PRODUCT_NAME }} - image-manifest-tag: ${{ steps.build.outputs.image-manifest-tag }} - source-image-uri: localhost/${{ env.PRODUCT_NAME }}:${{ steps.build.outputs.image-manifest-tag }} - - publish_manifests: - name: Build/Publish ${{ matrix.versions }} Manifests - needs: [generate_matrix, build] - permissions: - id-token: write - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - versions: ${{ fromJson(needs.generate_matrix.outputs.versions) }} - steps: - - name: Checkout Repository - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - with: - persist-credentials: false - - - name: Publish and Sign Image Index Manifest to oci.stackable.tech - uses: stackabletech/actions/publish-index-manifest@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - with: - image-registry-uri: oci.stackable.tech - image-registry-username: robot$sdp+github-action-build - image-registry-password: ${{ secrets.HARBOR_ROBOT_SDP_GITHUB_ACTION_BUILD_SECRET }} - image-repository: sdp/${{ env.PRODUCT_NAME }} - image-index-manifest-tag: ${{ matrix.versions }}-stackable${{ env.SDP_VERSION }} - - notify: - name: Failure Notification - needs: [generate_matrix, build, publish_manifests] - runs-on: ubuntu-latest - if: failure() - steps: - - uses: slackapi/slack-github-action@37ebaef184d7626c5f204ab8d3baff4262dd30f0 # v1.27.0 - with: - channel-id: "C07UG6JH44F" # notifications-container-images - payload: | - { - "text": "*${{ github.workflow }}* failed (attempt ${{ github.run_attempt }})", - "attachments": [ - { - "pretext": "See the details below for a summary of which job(s) failed.", - "color": "#aa0000", - "fields": [ - { - "title": "Generate Version List", - "short": true, - "value": "${{ needs.generate_matrix.result }}" - }, - { - "title": "Build/Publish Image", - "short": true, - "value": "${{ needs.build.result }}" - }, - { - "title": "Build/Publish Manifests", - "short": true, - "value": "${{ needs.publish_manifests.result }}" - } - ], - "actions": [ - { - "type": "button", - "text": "Go to workflow run", - "url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}/attempts/${{ github.run_attempt }}" - } - ] - } - ] - } - env: - SLACK_BOT_TOKEN: ${{ secrets.SLACK_CONTAINER_IMAGE_TOKEN }} + build_image: + name: Reusable Workflow + uses: ./.github/workflows/reusable_build_image.yaml + secrets: + harbor-robot-secret: ${{ secrets.HARBOR_ROBOT_SDP_GITHUB_ACTION_BUILD_SECRET }} + slack-token: ${{ secrets.SLACK_CONTAINER_IMAGE_TOKEN }} + with: + product-name: kafka + sdp-version: ${{ github.ref_type == 'tag' && github.ref_name || '0.0.0-dev' }} diff --git a/.github/workflows/build_kcat.yaml b/.github/workflows/build_kcat.yaml index 9c3ef1cf1..431e673fc 100644 --- a/.github/workflows/build_kcat.yaml +++ b/.github/workflows/build_kcat.yaml @@ -3,10 +3,6 @@ name: Build kcat run-name: | Build kcat (attempt #${{ github.run_attempt }}) -env: - PRODUCT_NAME: kcat - SDP_VERSION: ${{ github.ref_type == 'tag' && github.ref_name || '0.0.0-dev' }} - on: workflow_dispatch: schedule: @@ -24,130 +20,15 @@ on: - java-base/** - .github/actions/** - .github/workflows/build_kcat.yaml + - .github/workflows/reusable_build_image.yaml jobs: - generate_matrix: - name: Generate Version List - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - with: - persist-credentials: false - - id: shard - uses: stackabletech/actions/shard@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - with: - product-name: ${{ env.PRODUCT_NAME }} - outputs: - versions: ${{ steps.shard.outputs.versions }} - - build: - name: Build/Publish ${{ matrix.versions }}-${{ matrix.runner.arch }} Image - needs: [generate_matrix] - permissions: - id-token: write - runs-on: ${{ matrix.runner.name }} - strategy: - fail-fast: false - matrix: - runner: - - {name: "ubuntu-latest", arch: "amd64"} - - {name: "ubicloud-standard-8-arm", arch: "arm64"} - versions: ${{ fromJson(needs.generate_matrix.outputs.versions) }} - steps: - - name: Checkout Repository - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - with: - persist-credentials: false - - - name: Free Disk Space - uses: stackabletech/actions/free-disk-space@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - - - name: Build Product Image - id: build - uses: stackabletech/actions/build-product-image@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - with: - product-name: ${{ env.PRODUCT_NAME }} - product-version: ${{ matrix.versions }} - build-cache-password: ${{ secrets.BUILD_CACHE_NEXUS_PASSWORD }} - sdp-version: ${{ env.SDP_VERSION }} - - - name: Publish Container Image on oci.stackable.tech - uses: stackabletech/actions/publish-image@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - with: - image-registry-uri: oci.stackable.tech - image-registry-username: robot$sdp+github-action-build - image-registry-password: ${{ secrets.HARBOR_ROBOT_SDP_GITHUB_ACTION_BUILD_SECRET }} - image-repository: sdp/${{ env.PRODUCT_NAME }} - image-manifest-tag: ${{ steps.build.outputs.image-manifest-tag }} - source-image-uri: localhost/${{ env.PRODUCT_NAME }}:${{ steps.build.outputs.image-manifest-tag }} - - publish_manifests: - name: Build/Publish ${{ matrix.versions }} Manifests - needs: [generate_matrix, build] - permissions: - id-token: write - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - versions: ${{ fromJson(needs.generate_matrix.outputs.versions) }} - steps: - - name: Checkout Repository - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - with: - persist-credentials: false - - - name: Publish and Sign Image Index Manifest to oci.stackable.tech - uses: stackabletech/actions/publish-index-manifest@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - with: - image-registry-uri: oci.stackable.tech - image-registry-username: robot$sdp+github-action-build - image-registry-password: ${{ secrets.HARBOR_ROBOT_SDP_GITHUB_ACTION_BUILD_SECRET }} - image-repository: sdp/${{ env.PRODUCT_NAME }} - image-index-manifest-tag: ${{ matrix.versions }}-stackable${{ env.SDP_VERSION }} - - notify: - name: Failure Notification - needs: [generate_matrix, build, publish_manifests] - runs-on: ubuntu-latest - if: failure() - steps: - - uses: slackapi/slack-github-action@37ebaef184d7626c5f204ab8d3baff4262dd30f0 # v1.27.0 - with: - channel-id: "C07UG6JH44F" # notifications-container-images - payload: | - { - "text": "*${{ github.workflow }}* failed (attempt ${{ github.run_attempt }})", - "attachments": [ - { - "pretext": "See the details below for a summary of which job(s) failed.", - "color": "#aa0000", - "fields": [ - { - "title": "Generate Version List", - "short": true, - "value": "${{ needs.generate_matrix.result }}" - }, - { - "title": "Build/Publish Image", - "short": true, - "value": "${{ needs.build.result }}" - }, - { - "title": "Build/Publish Manifests", - "short": true, - "value": "${{ needs.publish_manifests.result }}" - } - ], - "actions": [ - { - "type": "button", - "text": "Go to workflow run", - "url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}/attempts/${{ github.run_attempt }}" - } - ] - } - ] - } - env: - SLACK_BOT_TOKEN: ${{ secrets.SLACK_CONTAINER_IMAGE_TOKEN }} + build_image: + name: Reusable Workflow + uses: ./.github/workflows/reusable_build_image.yaml + secrets: + harbor-robot-secret: ${{ secrets.HARBOR_ROBOT_SDP_GITHUB_ACTION_BUILD_SECRET }} + slack-token: ${{ secrets.SLACK_CONTAINER_IMAGE_TOKEN }} + with: + product-name: kcat + sdp-version: ${{ github.ref_type == 'tag' && github.ref_name || '0.0.0-dev' }} diff --git a/.github/workflows/build_krb5.yaml b/.github/workflows/build_krb5.yaml index 7ed1d6005..443fbdeb6 100644 --- a/.github/workflows/build_krb5.yaml +++ b/.github/workflows/build_krb5.yaml @@ -3,10 +3,6 @@ name: Build Krb5 run-name: | Build Krb5 (attempt #${{ github.run_attempt }}) -env: - PRODUCT_NAME: krb5 - SDP_VERSION: ${{ github.ref_type == 'tag' && github.ref_name || '0.0.0-dev' }} - on: workflow_dispatch: schedule: @@ -20,130 +16,15 @@ on: - krb5/** - .github/actions/** - .github/workflows/build_krb5.yaml + - .github/workflows/reusable_build_image.yaml jobs: - generate_matrix: - name: Generate Version List - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - with: - persist-credentials: false - - id: shard - uses: stackabletech/actions/shard@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - with: - product-name: ${{ env.PRODUCT_NAME }} - outputs: - versions: ${{ steps.shard.outputs.versions }} - - build: - name: Build/Publish ${{ matrix.versions }}-${{ matrix.runner.arch }} Image - needs: [generate_matrix] - permissions: - id-token: write - runs-on: ${{ matrix.runner.name }} - strategy: - fail-fast: false - matrix: - runner: - - {name: "ubuntu-latest", arch: "amd64"} - - {name: "ubicloud-standard-8-arm", arch: "arm64"} - versions: ${{ fromJson(needs.generate_matrix.outputs.versions) }} - steps: - - name: Checkout Repository - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - with: - persist-credentials: false - - - name: Free Disk Space - uses: stackabletech/actions/free-disk-space@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - - - name: Build Product Image - id: build - uses: stackabletech/actions/build-product-image@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - with: - product-name: ${{ env.PRODUCT_NAME }} - product-version: ${{ matrix.versions }} - build-cache-password: ${{ secrets.BUILD_CACHE_NEXUS_PASSWORD }} - sdp-version: ${{ env.SDP_VERSION }} - - - name: Publish Container Image on oci.stackable.tech - uses: stackabletech/actions/publish-image@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - with: - image-registry-uri: oci.stackable.tech - image-registry-username: robot$sdp+github-action-build - image-registry-password: ${{ secrets.HARBOR_ROBOT_SDP_GITHUB_ACTION_BUILD_SECRET }} - image-repository: sdp/${{ env.PRODUCT_NAME }} - image-manifest-tag: ${{ steps.build.outputs.image-manifest-tag }} - source-image-uri: localhost/${{ env.PRODUCT_NAME }}:${{ steps.build.outputs.image-manifest-tag }} - - publish_manifests: - name: Build/Publish ${{ matrix.versions }} Manifests - needs: [generate_matrix, build] - permissions: - id-token: write - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - versions: ${{ fromJson(needs.generate_matrix.outputs.versions) }} - steps: - - name: Checkout Repository - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - with: - persist-credentials: false - - - name: Publish and Sign Image Index Manifest to oci.stackable.tech - uses: stackabletech/actions/publish-index-manifest@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - with: - image-registry-uri: oci.stackable.tech - image-registry-username: robot$sdp+github-action-build - image-registry-password: ${{ secrets.HARBOR_ROBOT_SDP_GITHUB_ACTION_BUILD_SECRET }} - image-repository: sdp/${{ env.PRODUCT_NAME }} - image-index-manifest-tag: ${{ matrix.versions }}-stackable${{ env.SDP_VERSION }} - - notify: - name: Failure Notification - needs: [generate_matrix, build, publish_manifests] - runs-on: ubuntu-latest - if: failure() - steps: - - uses: slackapi/slack-github-action@37ebaef184d7626c5f204ab8d3baff4262dd30f0 # v1.27.0 - with: - channel-id: "C07UG6JH44F" # notifications-container-images - payload: | - { - "text": "*${{ github.workflow }}* failed (attempt ${{ github.run_attempt }})", - "attachments": [ - { - "pretext": "See the details below for a summary of which job(s) failed.", - "color": "#aa0000", - "fields": [ - { - "title": "Generate Version List", - "short": true, - "value": "${{ needs.generate_matrix.result }}" - }, - { - "title": "Build/Publish Image", - "short": true, - "value": "${{ needs.build.result }}" - }, - { - "title": "Build/Publish Manifests", - "short": true, - "value": "${{ needs.publish_manifests.result }}" - } - ], - "actions": [ - { - "type": "button", - "text": "Go to workflow run", - "url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}/attempts/${{ github.run_attempt }}" - } - ] - } - ] - } - env: - SLACK_BOT_TOKEN: ${{ secrets.SLACK_CONTAINER_IMAGE_TOKEN }} + build_image: + name: Reusable Workflow + uses: ./.github/workflows/reusable_build_image.yaml + secrets: + harbor-robot-secret: ${{ secrets.HARBOR_ROBOT_SDP_GITHUB_ACTION_BUILD_SECRET }} + slack-token: ${{ secrets.SLACK_CONTAINER_IMAGE_TOKEN }} + with: + product-name: krb5 + sdp-version: ${{ github.ref_type == 'tag' && github.ref_name || '0.0.0-dev' }} diff --git a/.github/workflows/build_nifi.yaml b/.github/workflows/build_nifi.yaml index 432d236db..d13e76eab 100644 --- a/.github/workflows/build_nifi.yaml +++ b/.github/workflows/build_nifi.yaml @@ -3,10 +3,6 @@ name: Build NiFi run-name: | Build NiFi (attempt #${{ github.run_attempt }}) -env: - PRODUCT_NAME: nifi - SDP_VERSION: ${{ github.ref_type == 'tag' && github.ref_name || '0.0.0-dev' }} - on: workflow_dispatch: schedule: @@ -24,130 +20,15 @@ on: - java-devel/** - .github/actions/** - .github/workflows/build_nifi.yaml + - .github/workflows/reusable_build_image.yaml jobs: - generate_matrix: - name: Generate Version List - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - with: - persist-credentials: false - - id: shard - uses: stackabletech/actions/shard@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - with: - product-name: ${{ env.PRODUCT_NAME }} - outputs: - versions: ${{ steps.shard.outputs.versions }} - - build: - name: Build/Publish ${{ matrix.versions }}-${{ matrix.runner.arch }} Image - needs: [generate_matrix] - permissions: - id-token: write - runs-on: ${{ matrix.runner.name }} - strategy: - fail-fast: false - matrix: - runner: - - {name: "ubuntu-latest", arch: "amd64"} - - {name: "ubicloud-standard-8-arm", arch: "arm64"} - versions: ${{ fromJson(needs.generate_matrix.outputs.versions) }} - steps: - - name: Checkout Repository - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - with: - persist-credentials: false - - - name: Free Disk Space - uses: stackabletech/actions/free-disk-space@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - - - name: Build Product Image - id: build - uses: stackabletech/actions/build-product-image@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - with: - product-name: ${{ env.PRODUCT_NAME }} - product-version: ${{ matrix.versions }} - build-cache-password: ${{ secrets.BUILD_CACHE_NEXUS_PASSWORD }} - sdp-version: ${{ env.SDP_VERSION }} - - - name: Publish Container Image on oci.stackable.tech - uses: stackabletech/actions/publish-image@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - with: - image-registry-uri: oci.stackable.tech - image-registry-username: robot$sdp+github-action-build - image-registry-password: ${{ secrets.HARBOR_ROBOT_SDP_GITHUB_ACTION_BUILD_SECRET }} - image-repository: sdp/${{ env.PRODUCT_NAME }} - image-manifest-tag: ${{ steps.build.outputs.image-manifest-tag }} - source-image-uri: localhost/${{ env.PRODUCT_NAME }}:${{ steps.build.outputs.image-manifest-tag }} - - publish_manifests: - name: Build/Publish ${{ matrix.versions }} Manifests - needs: [generate_matrix, build] - permissions: - id-token: write - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - versions: ${{ fromJson(needs.generate_matrix.outputs.versions) }} - steps: - - name: Checkout Repository - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - with: - persist-credentials: false - - - name: Publish and Sign Image Index Manifest to oci.stackable.tech - uses: stackabletech/actions/publish-index-manifest@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - with: - image-registry-uri: oci.stackable.tech - image-registry-username: robot$sdp+github-action-build - image-registry-password: ${{ secrets.HARBOR_ROBOT_SDP_GITHUB_ACTION_BUILD_SECRET }} - image-repository: sdp/${{ env.PRODUCT_NAME }} - image-index-manifest-tag: ${{ matrix.versions }}-stackable${{ env.SDP_VERSION }} - - notify: - name: Failure Notification - needs: [generate_matrix, build, publish_manifests] - runs-on: ubuntu-latest - if: failure() - steps: - - uses: slackapi/slack-github-action@37ebaef184d7626c5f204ab8d3baff4262dd30f0 # v1.27.0 - with: - channel-id: "C07UG6JH44F" # notifications-container-images - payload: | - { - "text": "*${{ github.workflow }}* failed (attempt ${{ github.run_attempt }})", - "attachments": [ - { - "pretext": "See the details below for a summary of which job(s) failed.", - "color": "#aa0000", - "fields": [ - { - "title": "Generate Version List", - "short": true, - "value": "${{ needs.generate_matrix.result }}" - }, - { - "title": "Build/Publish Image", - "short": true, - "value": "${{ needs.build.result }}" - }, - { - "title": "Build/Publish Manifests", - "short": true, - "value": "${{ needs.publish_manifests.result }}" - } - ], - "actions": [ - { - "type": "button", - "text": "Go to workflow run", - "url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}/attempts/${{ github.run_attempt }}" - } - ] - } - ] - } - env: - SLACK_BOT_TOKEN: ${{ secrets.SLACK_CONTAINER_IMAGE_TOKEN }} + build_image: + name: Reusable Workflow + uses: ./.github/workflows/reusable_build_image.yaml + secrets: + harbor-robot-secret: ${{ secrets.HARBOR_ROBOT_SDP_GITHUB_ACTION_BUILD_SECRET }} + slack-token: ${{ secrets.SLACK_CONTAINER_IMAGE_TOKEN }} + with: + product-name: nifi + sdp-version: ${{ github.ref_type == 'tag' && github.ref_name || '0.0.0-dev' }} diff --git a/.github/workflows/build_omid.yaml b/.github/workflows/build_omid.yaml index a4625ad23..b88a685d8 100644 --- a/.github/workflows/build_omid.yaml +++ b/.github/workflows/build_omid.yaml @@ -3,10 +3,6 @@ name: Build Omid run-name: | Build Omid (attempt #${{ github.run_attempt }}) -env: - PRODUCT_NAME: omid - SDP_VERSION: ${{ github.ref_type == 'tag' && github.ref_name || '0.0.0-dev' }} - on: workflow_dispatch: schedule: @@ -24,130 +20,15 @@ on: - java-devel/** - .github/actions/** - .github/workflows/build_omid.yaml + - .github/workflows/reusable_build_image.yaml jobs: - generate_matrix: - name: Generate Version List - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - with: - persist-credentials: false - - id: shard - uses: stackabletech/actions/shard@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - with: - product-name: ${{ env.PRODUCT_NAME }} - outputs: - versions: ${{ steps.shard.outputs.versions }} - - build: - name: Build/Publish ${{ matrix.versions }}-${{ matrix.runner.arch }} Image - needs: [generate_matrix] - permissions: - id-token: write - runs-on: ${{ matrix.runner.name }} - strategy: - fail-fast: false - matrix: - runner: - - {name: "ubuntu-latest", arch: "amd64"} - - {name: "ubicloud-standard-8-arm", arch: "arm64"} - versions: ${{ fromJson(needs.generate_matrix.outputs.versions) }} - steps: - - name: Checkout Repository - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - with: - persist-credentials: false - - - name: Free Disk Space - uses: stackabletech/actions/free-disk-space@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - - - name: Build Product Image - id: build - uses: stackabletech/actions/build-product-image@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - with: - product-name: ${{ env.PRODUCT_NAME }} - product-version: ${{ matrix.versions }} - build-cache-password: ${{ secrets.BUILD_CACHE_NEXUS_PASSWORD }} - sdp-version: ${{ env.SDP_VERSION }} - - - name: Publish Container Image on oci.stackable.tech - uses: stackabletech/actions/publish-image@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - with: - image-registry-uri: oci.stackable.tech - image-registry-username: robot$sdp+github-action-build - image-registry-password: ${{ secrets.HARBOR_ROBOT_SDP_GITHUB_ACTION_BUILD_SECRET }} - image-repository: sdp/${{ env.PRODUCT_NAME }} - image-manifest-tag: ${{ steps.build.outputs.image-manifest-tag }} - source-image-uri: localhost/${{ env.PRODUCT_NAME }}:${{ steps.build.outputs.image-manifest-tag }} - - publish_manifests: - name: Build/Publish ${{ matrix.versions }} Manifests - needs: [generate_matrix, build] - permissions: - id-token: write - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - versions: ${{ fromJson(needs.generate_matrix.outputs.versions) }} - steps: - - name: Checkout Repository - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - with: - persist-credentials: false - - - name: Publish and Sign Image Index Manifest to oci.stackable.tech - uses: stackabletech/actions/publish-index-manifest@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - with: - image-registry-uri: oci.stackable.tech - image-registry-username: robot$sdp+github-action-build - image-registry-password: ${{ secrets.HARBOR_ROBOT_SDP_GITHUB_ACTION_BUILD_SECRET }} - image-repository: sdp/${{ env.PRODUCT_NAME }} - image-index-manifest-tag: ${{ matrix.versions }}-stackable${{ env.SDP_VERSION }} - - notify: - name: Failure Notification - needs: [generate_matrix, build, publish_manifests] - runs-on: ubuntu-latest - if: failure() - steps: - - uses: slackapi/slack-github-action@37ebaef184d7626c5f204ab8d3baff4262dd30f0 # v1.27.0 - with: - channel-id: "C07UG6JH44F" # notifications-container-images - payload: | - { - "text": "*${{ github.workflow }}* failed (attempt ${{ github.run_attempt }})", - "attachments": [ - { - "pretext": "See the details below for a summary of which job(s) failed.", - "color": "#aa0000", - "fields": [ - { - "title": "Generate Version List", - "short": true, - "value": "${{ needs.generate_matrix.result }}" - }, - { - "title": "Build/Publish Image", - "short": true, - "value": "${{ needs.build.result }}" - }, - { - "title": "Build/Publish Manifests", - "short": true, - "value": "${{ needs.publish_manifests.result }}" - } - ], - "actions": [ - { - "type": "button", - "text": "Go to workflow run", - "url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}/attempts/${{ github.run_attempt }}" - } - ] - } - ] - } - env: - SLACK_BOT_TOKEN: ${{ secrets.SLACK_CONTAINER_IMAGE_TOKEN }} + build_image: + name: Reusable Workflow + uses: ./.github/workflows/reusable_build_image.yaml + secrets: + harbor-robot-secret: ${{ secrets.HARBOR_ROBOT_SDP_GITHUB_ACTION_BUILD_SECRET }} + slack-token: ${{ secrets.SLACK_CONTAINER_IMAGE_TOKEN }} + with: + product-name: omid + sdp-version: ${{ github.ref_type == 'tag' && github.ref_name || '0.0.0-dev' }} diff --git a/.github/workflows/build_opa.yaml b/.github/workflows/build_opa.yaml index 6329154de..17c516a6a 100644 --- a/.github/workflows/build_opa.yaml +++ b/.github/workflows/build_opa.yaml @@ -3,10 +3,6 @@ name: Build OPA run-name: | Build OPA (attempt #${{ github.run_attempt }}) -env: - PRODUCT_NAME: opa - SDP_VERSION: ${{ github.ref_type == 'tag' && github.ref_name || '0.0.0-dev' }} - on: workflow_dispatch: schedule: @@ -22,130 +18,15 @@ on: - stackable-base/** - .github/actions/** - .github/workflows/build_opa.yaml + - .github/workflows/reusable_build_image.yaml jobs: - generate_matrix: - name: Generate Version List - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - with: - persist-credentials: false - - id: shard - uses: stackabletech/actions/shard@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - with: - product-name: ${{ env.PRODUCT_NAME }} - outputs: - versions: ${{ steps.shard.outputs.versions }} - - build: - name: Build/Publish ${{ matrix.versions }}-${{ matrix.runner.arch }} Image - needs: [generate_matrix] - permissions: - id-token: write - runs-on: ${{ matrix.runner.name }} - strategy: - fail-fast: false - matrix: - runner: - - {name: "ubuntu-latest", arch: "amd64"} - - {name: "ubicloud-standard-8-arm", arch: "arm64"} - versions: ${{ fromJson(needs.generate_matrix.outputs.versions) }} - steps: - - name: Checkout Repository - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - with: - persist-credentials: false - - - name: Free Disk Space - uses: stackabletech/actions/free-disk-space@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - - - name: Build Product Image - id: build - uses: stackabletech/actions/build-product-image@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - with: - product-name: ${{ env.PRODUCT_NAME }} - product-version: ${{ matrix.versions }} - build-cache-password: ${{ secrets.BUILD_CACHE_NEXUS_PASSWORD }} - sdp-version: ${{ env.SDP_VERSION }} - - - name: Publish Container Image on oci.stackable.tech - uses: stackabletech/actions/publish-image@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - with: - image-registry-uri: oci.stackable.tech - image-registry-username: robot$sdp+github-action-build - image-registry-password: ${{ secrets.HARBOR_ROBOT_SDP_GITHUB_ACTION_BUILD_SECRET }} - image-repository: sdp/${{ env.PRODUCT_NAME }} - image-manifest-tag: ${{ steps.build.outputs.image-manifest-tag }} - source-image-uri: localhost/${{ env.PRODUCT_NAME }}:${{ steps.build.outputs.image-manifest-tag }} - - publish_manifests: - name: Build/Publish ${{ matrix.versions }} Manifests - needs: [generate_matrix, build] - permissions: - id-token: write - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - versions: ${{ fromJson(needs.generate_matrix.outputs.versions) }} - steps: - - name: Checkout Repository - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - with: - persist-credentials: false - - - name: Publish and Sign Image Index Manifest to oci.stackable.tech - uses: stackabletech/actions/publish-index-manifest@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - with: - image-registry-uri: oci.stackable.tech - image-registry-username: robot$sdp+github-action-build - image-registry-password: ${{ secrets.HARBOR_ROBOT_SDP_GITHUB_ACTION_BUILD_SECRET }} - image-repository: sdp/${{ env.PRODUCT_NAME }} - image-index-manifest-tag: ${{ matrix.versions }}-stackable${{ env.SDP_VERSION }} - - notify: - name: Failure Notification - needs: [generate_matrix, build, publish_manifests] - runs-on: ubuntu-latest - if: failure() - steps: - - uses: slackapi/slack-github-action@37ebaef184d7626c5f204ab8d3baff4262dd30f0 # v1.27.0 - with: - channel-id: "C07UG6JH44F" # notifications-container-images - payload: | - { - "text": "*${{ github.workflow }}* failed (attempt ${{ github.run_attempt }})", - "attachments": [ - { - "pretext": "See the details below for a summary of which job(s) failed.", - "color": "#aa0000", - "fields": [ - { - "title": "Generate Version List", - "short": true, - "value": "${{ needs.generate_matrix.result }}" - }, - { - "title": "Build/Publish Image", - "short": true, - "value": "${{ needs.build.result }}" - }, - { - "title": "Build/Publish Manifests", - "short": true, - "value": "${{ needs.publish_manifests.result }}" - } - ], - "actions": [ - { - "type": "button", - "text": "Go to workflow run", - "url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}/attempts/${{ github.run_attempt }}" - } - ] - } - ] - } - env: - SLACK_BOT_TOKEN: ${{ secrets.SLACK_CONTAINER_IMAGE_TOKEN }} + build_image: + name: Reusable Workflow + uses: ./.github/workflows/reusable_build_image.yaml + secrets: + harbor-robot-secret: ${{ secrets.HARBOR_ROBOT_SDP_GITHUB_ACTION_BUILD_SECRET }} + slack-token: ${{ secrets.SLACK_CONTAINER_IMAGE_TOKEN }} + with: + product-name: opa + sdp-version: ${{ github.ref_type == 'tag' && github.ref_name || '0.0.0-dev' }} diff --git a/.github/workflows/build_spark-connect-client.yaml b/.github/workflows/build_spark-connect-client.yaml index 6d4628a8d..f3f25879d 100644 --- a/.github/workflows/build_spark-connect-client.yaml +++ b/.github/workflows/build_spark-connect-client.yaml @@ -3,10 +3,6 @@ name: Build Spark Connect Client run-name: | Build Spark Connect Client (attempt #${{ github.run_attempt }}) -env: - PRODUCT_NAME: spark-connect-client - SDP_VERSION: ${{ github.ref_type == 'tag' && github.ref_name || '0.0.0-dev' }} - on: workflow_dispatch: schedule: @@ -23,130 +19,15 @@ on: - java-base/** - .github/actions/** - .github/workflows/build_spark-connect-client.yaml + - .github/workflows/reusable_build_image.yaml jobs: - generate_matrix: - name: Generate Version List - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - with: - persist-credentials: false - - id: shard - uses: stackabletech/actions/shard@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - with: - product-name: ${{ env.PRODUCT_NAME }} - outputs: - versions: ${{ steps.shard.outputs.versions }} - - build: - name: Build/Publish ${{ matrix.versions }}-${{ matrix.runner.arch }} Image - needs: [generate_matrix] - permissions: - id-token: write - runs-on: ${{ matrix.runner.name }} - strategy: - fail-fast: false - matrix: - runner: - - {name: "ubuntu-latest", arch: "amd64"} - - {name: "ubicloud-standard-8-arm", arch: "arm64"} - versions: ${{ fromJson(needs.generate_matrix.outputs.versions) }} - steps: - - name: Checkout Repository - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - with: - persist-credentials: false - - - name: Free Disk Space - uses: stackabletech/actions/free-disk-space@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - - - name: Build Product Image - id: build - uses: stackabletech/actions/build-product-image@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - with: - product-name: ${{ env.PRODUCT_NAME }} - product-version: ${{ matrix.versions }} - build-cache-password: ${{ secrets.BUILD_CACHE_NEXUS_PASSWORD }} - sdp-version: ${{ env.SDP_VERSION }} - - - name: Publish Container Image on oci.stackable.tech - uses: stackabletech/actions/publish-image@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - with: - image-registry-uri: oci.stackable.tech - image-registry-username: robot$sdp+github-action-build - image-registry-password: ${{ secrets.HARBOR_ROBOT_SDP_GITHUB_ACTION_BUILD_SECRET }} - image-repository: sdp/${{ env.PRODUCT_NAME }} - image-manifest-tag: ${{ steps.build.outputs.image-manifest-tag }} - source-image-uri: localhost/${{ env.PRODUCT_NAME }}:${{ steps.build.outputs.image-manifest-tag }} - - publish_manifests: - name: Build/Publish ${{ matrix.versions }} Manifests - needs: [generate_matrix, build] - permissions: - id-token: write - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - versions: ${{ fromJson(needs.generate_matrix.outputs.versions) }} - steps: - - name: Checkout Repository - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - with: - persist-credentials: false - - - name: Publish and Sign Image Index Manifest to oci.stackable.tech - uses: stackabletech/actions/publish-index-manifest@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - with: - image-registry-uri: oci.stackable.tech - image-registry-username: robot$sdp+github-action-build - image-registry-password: ${{ secrets.HARBOR_ROBOT_SDP_GITHUB_ACTION_BUILD_SECRET }} - image-repository: sdp/${{ env.PRODUCT_NAME }} - image-index-manifest-tag: ${{ matrix.versions }}-stackable${{ env.SDP_VERSION }} - - notify: - name: Failure Notification - needs: [generate_matrix, build, publish_manifests] - runs-on: ubuntu-latest - if: failure() - steps: - - uses: slackapi/slack-github-action@37ebaef184d7626c5f204ab8d3baff4262dd30f0 # v1.27.0 - with: - channel-id: "C07UG6JH44F" # notifications-container-images - payload: | - { - "text": "*${{ github.workflow }}* failed (attempt ${{ github.run_attempt }})", - "attachments": [ - { - "pretext": "See the details below for a summary of which job(s) failed.", - "color": "#aa0000", - "fields": [ - { - "title": "Generate Version List", - "short": true, - "value": "${{ needs.generate_matrix.result }}" - }, - { - "title": "Build/Publish Image", - "short": true, - "value": "${{ needs.build.result }}" - }, - { - "title": "Build/Publish Manifests", - "short": true, - "value": "${{ needs.publish_manifests.result }}" - } - ], - "actions": [ - { - "type": "button", - "text": "Go to workflow run", - "url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}/attempts/${{ github.run_attempt }}" - } - ] - } - ] - } - env: - SLACK_BOT_TOKEN: ${{ secrets.SLACK_CONTAINER_IMAGE_TOKEN }} + build_image: + name: Reusable Workflow + uses: ./.github/workflows/reusable_build_image.yaml + secrets: + harbor-robot-secret: ${{ secrets.HARBOR_ROBOT_SDP_GITHUB_ACTION_BUILD_SECRET }} + slack-token: ${{ secrets.SLACK_CONTAINER_IMAGE_TOKEN }} + with: + product-name: spark-connect-client + sdp-version: ${{ github.ref_type == 'tag' && github.ref_name || '0.0.0-dev' }} diff --git a/.github/workflows/build_spark-k8s.yaml b/.github/workflows/build_spark-k8s.yaml index c5149692b..f9886f7f9 100644 --- a/.github/workflows/build_spark-k8s.yaml +++ b/.github/workflows/build_spark-k8s.yaml @@ -3,10 +3,6 @@ name: Build Spark K8s run-name: | Build Spark K8s (attempt #${{ github.run_attempt }}) -env: - PRODUCT_NAME: spark-k8s - SDP_VERSION: ${{ github.ref_type == 'tag' && github.ref_name || '0.0.0-dev' }} - on: workflow_dispatch: schedule: @@ -25,130 +21,15 @@ on: - java-devel/** - .github/actions/** - .github/workflows/build_spark-k8s.yaml + - .github/workflows/reusable_build_image.yaml jobs: - generate_matrix: - name: Generate Version List - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - with: - persist-credentials: false - - id: shard - uses: stackabletech/actions/shard@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - with: - product-name: ${{ env.PRODUCT_NAME }} - outputs: - versions: ${{ steps.shard.outputs.versions }} - - build: - name: Build/Publish ${{ matrix.versions }}-${{ matrix.runner.arch }} Image - needs: [generate_matrix] - permissions: - id-token: write - runs-on: ${{ matrix.runner.name }} - strategy: - fail-fast: false - matrix: - runner: - - {name: "ubuntu-latest", arch: "amd64"} - - {name: "ubicloud-standard-8-arm", arch: "arm64"} - versions: ${{ fromJson(needs.generate_matrix.outputs.versions) }} - steps: - - name: Checkout Repository - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - with: - persist-credentials: false - - - name: Free Disk Space - uses: stackabletech/actions/free-disk-space@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - - - name: Build Product Image - id: build - uses: stackabletech/actions/build-product-image@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - with: - product-name: ${{ env.PRODUCT_NAME }} - product-version: ${{ matrix.versions }} - build-cache-password: ${{ secrets.BUILD_CACHE_NEXUS_PASSWORD }} - sdp-version: ${{ env.SDP_VERSION }} - - - name: Publish Container Image on oci.stackable.tech - uses: stackabletech/actions/publish-image@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - with: - image-registry-uri: oci.stackable.tech - image-registry-username: robot$sdp+github-action-build - image-registry-password: ${{ secrets.HARBOR_ROBOT_SDP_GITHUB_ACTION_BUILD_SECRET }} - image-repository: sdp/${{ env.PRODUCT_NAME }} - image-manifest-tag: ${{ steps.build.outputs.image-manifest-tag }} - source-image-uri: localhost/${{ env.PRODUCT_NAME }}:${{ steps.build.outputs.image-manifest-tag }} - - publish_manifests: - name: Build/Publish ${{ matrix.versions }} Manifests - needs: [generate_matrix, build] - permissions: - id-token: write - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - versions: ${{ fromJson(needs.generate_matrix.outputs.versions) }} - steps: - - name: Checkout Repository - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - with: - persist-credentials: false - - - name: Publish and Sign Image Index Manifest to oci.stackable.tech - uses: stackabletech/actions/publish-index-manifest@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - with: - image-registry-uri: oci.stackable.tech - image-registry-username: robot$sdp+github-action-build - image-registry-password: ${{ secrets.HARBOR_ROBOT_SDP_GITHUB_ACTION_BUILD_SECRET }} - image-repository: sdp/${{ env.PRODUCT_NAME }} - image-index-manifest-tag: ${{ matrix.versions }}-stackable${{ env.SDP_VERSION }} - - notify: - name: Failure Notification - needs: [generate_matrix, build, publish_manifests] - runs-on: ubuntu-latest - if: failure() - steps: - - uses: slackapi/slack-github-action@37ebaef184d7626c5f204ab8d3baff4262dd30f0 # v1.27.0 - with: - channel-id: "C07UG6JH44F" # notifications-container-images - payload: | - { - "text": "*${{ github.workflow }}* failed (attempt ${{ github.run_attempt }})", - "attachments": [ - { - "pretext": "See the details below for a summary of which job(s) failed.", - "color": "#aa0000", - "fields": [ - { - "title": "Generate Version List", - "short": true, - "value": "${{ needs.generate_matrix.result }}" - }, - { - "title": "Build/Publish Image", - "short": true, - "value": "${{ needs.build.result }}" - }, - { - "title": "Build/Publish Manifests", - "short": true, - "value": "${{ needs.publish_manifests.result }}" - } - ], - "actions": [ - { - "type": "button", - "text": "Go to workflow run", - "url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}/attempts/${{ github.run_attempt }}" - } - ] - } - ] - } - env: - SLACK_BOT_TOKEN: ${{ secrets.SLACK_CONTAINER_IMAGE_TOKEN }} + build_image: + name: Reusable Workflow + uses: ./.github/workflows/reusable_build_image.yaml + secrets: + harbor-robot-secret: ${{ secrets.HARBOR_ROBOT_SDP_GITHUB_ACTION_BUILD_SECRET }} + slack-token: ${{ secrets.SLACK_CONTAINER_IMAGE_TOKEN }} + with: + product-name: spark-k8s + sdp-version: ${{ github.ref_type == 'tag' && github.ref_name || '0.0.0-dev' }} diff --git a/.github/workflows/build_stackable-base.yaml b/.github/workflows/build_stackable-base.yaml index 4a1d2f0de..502ef66af 100644 --- a/.github/workflows/build_stackable-base.yaml +++ b/.github/workflows/build_stackable-base.yaml @@ -3,10 +3,6 @@ name: Build Stackable Base run-name: | Build Stackable Base (attempt #${{ github.run_attempt }}) -env: - PRODUCT_NAME: stackable-base - SDP_VERSION: ${{ github.ref_type == 'tag' && github.ref_name || '0.0.0-dev' }} - on: workflow_dispatch: schedule: @@ -21,130 +17,15 @@ on: - tools/** - .github/actions/** - .github/workflows/build_stackable-base.yaml + - .github/workflows/reusable_build_image.yaml jobs: - generate_matrix: - name: Generate Version List - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - with: - persist-credentials: false - - id: shard - uses: stackabletech/actions/shard@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - with: - product-name: ${{ env.PRODUCT_NAME }} - outputs: - versions: ${{ steps.shard.outputs.versions }} - - build: - name: Build/Publish ${{ matrix.versions }}-${{ matrix.runner.arch }} Image - needs: [generate_matrix] - permissions: - id-token: write - runs-on: ${{ matrix.runner.name }} - strategy: - fail-fast: false - matrix: - runner: - - {name: "ubuntu-latest", arch: "amd64"} - - {name: "ubicloud-standard-8-arm", arch: "arm64"} - versions: ${{ fromJson(needs.generate_matrix.outputs.versions) }} - steps: - - name: Checkout Repository - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - with: - persist-credentials: false - - - name: Free Disk Space - uses: stackabletech/actions/free-disk-space@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - - - name: Build Product Image - id: build - uses: stackabletech/actions/build-product-image@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - with: - product-name: ${{ env.PRODUCT_NAME }} - product-version: ${{ matrix.versions }} - build-cache-password: ${{ secrets.BUILD_CACHE_NEXUS_PASSWORD }} - sdp-version: ${{ env.SDP_VERSION }} - - - name: Publish Container Image on oci.stackable.tech - uses: stackabletech/actions/publish-image@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - with: - image-registry-uri: oci.stackable.tech - image-registry-username: robot$sdp+github-action-build - image-registry-password: ${{ secrets.HARBOR_ROBOT_SDP_GITHUB_ACTION_BUILD_SECRET }} - image-repository: sdp/${{ env.PRODUCT_NAME }} - image-manifest-tag: ${{ steps.build.outputs.image-manifest-tag }} - source-image-uri: localhost/${{ env.PRODUCT_NAME }}:${{ steps.build.outputs.image-manifest-tag }} - - publish_manifests: - name: Build/Publish ${{ matrix.versions }} Manifests - needs: [generate_matrix, build] - permissions: - id-token: write - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - versions: ${{ fromJson(needs.generate_matrix.outputs.versions) }} - steps: - - name: Checkout Repository - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - with: - persist-credentials: false - - - name: Publish and Sign Image Index Manifest to oci.stackable.tech - uses: stackabletech/actions/publish-index-manifest@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - with: - image-registry-uri: oci.stackable.tech - image-registry-username: robot$sdp+github-action-build - image-registry-password: ${{ secrets.HARBOR_ROBOT_SDP_GITHUB_ACTION_BUILD_SECRET }} - image-repository: sdp/${{ env.PRODUCT_NAME }} - image-index-manifest-tag: ${{ matrix.versions }}-stackable${{ env.SDP_VERSION }} - - notify: - name: Failure Notification - needs: [generate_matrix, build, publish_manifests] - runs-on: ubuntu-latest - if: failure() - steps: - - uses: slackapi/slack-github-action@37ebaef184d7626c5f204ab8d3baff4262dd30f0 # v1.27.0 - with: - channel-id: "C07UG6JH44F" # notifications-container-images - payload: | - { - "text": "*${{ github.workflow }}* failed (attempt ${{ github.run_attempt }})", - "attachments": [ - { - "pretext": "See the details below for a summary of which job(s) failed.", - "color": "#aa0000", - "fields": [ - { - "title": "Generate Version List", - "short": true, - "value": "${{ needs.generate_matrix.result }}" - }, - { - "title": "Build/Publish Image", - "short": true, - "value": "${{ needs.build.result }}" - }, - { - "title": "Build/Publish Manifests", - "short": true, - "value": "${{ needs.publish_manifests.result }}" - } - ], - "actions": [ - { - "type": "button", - "text": "Go to workflow run", - "url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}/attempts/${{ github.run_attempt }}" - } - ] - } - ] - } - env: - SLACK_BOT_TOKEN: ${{ secrets.SLACK_CONTAINER_IMAGE_TOKEN }} + build_image: + name: Reusable Workflow + uses: ./.github/workflows/reusable_build_image.yaml + secrets: + harbor-robot-secret: ${{ secrets.HARBOR_ROBOT_SDP_GITHUB_ACTION_BUILD_SECRET }} + slack-token: ${{ secrets.SLACK_CONTAINER_IMAGE_TOKEN }} + with: + product-name: stackable-base + sdp-version: ${{ github.ref_type == 'tag' && github.ref_name || '0.0.0-dev' }} diff --git a/.github/workflows/build_superset.yaml b/.github/workflows/build_superset.yaml index 308bbf98a..ac181c8b7 100644 --- a/.github/workflows/build_superset.yaml +++ b/.github/workflows/build_superset.yaml @@ -3,10 +3,6 @@ name: Build Superset run-name: | Build Superset (attempt #${{ github.run_attempt }}) -env: - PRODUCT_NAME: superset - SDP_VERSION: ${{ github.ref_type == 'tag' && github.ref_name || '0.0.0-dev' }} - on: workflow_dispatch: schedule: @@ -22,130 +18,15 @@ on: - stackable-base/** - .github/actions/** - .github/workflows/build_superset.yaml + - .github/workflows/reusable_build_image.yaml jobs: - generate_matrix: - name: Generate Version List - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - with: - persist-credentials: false - - id: shard - uses: stackabletech/actions/shard@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - with: - product-name: ${{ env.PRODUCT_NAME }} - outputs: - versions: ${{ steps.shard.outputs.versions }} - - build: - name: Build/Publish ${{ matrix.versions }}-${{ matrix.runner.arch }} Image - needs: [generate_matrix] - permissions: - id-token: write - runs-on: ${{ matrix.runner.name }} - strategy: - fail-fast: false - matrix: - runner: - - {name: "ubuntu-latest", arch: "amd64"} - - {name: "ubicloud-standard-8-arm", arch: "arm64"} - versions: ${{ fromJson(needs.generate_matrix.outputs.versions) }} - steps: - - name: Checkout Repository - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - with: - persist-credentials: false - - - name: Free Disk Space - uses: stackabletech/actions/free-disk-space@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - - - name: Build Product Image - id: build - uses: stackabletech/actions/build-product-image@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - with: - product-name: ${{ env.PRODUCT_NAME }} - product-version: ${{ matrix.versions }} - build-cache-password: ${{ secrets.BUILD_CACHE_NEXUS_PASSWORD }} - sdp-version: ${{ env.SDP_VERSION }} - - - name: Publish Container Image on oci.stackable.tech - uses: stackabletech/actions/publish-image@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - with: - image-registry-uri: oci.stackable.tech - image-registry-username: robot$sdp+github-action-build - image-registry-password: ${{ secrets.HARBOR_ROBOT_SDP_GITHUB_ACTION_BUILD_SECRET }} - image-repository: sdp/${{ env.PRODUCT_NAME }} - image-manifest-tag: ${{ steps.build.outputs.image-manifest-tag }} - source-image-uri: localhost/${{ env.PRODUCT_NAME }}:${{ steps.build.outputs.image-manifest-tag }} - - publish_manifests: - name: Build/Publish ${{ matrix.versions }} Manifests - needs: [generate_matrix, build] - permissions: - id-token: write - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - versions: ${{ fromJson(needs.generate_matrix.outputs.versions) }} - steps: - - name: Checkout Repository - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - with: - persist-credentials: false - - - name: Publish and Sign Image Index Manifest to oci.stackable.tech - uses: stackabletech/actions/publish-index-manifest@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - with: - image-registry-uri: oci.stackable.tech - image-registry-username: robot$sdp+github-action-build - image-registry-password: ${{ secrets.HARBOR_ROBOT_SDP_GITHUB_ACTION_BUILD_SECRET }} - image-repository: sdp/${{ env.PRODUCT_NAME }} - image-index-manifest-tag: ${{ matrix.versions }}-stackable${{ env.SDP_VERSION }} - - notify: - name: Failure Notification - needs: [generate_matrix, build, publish_manifests] - runs-on: ubuntu-latest - if: failure() - steps: - - uses: slackapi/slack-github-action@37ebaef184d7626c5f204ab8d3baff4262dd30f0 # v1.27.0 - with: - channel-id: "C07UG6JH44F" # notifications-container-images - payload: | - { - "text": "*${{ github.workflow }}* failed (attempt ${{ github.run_attempt }})", - "attachments": [ - { - "pretext": "See the details below for a summary of which job(s) failed.", - "color": "#aa0000", - "fields": [ - { - "title": "Generate Version List", - "short": true, - "value": "${{ needs.generate_matrix.result }}" - }, - { - "title": "Build/Publish Image", - "short": true, - "value": "${{ needs.build.result }}" - }, - { - "title": "Build/Publish Manifests", - "short": true, - "value": "${{ needs.publish_manifests.result }}" - } - ], - "actions": [ - { - "type": "button", - "text": "Go to workflow run", - "url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}/attempts/${{ github.run_attempt }}" - } - ] - } - ] - } - env: - SLACK_BOT_TOKEN: ${{ secrets.SLACK_CONTAINER_IMAGE_TOKEN }} + build_image: + name: Reusable Workflow + uses: ./.github/workflows/reusable_build_image.yaml + secrets: + harbor-robot-secret: ${{ secrets.HARBOR_ROBOT_SDP_GITHUB_ACTION_BUILD_SECRET }} + slack-token: ${{ secrets.SLACK_CONTAINER_IMAGE_TOKEN }} + with: + product-name: superset + sdp-version: ${{ github.ref_type == 'tag' && github.ref_name || '0.0.0-dev' }} diff --git a/.github/workflows/build_testing-tools.yaml b/.github/workflows/build_testing-tools.yaml index c5e32c14f..42cd701cc 100644 --- a/.github/workflows/build_testing-tools.yaml +++ b/.github/workflows/build_testing-tools.yaml @@ -3,10 +3,6 @@ name: Build Testing Tools run-name: | Build Testing Tools (attempt #${{ github.run_attempt }}) -env: - PRODUCT_NAME: testing-tools - SDP_VERSION: ${{ github.ref_type == 'tag' && github.ref_name || '0.0.0-dev' }} - on: workflow_dispatch: schedule: @@ -20,130 +16,15 @@ on: - testing-tools/** - .github/actions/** - .github/workflows/build_testing-tools.yaml + - .github/workflows/reusable_build_image.yaml jobs: - generate_matrix: - name: Generate Version List - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - with: - persist-credentials: false - - id: shard - uses: stackabletech/actions/shard@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - with: - product-name: ${{ env.PRODUCT_NAME }} - outputs: - versions: ${{ steps.shard.outputs.versions }} - - build: - name: Build/Publish ${{ matrix.versions }}-${{ matrix.runner.arch }} Image - needs: [generate_matrix] - permissions: - id-token: write - runs-on: ${{ matrix.runner.name }} - strategy: - fail-fast: false - matrix: - runner: - - {name: "ubuntu-latest", arch: "amd64"} - - {name: "ubicloud-standard-8-arm", arch: "arm64"} - versions: ${{ fromJson(needs.generate_matrix.outputs.versions) }} - steps: - - name: Checkout Repository - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - with: - persist-credentials: false - - - name: Free Disk Space - uses: stackabletech/actions/free-disk-space@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - - - name: Build Product Image - id: build - uses: stackabletech/actions/build-product-image@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - with: - product-name: ${{ env.PRODUCT_NAME }} - product-version: ${{ matrix.versions }} - build-cache-password: ${{ secrets.BUILD_CACHE_NEXUS_PASSWORD }} - sdp-version: ${{ env.SDP_VERSION }} - - - name: Publish Container Image on oci.stackable.tech - uses: stackabletech/actions/publish-image@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - with: - image-registry-uri: oci.stackable.tech - image-registry-username: robot$sdp+github-action-build - image-registry-password: ${{ secrets.HARBOR_ROBOT_SDP_GITHUB_ACTION_BUILD_SECRET }} - image-repository: sdp/${{ env.PRODUCT_NAME }} - image-manifest-tag: ${{ steps.build.outputs.image-manifest-tag }} - source-image-uri: localhost/${{ env.PRODUCT_NAME }}:${{ steps.build.outputs.image-manifest-tag }} - - publish_manifests: - name: Build/Publish ${{ matrix.versions }} Manifests - needs: [generate_matrix, build] - permissions: - id-token: write - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - versions: ${{ fromJson(needs.generate_matrix.outputs.versions) }} - steps: - - name: Checkout Repository - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - with: - persist-credentials: false - - - name: Publish and Sign Image Index Manifest to oci.stackable.tech - uses: stackabletech/actions/publish-index-manifest@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - with: - image-registry-uri: oci.stackable.tech - image-registry-username: robot$sdp+github-action-build - image-registry-password: ${{ secrets.HARBOR_ROBOT_SDP_GITHUB_ACTION_BUILD_SECRET }} - image-repository: sdp/${{ env.PRODUCT_NAME }} - image-index-manifest-tag: ${{ matrix.versions }}-stackable${{ env.SDP_VERSION }} - - notify: - name: Failure Notification - needs: [generate_matrix, build, publish_manifests] - runs-on: ubuntu-latest - if: failure() - steps: - - uses: slackapi/slack-github-action@37ebaef184d7626c5f204ab8d3baff4262dd30f0 # v1.27.0 - with: - channel-id: "C07UG6JH44F" # notifications-container-images - payload: | - { - "text": "*${{ github.workflow }}* failed (attempt ${{ github.run_attempt }})", - "attachments": [ - { - "pretext": "See the details below for a summary of which job(s) failed.", - "color": "#aa0000", - "fields": [ - { - "title": "Generate Version List", - "short": true, - "value": "${{ needs.generate_matrix.result }}" - }, - { - "title": "Build/Publish Image", - "short": true, - "value": "${{ needs.build.result }}" - }, - { - "title": "Build/Publish Manifests", - "short": true, - "value": "${{ needs.publish_manifests.result }}" - } - ], - "actions": [ - { - "type": "button", - "text": "Go to workflow run", - "url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}/attempts/${{ github.run_attempt }}" - } - ] - } - ] - } - env: - SLACK_BOT_TOKEN: ${{ secrets.SLACK_CONTAINER_IMAGE_TOKEN }} + build_image: + name: Reusable Workflow + uses: ./.github/workflows/reusable_build_image.yaml + secrets: + harbor-robot-secret: ${{ secrets.HARBOR_ROBOT_SDP_GITHUB_ACTION_BUILD_SECRET }} + slack-token: ${{ secrets.SLACK_CONTAINER_IMAGE_TOKEN }} + with: + product-name: testing-tools + sdp-version: ${{ github.ref_type == 'tag' && github.ref_name || '0.0.0-dev' }} diff --git a/.github/workflows/build_tools.yaml b/.github/workflows/build_tools.yaml index bd103350f..34ed34f84 100644 --- a/.github/workflows/build_tools.yaml +++ b/.github/workflows/build_tools.yaml @@ -3,10 +3,6 @@ name: Build Tools run-name: | Build Tools (attempt #${{ github.run_attempt }}) -env: - PRODUCT_NAME: tools - SDP_VERSION: ${{ github.ref_type == 'tag' && github.ref_name || '0.0.0-dev' }} - on: workflow_dispatch: schedule: @@ -21,130 +17,15 @@ on: - stackable-base/** - .github/actions/** - .github/workflows/build_tools.yaml + - .github/workflows/reusable_build_image.yaml jobs: - generate_matrix: - name: Generate Version List - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - with: - persist-credentials: false - - id: shard - uses: stackabletech/actions/shard@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - with: - product-name: ${{ env.PRODUCT_NAME }} - outputs: - versions: ${{ steps.shard.outputs.versions }} - - build: - name: Build/Publish ${{ matrix.versions }}-${{ matrix.runner.arch }} Image - needs: [generate_matrix] - permissions: - id-token: write - runs-on: ${{ matrix.runner.name }} - strategy: - fail-fast: false - matrix: - runner: - - {name: "ubuntu-latest", arch: "amd64"} - - {name: "ubicloud-standard-8-arm", arch: "arm64"} - versions: ${{ fromJson(needs.generate_matrix.outputs.versions) }} - steps: - - name: Checkout Repository - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - with: - persist-credentials: false - - - name: Free Disk Space - uses: stackabletech/actions/free-disk-space@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - - - name: Build Product Image - id: build - uses: stackabletech/actions/build-product-image@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - with: - product-name: ${{ env.PRODUCT_NAME }} - product-version: ${{ matrix.versions }} - build-cache-password: ${{ secrets.BUILD_CACHE_NEXUS_PASSWORD }} - sdp-version: ${{ env.SDP_VERSION }} - - - name: Publish Container Image on oci.stackable.tech - uses: stackabletech/actions/publish-image@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - with: - image-registry-uri: oci.stackable.tech - image-registry-username: robot$sdp+github-action-build - image-registry-password: ${{ secrets.HARBOR_ROBOT_SDP_GITHUB_ACTION_BUILD_SECRET }} - image-repository: sdp/${{ env.PRODUCT_NAME }} - image-manifest-tag: ${{ steps.build.outputs.image-manifest-tag }} - source-image-uri: localhost/${{ env.PRODUCT_NAME }}:${{ steps.build.outputs.image-manifest-tag }} - - publish_manifests: - name: Build/Publish ${{ matrix.versions }} Manifests - needs: [generate_matrix, build] - permissions: - id-token: write - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - versions: ${{ fromJson(needs.generate_matrix.outputs.versions) }} - steps: - - name: Checkout Repository - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - with: - persist-credentials: false - - - name: Publish and Sign Image Index Manifest to oci.stackable.tech - uses: stackabletech/actions/publish-index-manifest@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - with: - image-registry-uri: oci.stackable.tech - image-registry-username: robot$sdp+github-action-build - image-registry-password: ${{ secrets.HARBOR_ROBOT_SDP_GITHUB_ACTION_BUILD_SECRET }} - image-repository: sdp/${{ env.PRODUCT_NAME }} - image-index-manifest-tag: ${{ matrix.versions }}-stackable${{ env.SDP_VERSION }} - - notify: - name: Failure Notification - needs: [generate_matrix, build, publish_manifests] - runs-on: ubuntu-latest - if: failure() - steps: - - uses: slackapi/slack-github-action@37ebaef184d7626c5f204ab8d3baff4262dd30f0 # v1.27.0 - with: - channel-id: "C07UG6JH44F" # notifications-container-images - payload: | - { - "text": "*${{ github.workflow }}* failed (attempt ${{ github.run_attempt }})", - "attachments": [ - { - "pretext": "See the details below for a summary of which job(s) failed.", - "color": "#aa0000", - "fields": [ - { - "title": "Generate Version List", - "short": true, - "value": "${{ needs.generate_matrix.result }}" - }, - { - "title": "Build/Publish Image", - "short": true, - "value": "${{ needs.build.result }}" - }, - { - "title": "Build/Publish Manifests", - "short": true, - "value": "${{ needs.publish_manifests.result }}" - } - ], - "actions": [ - { - "type": "button", - "text": "Go to workflow run", - "url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}/attempts/${{ github.run_attempt }}" - } - ] - } - ] - } - env: - SLACK_BOT_TOKEN: ${{ secrets.SLACK_CONTAINER_IMAGE_TOKEN }} + build_image: + name: Reusable Workflow + uses: ./.github/workflows/reusable_build_image.yaml + secrets: + harbor-robot-secret: ${{ secrets.HARBOR_ROBOT_SDP_GITHUB_ACTION_BUILD_SECRET }} + slack-token: ${{ secrets.SLACK_CONTAINER_IMAGE_TOKEN }} + with: + product-name: tools + sdp-version: ${{ github.ref_type == 'tag' && github.ref_name || '0.0.0-dev' }} diff --git a/.github/workflows/build_trino-cli.yaml b/.github/workflows/build_trino-cli.yaml index bfcc4dd32..e28f10b2e 100644 --- a/.github/workflows/build_trino-cli.yaml +++ b/.github/workflows/build_trino-cli.yaml @@ -3,10 +3,6 @@ name: Build Trino CLI run-name: | Build Trino CLI (attempt #${{ github.run_attempt }}) -env: - PRODUCT_NAME: trino-cli - SDP_VERSION: ${{ github.ref_type == 'tag' && github.ref_name || '0.0.0-dev' }} - on: workflow_dispatch: schedule: @@ -23,130 +19,15 @@ on: - java-base/** - .github/actions/** - .github/workflows/build_trino-cli.yaml + - .github/workflows/reusable_build_image.yaml jobs: - generate_matrix: - name: Generate Version List - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - with: - persist-credentials: false - - id: shard - uses: stackabletech/actions/shard@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - with: - product-name: ${{ env.PRODUCT_NAME }} - outputs: - versions: ${{ steps.shard.outputs.versions }} - - build: - name: Build/Publish ${{ matrix.versions }}-${{ matrix.runner.arch }} Image - needs: [generate_matrix] - permissions: - id-token: write - runs-on: ${{ matrix.runner.name }} - strategy: - fail-fast: false - matrix: - runner: - - {name: "ubuntu-latest", arch: "amd64"} - - {name: "ubicloud-standard-8-arm", arch: "arm64"} - versions: ${{ fromJson(needs.generate_matrix.outputs.versions) }} - steps: - - name: Checkout Repository - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - with: - persist-credentials: false - - - name: Free Disk Space - uses: stackabletech/actions/free-disk-space@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - - - name: Build Product Image - id: build - uses: stackabletech/actions/build-product-image@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - with: - product-name: ${{ env.PRODUCT_NAME }} - product-version: ${{ matrix.versions }} - build-cache-password: ${{ secrets.BUILD_CACHE_NEXUS_PASSWORD }} - sdp-version: ${{ env.SDP_VERSION }} - - - name: Publish Container Image on oci.stackable.tech - uses: stackabletech/actions/publish-image@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - with: - image-registry-uri: oci.stackable.tech - image-registry-username: robot$sdp+github-action-build - image-registry-password: ${{ secrets.HARBOR_ROBOT_SDP_GITHUB_ACTION_BUILD_SECRET }} - image-repository: sdp/${{ env.PRODUCT_NAME }} - image-manifest-tag: ${{ steps.build.outputs.image-manifest-tag }} - source-image-uri: localhost/${{ env.PRODUCT_NAME }}:${{ steps.build.outputs.image-manifest-tag }} - - publish_manifests: - name: Build/Publish ${{ matrix.versions }} Manifests - needs: [generate_matrix, build] - permissions: - id-token: write - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - versions: ${{ fromJson(needs.generate_matrix.outputs.versions) }} - steps: - - name: Checkout Repository - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - with: - persist-credentials: false - - - name: Publish and Sign Image Index Manifest to oci.stackable.tech - uses: stackabletech/actions/publish-index-manifest@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - with: - image-registry-uri: oci.stackable.tech - image-registry-username: robot$sdp+github-action-build - image-registry-password: ${{ secrets.HARBOR_ROBOT_SDP_GITHUB_ACTION_BUILD_SECRET }} - image-repository: sdp/${{ env.PRODUCT_NAME }} - image-index-manifest-tag: ${{ matrix.versions }}-stackable${{ env.SDP_VERSION }} - - notify: - name: Failure Notification - needs: [generate_matrix, build, publish_manifests] - runs-on: ubuntu-latest - if: failure() - steps: - - uses: slackapi/slack-github-action@37ebaef184d7626c5f204ab8d3baff4262dd30f0 # v1.27.0 - with: - channel-id: "C07UG6JH44F" # notifications-container-images - payload: | - { - "text": "*${{ github.workflow }}* failed (attempt ${{ github.run_attempt }})", - "attachments": [ - { - "pretext": "See the details below for a summary of which job(s) failed.", - "color": "#aa0000", - "fields": [ - { - "title": "Generate Version List", - "short": true, - "value": "${{ needs.generate_matrix.result }}" - }, - { - "title": "Build/Publish Image", - "short": true, - "value": "${{ needs.build.result }}" - }, - { - "title": "Build/Publish Manifests", - "short": true, - "value": "${{ needs.publish_manifests.result }}" - } - ], - "actions": [ - { - "type": "button", - "text": "Go to workflow run", - "url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}/attempts/${{ github.run_attempt }}" - } - ] - } - ] - } - env: - SLACK_BOT_TOKEN: ${{ secrets.SLACK_CONTAINER_IMAGE_TOKEN }} + build_image: + name: Reusable Workflow + uses: ./.github/workflows/reusable_build_image.yaml + secrets: + harbor-robot-secret: ${{ secrets.HARBOR_ROBOT_SDP_GITHUB_ACTION_BUILD_SECRET }} + slack-token: ${{ secrets.SLACK_CONTAINER_IMAGE_TOKEN }} + with: + product-name: trino-cli + sdp-version: ${{ github.ref_type == 'tag' && github.ref_name || '0.0.0-dev' }} diff --git a/.github/workflows/build_trino.yaml b/.github/workflows/build_trino.yaml index 95b4c6aa3..850234033 100644 --- a/.github/workflows/build_trino.yaml +++ b/.github/workflows/build_trino.yaml @@ -3,10 +3,6 @@ name: Build Trino run-name: | Build Trino (attempt #${{ github.run_attempt }}) -env: - PRODUCT_NAME: trino - SDP_VERSION: ${{ github.ref_type == 'tag' && github.ref_name || '0.0.0-dev' }} - on: workflow_dispatch: schedule: @@ -24,130 +20,15 @@ on: - java-devel/** - .github/actions/** - .github/workflows/build_trino.yaml + - .github/workflows/reusable_build_image.yaml jobs: - generate_matrix: - name: Generate Version List - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - with: - persist-credentials: false - - id: shard - uses: stackabletech/actions/shard@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - with: - product-name: ${{ env.PRODUCT_NAME }} - outputs: - versions: ${{ steps.shard.outputs.versions }} - - build: - name: Build/Publish ${{ matrix.versions }}-${{ matrix.runner.arch }} Image - needs: [generate_matrix] - permissions: - id-token: write - runs-on: ${{ matrix.runner.name }} - strategy: - fail-fast: false - matrix: - runner: - - {name: "ubuntu-latest", arch: "amd64"} - - {name: "ubicloud-standard-8-arm", arch: "arm64"} - versions: ${{ fromJson(needs.generate_matrix.outputs.versions) }} - steps: - - name: Checkout Repository - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - with: - persist-credentials: false - - - name: Free Disk Space - uses: stackabletech/actions/free-disk-space@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - - - name: Build Product Image - id: build - uses: stackabletech/actions/build-product-image@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - with: - product-name: ${{ env.PRODUCT_NAME }} - product-version: ${{ matrix.versions }} - build-cache-password: ${{ secrets.BUILD_CACHE_NEXUS_PASSWORD }} - sdp-version: ${{ env.SDP_VERSION }} - - - name: Publish Container Image on oci.stackable.tech - uses: stackabletech/actions/publish-image@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - with: - image-registry-uri: oci.stackable.tech - image-registry-username: robot$sdp+github-action-build - image-registry-password: ${{ secrets.HARBOR_ROBOT_SDP_GITHUB_ACTION_BUILD_SECRET }} - image-repository: sdp/${{ env.PRODUCT_NAME }} - image-manifest-tag: ${{ steps.build.outputs.image-manifest-tag }} - source-image-uri: localhost/${{ env.PRODUCT_NAME }}:${{ steps.build.outputs.image-manifest-tag }} - - publish_manifests: - name: Build/Publish ${{ matrix.versions }} Manifests - needs: [generate_matrix, build] - permissions: - id-token: write - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - versions: ${{ fromJson(needs.generate_matrix.outputs.versions) }} - steps: - - name: Checkout Repository - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - with: - persist-credentials: false - - - name: Publish and Sign Image Index Manifest to oci.stackable.tech - uses: stackabletech/actions/publish-index-manifest@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - with: - image-registry-uri: oci.stackable.tech - image-registry-username: robot$sdp+github-action-build - image-registry-password: ${{ secrets.HARBOR_ROBOT_SDP_GITHUB_ACTION_BUILD_SECRET }} - image-repository: sdp/${{ env.PRODUCT_NAME }} - image-index-manifest-tag: ${{ matrix.versions }}-stackable${{ env.SDP_VERSION }} - - notify: - name: Failure Notification - needs: [generate_matrix, build, publish_manifests] - runs-on: ubuntu-latest - if: failure() - steps: - - uses: slackapi/slack-github-action@37ebaef184d7626c5f204ab8d3baff4262dd30f0 # v1.27.0 - with: - channel-id: "C07UG6JH44F" # notifications-container-images - payload: | - { - "text": "*${{ github.workflow }}* failed (attempt ${{ github.run_attempt }})", - "attachments": [ - { - "pretext": "See the details below for a summary of which job(s) failed.", - "color": "#aa0000", - "fields": [ - { - "title": "Generate Version List", - "short": true, - "value": "${{ needs.generate_matrix.result }}" - }, - { - "title": "Build/Publish Image", - "short": true, - "value": "${{ needs.build.result }}" - }, - { - "title": "Build/Publish Manifests", - "short": true, - "value": "${{ needs.publish_manifests.result }}" - } - ], - "actions": [ - { - "type": "button", - "text": "Go to workflow run", - "url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}/attempts/${{ github.run_attempt }}" - } - ] - } - ] - } - env: - SLACK_BOT_TOKEN: ${{ secrets.SLACK_CONTAINER_IMAGE_TOKEN }} + build_image: + name: Reusable Workflow + uses: ./.github/workflows/reusable_build_image.yaml + secrets: + harbor-robot-secret: ${{ secrets.HARBOR_ROBOT_SDP_GITHUB_ACTION_BUILD_SECRET }} + slack-token: ${{ secrets.SLACK_CONTAINER_IMAGE_TOKEN }} + with: + product-name: trino + sdp-version: ${{ github.ref_type == 'tag' && github.ref_name || '0.0.0-dev' }} diff --git a/.github/workflows/build_vector.yaml b/.github/workflows/build_vector.yaml index 34fe97b0c..2d237f771 100644 --- a/.github/workflows/build_vector.yaml +++ b/.github/workflows/build_vector.yaml @@ -3,10 +3,6 @@ name: Build Vector run-name: | Build Vector (attempt #${{ github.run_attempt }}) -env: - PRODUCT_NAME: vector - SDP_VERSION: ${{ github.ref_type == 'tag' && github.ref_name || '0.0.0-dev' }} - on: workflow_dispatch: schedule: @@ -20,130 +16,15 @@ on: - vector/** - .github/actions/** - .github/workflows/build_vector.yaml + - .github/workflows/reusable_build_image.yaml jobs: - generate_matrix: - name: Generate Version List - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - with: - persist-credentials: false - - id: shard - uses: stackabletech/actions/shard@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - with: - product-name: ${{ env.PRODUCT_NAME }} - outputs: - versions: ${{ steps.shard.outputs.versions }} - - build: - name: Build/Publish ${{ matrix.versions }}-${{ matrix.runner.arch }} Image - needs: [generate_matrix] - permissions: - id-token: write - runs-on: ${{ matrix.runner.name }} - strategy: - fail-fast: false - matrix: - runner: - - {name: "ubuntu-latest", arch: "amd64"} - - {name: "ubicloud-standard-8-arm", arch: "arm64"} - versions: ${{ fromJson(needs.generate_matrix.outputs.versions) }} - steps: - - name: Checkout Repository - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - with: - persist-credentials: false - - - name: Free Disk Space - uses: stackabletech/actions/free-disk-space@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - - - name: Build Product Image - id: build - uses: stackabletech/actions/build-product-image@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - with: - product-name: ${{ env.PRODUCT_NAME }} - product-version: ${{ matrix.versions }} - build-cache-password: ${{ secrets.BUILD_CACHE_NEXUS_PASSWORD }} - sdp-version: ${{ env.SDP_VERSION }} - - - name: Publish Container Image on oci.stackable.tech - uses: stackabletech/actions/publish-image@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - with: - image-registry-uri: oci.stackable.tech - image-registry-username: robot$sdp+github-action-build - image-registry-password: ${{ secrets.HARBOR_ROBOT_SDP_GITHUB_ACTION_BUILD_SECRET }} - image-repository: sdp/${{ env.PRODUCT_NAME }} - image-manifest-tag: ${{ steps.build.outputs.image-manifest-tag }} - source-image-uri: localhost/${{ env.PRODUCT_NAME }}:${{ steps.build.outputs.image-manifest-tag }} - - publish_manifests: - name: Build/Publish ${{ matrix.versions }} Manifests - needs: [generate_matrix, build] - permissions: - id-token: write - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - versions: ${{ fromJson(needs.generate_matrix.outputs.versions) }} - steps: - - name: Checkout Repository - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - with: - persist-credentials: false - - - name: Publish and Sign Image Index Manifest to oci.stackable.tech - uses: stackabletech/actions/publish-index-manifest@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - with: - image-registry-uri: oci.stackable.tech - image-registry-username: robot$sdp+github-action-build - image-registry-password: ${{ secrets.HARBOR_ROBOT_SDP_GITHUB_ACTION_BUILD_SECRET }} - image-repository: sdp/${{ env.PRODUCT_NAME }} - image-index-manifest-tag: ${{ matrix.versions }}-stackable${{ env.SDP_VERSION }} - - notify: - name: Failure Notification - needs: [generate_matrix, build, publish_manifests] - runs-on: ubuntu-latest - if: failure() - steps: - - uses: slackapi/slack-github-action@37ebaef184d7626c5f204ab8d3baff4262dd30f0 # v1.27.0 - with: - channel-id: "C07UG6JH44F" # notifications-container-images - payload: | - { - "text": "*${{ github.workflow }}* failed (attempt ${{ github.run_attempt }})", - "attachments": [ - { - "pretext": "See the details below for a summary of which job(s) failed.", - "color": "#aa0000", - "fields": [ - { - "title": "Generate Version List", - "short": true, - "value": "${{ needs.generate_matrix.result }}" - }, - { - "title": "Build/Publish Image", - "short": true, - "value": "${{ needs.build.result }}" - }, - { - "title": "Build/Publish Manifests", - "short": true, - "value": "${{ needs.publish_manifests.result }}" - } - ], - "actions": [ - { - "type": "button", - "text": "Go to workflow run", - "url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}/attempts/${{ github.run_attempt }}" - } - ] - } - ] - } - env: - SLACK_BOT_TOKEN: ${{ secrets.SLACK_CONTAINER_IMAGE_TOKEN }} + build_image: + name: Reusable Workflow + uses: ./.github/workflows/reusable_build_image.yaml + secrets: + harbor-robot-secret: ${{ secrets.HARBOR_ROBOT_SDP_GITHUB_ACTION_BUILD_SECRET }} + slack-token: ${{ secrets.SLACK_CONTAINER_IMAGE_TOKEN }} + with: + product-name: vector + sdp-version: ${{ github.ref_type == 'tag' && github.ref_name || '0.0.0-dev' }} diff --git a/.github/workflows/build_zookeeper.yaml b/.github/workflows/build_zookeeper.yaml index 7ee214243..e761eb0da 100644 --- a/.github/workflows/build_zookeeper.yaml +++ b/.github/workflows/build_zookeeper.yaml @@ -3,10 +3,6 @@ name: Build ZooKeeper run-name: | Build ZooKeeper (attempt #${{ github.run_attempt }}) -env: - PRODUCT_NAME: zookeeper - SDP_VERSION: ${{ github.ref_type == 'tag' && github.ref_name || '0.0.0-dev' }} - on: workflow_dispatch: schedule: @@ -24,130 +20,15 @@ on: - java-devel/** - .github/actions/** - .github/workflows/build_zookeeper.yaml + - .github/workflows/reusable_build_image.yaml jobs: - generate_matrix: - name: Generate Version List - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - with: - persist-credentials: false - - id: shard - uses: stackabletech/actions/shard@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - with: - product-name: ${{ env.PRODUCT_NAME }} - outputs: - versions: ${{ steps.shard.outputs.versions }} - - build: - name: Build/Publish ${{ matrix.versions }}-${{ matrix.runner.arch }} Image - needs: [generate_matrix] - permissions: - id-token: write - runs-on: ${{ matrix.runner.name }} - strategy: - fail-fast: false - matrix: - runner: - - {name: "ubuntu-latest", arch: "amd64"} - - {name: "ubicloud-standard-8-arm", arch: "arm64"} - versions: ${{ fromJson(needs.generate_matrix.outputs.versions) }} - steps: - - name: Checkout Repository - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - with: - persist-credentials: false - - - name: Free Disk Space - uses: stackabletech/actions/free-disk-space@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - - - name: Build Product Image - id: build - uses: stackabletech/actions/build-product-image@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - with: - product-name: ${{ env.PRODUCT_NAME }} - product-version: ${{ matrix.versions }} - build-cache-password: ${{ secrets.BUILD_CACHE_NEXUS_PASSWORD }} - sdp-version: ${{ env.SDP_VERSION }} - - - name: Publish Container Image on oci.stackable.tech - uses: stackabletech/actions/publish-image@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - with: - image-registry-uri: oci.stackable.tech - image-registry-username: robot$sdp+github-action-build - image-registry-password: ${{ secrets.HARBOR_ROBOT_SDP_GITHUB_ACTION_BUILD_SECRET }} - image-repository: sdp/${{ env.PRODUCT_NAME }} - image-manifest-tag: ${{ steps.build.outputs.image-manifest-tag }} - source-image-uri: localhost/${{ env.PRODUCT_NAME }}:${{ steps.build.outputs.image-manifest-tag }} - - publish_manifests: - name: Build/Publish ${{ matrix.versions }} Manifests - needs: [generate_matrix, build] - permissions: - id-token: write - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - versions: ${{ fromJson(needs.generate_matrix.outputs.versions) }} - steps: - - name: Checkout Repository - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - with: - persist-credentials: false - - - name: Publish and Sign Image Index Manifest to oci.stackable.tech - uses: stackabletech/actions/publish-index-manifest@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0 - with: - image-registry-uri: oci.stackable.tech - image-registry-username: robot$sdp+github-action-build - image-registry-password: ${{ secrets.HARBOR_ROBOT_SDP_GITHUB_ACTION_BUILD_SECRET }} - image-repository: sdp/${{ env.PRODUCT_NAME }} - image-index-manifest-tag: ${{ matrix.versions }}-stackable${{ env.SDP_VERSION }} - - notify: - name: Failure Notification - needs: [generate_matrix, build, publish_manifests] - runs-on: ubuntu-latest - if: failure() - steps: - - uses: slackapi/slack-github-action@37ebaef184d7626c5f204ab8d3baff4262dd30f0 # v1.27.0 - with: - channel-id: "C07UG6JH44F" # notifications-container-images - payload: | - { - "text": "*${{ github.workflow }}* failed (attempt ${{ github.run_attempt }})", - "attachments": [ - { - "pretext": "See the details below for a summary of which job(s) failed.", - "color": "#aa0000", - "fields": [ - { - "title": "Generate Version List", - "short": true, - "value": "${{ needs.generate_matrix.result }}" - }, - { - "title": "Build/Publish Image", - "short": true, - "value": "${{ needs.build.result }}" - }, - { - "title": "Build/Publish Manifests", - "short": true, - "value": "${{ needs.publish_manifests.result }}" - } - ], - "actions": [ - { - "type": "button", - "text": "Go to workflow run", - "url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}/attempts/${{ github.run_attempt }}" - } - ] - } - ] - } - env: - SLACK_BOT_TOKEN: ${{ secrets.SLACK_CONTAINER_IMAGE_TOKEN }} + build_image: + name: Reusable Workflow + uses: ./.github/workflows/reusable_build_image.yaml + secrets: + harbor-robot-secret: ${{ secrets.HARBOR_ROBOT_SDP_GITHUB_ACTION_BUILD_SECRET }} + slack-token: ${{ secrets.SLACK_CONTAINER_IMAGE_TOKEN }} + with: + product-name: zookeeper + sdp-version: ${{ github.ref_type == 'tag' && github.ref_name || '0.0.0-dev' }} diff --git a/.github/workflows/reusable_build_image.yaml b/.github/workflows/reusable_build_image.yaml new file mode 100644 index 000000000..ed226d60e --- /dev/null +++ b/.github/workflows/reusable_build_image.yaml @@ -0,0 +1,142 @@ +on: + workflow_call: + inputs: + product-name: + required: true + type: string + sdp-version: + required: true + type: string + secrets: + harbor-robot-secret: + description: The secret for the Harbor robot user used to push images and manifest + required: true + slack-token: + description: The Slack token used to post failure notifications + required: true + +jobs: + generate_matrix: + name: Generate Version List + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + with: + persist-credentials: false + - id: shard + uses: stackabletech/actions/shard@2d3d7ddad981ae09901d45a0f6bf30c2658b1b78 # 0.7.0 + with: + product-name: ${{ inputs.product-name }} + outputs: + versions: ${{ steps.shard.outputs.versions }} + + build: + name: Build/Publish ${{ matrix.versions }}-${{ matrix.runner.arch }} Image + needs: [generate_matrix] + permissions: + id-token: write + runs-on: ${{ matrix.runner.name }} + strategy: + fail-fast: false + matrix: + runner: + - {name: "ubuntu-latest", arch: "amd64"} + - {name: "ubicloud-standard-8-arm", arch: "arm64"} + versions: ${{ fromJson(needs.generate_matrix.outputs.versions) }} + steps: + - name: Checkout Repository + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + with: + persist-credentials: false + + - name: Free Disk Space + uses: stackabletech/actions/free-disk-space@2d3d7ddad981ae09901d45a0f6bf30c2658b1b78 # 0.7.0 + + - name: Build Product Image + id: build + uses: stackabletech/actions/build-product-image@2d3d7ddad981ae09901d45a0f6bf30c2658b1b78 # 0.7.0 + with: + product-name: ${{ inputs.product-name }} + product-version: ${{ matrix.versions }} + sdp-version: ${{ inputs.sdp-version }} + + - name: Publish Container Image on oci.stackable.tech + uses: stackabletech/actions/publish-image@2d3d7ddad981ae09901d45a0f6bf30c2658b1b78 # 0.7.0 + with: + image-registry-uri: oci.stackable.tech + image-registry-username: robot$sdp+github-action-build + image-registry-password: ${{ secrets.harbor-robot-secret }} + image-repository: sdp/${{ inputs.product-name }} + image-manifest-tag: ${{ steps.build.outputs.image-manifest-tag }} + source-image-uri: localhost/${{ inputs.product-name }}:${{ steps.build.outputs.image-manifest-tag }} + + publish_manifests: + name: Build/Publish ${{ matrix.versions }} Manifests + needs: [generate_matrix, build] + permissions: + id-token: write + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + versions: ${{ fromJson(needs.generate_matrix.outputs.versions) }} + steps: + - name: Checkout Repository + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + with: + persist-credentials: false + + - name: Publish and Sign Image Index Manifest to oci.stackable.tech + uses: stackabletech/actions/publish-index-manifest@2d3d7ddad981ae09901d45a0f6bf30c2658b1b78 # 0.7.0 + with: + image-registry-uri: oci.stackable.tech + image-registry-username: robot$sdp+github-action-build + image-registry-password: ${{ secrets.harbor-robot-secret }} + image-repository: sdp/${{ inputs.product-name }} + image-index-manifest-tag: ${{ matrix.versions }}-stackable${{ inputs.sdp-version }} + + notify: + name: Failure Notification + needs: [generate_matrix, build, publish_manifests] + runs-on: ubuntu-latest + if: failure() + steps: + - uses: slackapi/slack-github-action@37ebaef184d7626c5f204ab8d3baff4262dd30f0 # v1.27.0 + with: + channel-id: "C07UG6JH44F" # notifications-container-images + payload: | + { + "text": "*${{ github.workflow }}* failed (attempt ${{ github.run_attempt }})", + "attachments": [ + { + "pretext": "See the details below for a summary of which job(s) failed.", + "color": "#aa0000", + "fields": [ + { + "title": "Generate Version List", + "short": true, + "value": "${{ needs.generate_matrix.result }}" + }, + { + "title": "Build/Publish Image", + "short": true, + "value": "${{ needs.build.result }}" + }, + { + "title": "Build/Publish Manifests", + "short": true, + "value": "${{ needs.publish_manifests.result }}" + } + ], + "actions": [ + { + "type": "button", + "text": "Go to workflow run", + "url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}/attempts/${{ github.run_attempt }}" + } + ] + } + ] + } + env: + SLACK_BOT_TOKEN: ${{ secrets.slack-token }}