Skip to content

Commit 1442e86

Browse files
committed
ci: Migrate all products/tools to reusable workflow
1 parent 37b3e39 commit 1442e86

25 files changed

+241
-3529
lines changed

.github/workflows/build_airflow.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ on:
2222

2323
jobs:
2424
build_image:
25-
name: Build image using reusable workflow
25+
name: Reusable Workflow
2626
uses: ./.github/workflows/reusable_build_image.yaml
2727
secrets:
2828
harbor-robot-secret: ${{ secrets.HARBOR_ROBOT_SDP_GITHUB_ACTION_BUILD_SECRET }}

.github/workflows/build_druid.yaml

Lines changed: 10 additions & 147 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@ name: Build Druid
33
run-name: |
44
Build Druid (attempt #${{ github.run_attempt }})
55
6-
env:
7-
PRODUCT_NAME: druid
8-
SDP_VERSION: ${{ github.ref_type == 'tag' && github.ref_name || '0.0.0-dev' }}
9-
106
on:
117
workflow_dispatch:
128
schedule:
@@ -24,148 +20,15 @@ on:
2420
- java-devel/**
2521
- .github/actions/**
2622
- .github/workflows/build_druid.yaml
23+
- .github/workflows/reusable_build_image.yaml
2724

2825
jobs:
29-
generate_matrix:
30-
name: Generate Version List
31-
runs-on: ubuntu-latest
32-
steps:
33-
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
34-
with:
35-
persist-credentials: false
36-
- id: shard
37-
uses: stackabletech/actions/shard@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0
38-
with:
39-
product-name: ${{ env.PRODUCT_NAME }}
40-
outputs:
41-
versions: ${{ steps.shard.outputs.versions }}
42-
43-
build:
44-
name: Build/Publish ${{ matrix.versions }}-${{ matrix.runner.arch }} Image
45-
needs: [generate_matrix]
46-
permissions:
47-
id-token: write
48-
runs-on: ${{ matrix.runner.name }}
49-
strategy:
50-
fail-fast: false
51-
matrix:
52-
runner:
53-
- {name: "ubuntu-latest", arch: "amd64"}
54-
- {name: "ubicloud-standard-8-arm", arch: "arm64"}
55-
versions: ${{ fromJson(needs.generate_matrix.outputs.versions) }}
56-
steps:
57-
- name: Checkout Repository
58-
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
59-
with:
60-
persist-credentials: false
61-
62-
- name: Free Disk Space
63-
uses: stackabletech/actions/free-disk-space@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0
64-
65-
- name: Build Product Image
66-
id: build
67-
uses: stackabletech/actions/build-product-image@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0
68-
with:
69-
product-name: ${{ env.PRODUCT_NAME }}
70-
product-version: ${{ matrix.versions }}
71-
sdp-version: ${{ env.SDP_VERSION }}
72-
73-
- name: Publish Container Image on docker.stackable.tech
74-
uses: stackabletech/actions/publish-image@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0
75-
with:
76-
image-registry-uri: docker.stackable.tech
77-
image-registry-username: github
78-
image-registry-password: ${{ secrets.NEXUS_PASSWORD }}
79-
image-repository: stackable/${{ env.PRODUCT_NAME }}
80-
image-manifest-tag: ${{ steps.build.outputs.image-manifest-tag }}
81-
source-image-uri: localhost/${{ env.PRODUCT_NAME }}:${{ steps.build.outputs.image-manifest-tag }}
82-
83-
- name: Publish Container Image on oci.stackable.tech
84-
uses: stackabletech/actions/publish-image@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0
85-
with:
86-
image-registry-uri: oci.stackable.tech
87-
image-registry-username: robot$sdp+github-action-build
88-
image-registry-password: ${{ secrets.HARBOR_ROBOT_SDP_GITHUB_ACTION_BUILD_SECRET }}
89-
image-repository: sdp/${{ env.PRODUCT_NAME }}
90-
image-manifest-tag: ${{ steps.build.outputs.image-manifest-tag }}
91-
source-image-uri: localhost/${{ env.PRODUCT_NAME }}:${{ steps.build.outputs.image-manifest-tag }}
92-
93-
publish_manifests:
94-
name: Build/Publish ${{ matrix.versions }} Manifests
95-
needs: [generate_matrix, build]
96-
permissions:
97-
id-token: write
98-
runs-on: ubuntu-latest
99-
strategy:
100-
fail-fast: false
101-
matrix:
102-
versions: ${{ fromJson(needs.generate_matrix.outputs.versions) }}
103-
steps:
104-
- name: Checkout Repository
105-
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
106-
with:
107-
persist-credentials: false
108-
109-
- name: Publish and Sign Image Index Manifest to docker.stackable.tech
110-
uses: stackabletech/actions/publish-index-manifest@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0
111-
with:
112-
image-registry-uri: docker.stackable.tech
113-
image-registry-username: github
114-
image-registry-password: ${{ secrets.NEXUS_PASSWORD }}
115-
image-repository: stackable/${{ env.PRODUCT_NAME }}
116-
image-index-manifest-tag: ${{ matrix.versions }}-stackable${{ env.SDP_VERSION }}
117-
118-
- name: Publish and Sign Image Index Manifest to oci.stackable.tech
119-
uses: stackabletech/actions/publish-index-manifest@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0
120-
with:
121-
image-registry-uri: oci.stackable.tech
122-
image-registry-username: robot$sdp+github-action-build
123-
image-registry-password: ${{ secrets.HARBOR_ROBOT_SDP_GITHUB_ACTION_BUILD_SECRET }}
124-
image-repository: sdp/${{ env.PRODUCT_NAME }}
125-
image-index-manifest-tag: ${{ matrix.versions }}-stackable${{ env.SDP_VERSION }}
126-
127-
notify:
128-
name: Failure Notification
129-
needs: [generate_matrix, build, publish_manifests]
130-
runs-on: ubuntu-latest
131-
if: failure()
132-
steps:
133-
- uses: slackapi/slack-github-action@37ebaef184d7626c5f204ab8d3baff4262dd30f0 # v1.27.0
134-
with:
135-
channel-id: "C07UG6JH44F" # notifications-container-images
136-
payload: |
137-
{
138-
"text": "*${{ github.workflow }}* failed (attempt ${{ github.run_attempt }})",
139-
"attachments": [
140-
{
141-
"pretext": "See the details below for a summary of which job(s) failed.",
142-
"color": "#aa0000",
143-
"fields": [
144-
{
145-
"title": "Generate Version List",
146-
"short": true,
147-
"value": "${{ needs.generate_matrix.result }}"
148-
},
149-
{
150-
"title": "Build/Publish Image",
151-
"short": true,
152-
"value": "${{ needs.build.result }}"
153-
},
154-
{
155-
"title": "Build/Publish Manifests",
156-
"short": true,
157-
"value": "${{ needs.publish_manifests.result }}"
158-
}
159-
],
160-
"actions": [
161-
{
162-
"type": "button",
163-
"text": "Go to workflow run",
164-
"url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}/attempts/${{ github.run_attempt }}"
165-
}
166-
]
167-
}
168-
]
169-
}
170-
env:
171-
SLACK_BOT_TOKEN: ${{ secrets.SLACK_CONTAINER_IMAGE_TOKEN }}
26+
build_image:
27+
name: Reusable Workflow
28+
uses: ./.github/workflows/reusable_build_image.yaml
29+
secrets:
30+
harbor-robot-secret: ${{ secrets.HARBOR_ROBOT_SDP_GITHUB_ACTION_BUILD_SECRET }}
31+
slack-token: ${{ secrets.SLACK_CONTAINER_IMAGE_TOKEN }}
32+
with:
33+
product-name: druid
34+
sdp-version: ${{ github.ref_type == 'tag' && github.ref_name || '0.0.0-dev' }}

.github/workflows/build_hadoop.yaml

Lines changed: 10 additions & 147 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@ name: Build Hadoop
33
run-name: |
44
Build Hadoop (attempt #${{ github.run_attempt }})
55
6-
env:
7-
PRODUCT_NAME: hadoop
8-
SDP_VERSION: ${{ github.ref_type == 'tag' && github.ref_name || '0.0.0-dev' }}
9-
106
on:
117
workflow_dispatch:
128
schedule:
@@ -24,148 +20,15 @@ on:
2420
- java-devel/**
2521
- .github/actions/**
2622
- .github/workflows/build_hadoop.yaml
23+
- .github/workflows/reusable_build_image.yaml
2724

2825
jobs:
29-
generate_matrix:
30-
name: Generate Version List
31-
runs-on: ubuntu-latest
32-
steps:
33-
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
34-
with:
35-
persist-credentials: false
36-
- id: shard
37-
uses: stackabletech/actions/shard@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0
38-
with:
39-
product-name: ${{ env.PRODUCT_NAME }}
40-
outputs:
41-
versions: ${{ steps.shard.outputs.versions }}
42-
43-
build:
44-
name: Build/Publish ${{ matrix.versions }}-${{ matrix.runner.arch }} Image
45-
needs: [generate_matrix]
46-
permissions:
47-
id-token: write
48-
runs-on: ${{ matrix.runner.name }}
49-
strategy:
50-
fail-fast: false
51-
matrix:
52-
runner:
53-
- {name: "ubuntu-latest", arch: "amd64"}
54-
- {name: "ubicloud-standard-8-arm", arch: "arm64"}
55-
versions: ${{ fromJson(needs.generate_matrix.outputs.versions) }}
56-
steps:
57-
- name: Checkout Repository
58-
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
59-
with:
60-
persist-credentials: false
61-
62-
- name: Free Disk Space
63-
uses: stackabletech/actions/free-disk-space@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0
64-
65-
- name: Build Product Image
66-
id: build
67-
uses: stackabletech/actions/build-product-image@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0
68-
with:
69-
product-name: ${{ env.PRODUCT_NAME }}
70-
product-version: ${{ matrix.versions }}
71-
sdp-version: ${{ env.SDP_VERSION }}
72-
73-
- name: Publish Container Image on docker.stackable.tech
74-
uses: stackabletech/actions/publish-image@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0
75-
with:
76-
image-registry-uri: docker.stackable.tech
77-
image-registry-username: github
78-
image-registry-password: ${{ secrets.NEXUS_PASSWORD }}
79-
image-repository: stackable/${{ env.PRODUCT_NAME }}
80-
image-manifest-tag: ${{ steps.build.outputs.image-manifest-tag }}
81-
source-image-uri: localhost/${{ env.PRODUCT_NAME }}:${{ steps.build.outputs.image-manifest-tag }}
82-
83-
- name: Publish Container Image on oci.stackable.tech
84-
uses: stackabletech/actions/publish-image@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0
85-
with:
86-
image-registry-uri: oci.stackable.tech
87-
image-registry-username: robot$sdp+github-action-build
88-
image-registry-password: ${{ secrets.HARBOR_ROBOT_SDP_GITHUB_ACTION_BUILD_SECRET }}
89-
image-repository: sdp/${{ env.PRODUCT_NAME }}
90-
image-manifest-tag: ${{ steps.build.outputs.image-manifest-tag }}
91-
source-image-uri: localhost/${{ env.PRODUCT_NAME }}:${{ steps.build.outputs.image-manifest-tag }}
92-
93-
publish_manifests:
94-
name: Build/Publish ${{ matrix.versions }} Manifests
95-
needs: [generate_matrix, build]
96-
permissions:
97-
id-token: write
98-
runs-on: ubuntu-latest
99-
strategy:
100-
fail-fast: false
101-
matrix:
102-
versions: ${{ fromJson(needs.generate_matrix.outputs.versions) }}
103-
steps:
104-
- name: Checkout Repository
105-
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
106-
with:
107-
persist-credentials: false
108-
109-
- name: Publish and Sign Image Index Manifest to docker.stackable.tech
110-
uses: stackabletech/actions/publish-index-manifest@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0
111-
with:
112-
image-registry-uri: docker.stackable.tech
113-
image-registry-username: github
114-
image-registry-password: ${{ secrets.NEXUS_PASSWORD }}
115-
image-repository: stackable/${{ env.PRODUCT_NAME }}
116-
image-index-manifest-tag: ${{ matrix.versions }}-stackable${{ env.SDP_VERSION }}
117-
118-
- name: Publish and Sign Image Index Manifest to oci.stackable.tech
119-
uses: stackabletech/actions/publish-index-manifest@320eae677555385b3d40e1c3a81d9263b72742e4 # 0.6.0
120-
with:
121-
image-registry-uri: oci.stackable.tech
122-
image-registry-username: robot$sdp+github-action-build
123-
image-registry-password: ${{ secrets.HARBOR_ROBOT_SDP_GITHUB_ACTION_BUILD_SECRET }}
124-
image-repository: sdp/${{ env.PRODUCT_NAME }}
125-
image-index-manifest-tag: ${{ matrix.versions }}-stackable${{ env.SDP_VERSION }}
126-
127-
notify:
128-
name: Failure Notification
129-
needs: [generate_matrix, build, publish_manifests]
130-
runs-on: ubuntu-latest
131-
if: failure()
132-
steps:
133-
- uses: slackapi/slack-github-action@37ebaef184d7626c5f204ab8d3baff4262dd30f0 # v1.27.0
134-
with:
135-
channel-id: "C07UG6JH44F" # notifications-container-images
136-
payload: |
137-
{
138-
"text": "*${{ github.workflow }}* failed (attempt ${{ github.run_attempt }})",
139-
"attachments": [
140-
{
141-
"pretext": "See the details below for a summary of which job(s) failed.",
142-
"color": "#aa0000",
143-
"fields": [
144-
{
145-
"title": "Generate Version List",
146-
"short": true,
147-
"value": "${{ needs.generate_matrix.result }}"
148-
},
149-
{
150-
"title": "Build/Publish Image",
151-
"short": true,
152-
"value": "${{ needs.build.result }}"
153-
},
154-
{
155-
"title": "Build/Publish Manifests",
156-
"short": true,
157-
"value": "${{ needs.publish_manifests.result }}"
158-
}
159-
],
160-
"actions": [
161-
{
162-
"type": "button",
163-
"text": "Go to workflow run",
164-
"url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}/attempts/${{ github.run_attempt }}"
165-
}
166-
]
167-
}
168-
]
169-
}
170-
env:
171-
SLACK_BOT_TOKEN: ${{ secrets.SLACK_CONTAINER_IMAGE_TOKEN }}
26+
build_image:
27+
name: Reusable Workflow
28+
uses: ./.github/workflows/reusable_build_image.yaml
29+
secrets:
30+
harbor-robot-secret: ${{ secrets.HARBOR_ROBOT_SDP_GITHUB_ACTION_BUILD_SECRET }}
31+
slack-token: ${{ secrets.SLACK_CONTAINER_IMAGE_TOKEN }}
32+
with:
33+
product-name: hadoop
34+
sdp-version: ${{ github.ref_type == 'tag' && github.ref_name || '0.0.0-dev' }}

0 commit comments

Comments
 (0)