-
Notifications
You must be signed in to change notification settings - Fork 17
136 lines (119 loc) · 4.12 KB
/
publish-all-operators.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
name: Publish All Operators
run-name: ${{ format('Publish All Operators{0} {1} Release', ':', inputs.release_type) }}
on:
workflow_dispatch:
inputs:
release_type:
type: choice
description: 'The type of release'
options:
- Major
- Minor
- Patch
- Snapshot
jobs:
start:
name: Start Operator Build
runs-on: ubuntu-latest
outputs:
new_version: ${{ steps.version.outputs.new_version }}
steps:
- name: Show Context
run: |
printenv
echo "$GITHUB_CONTEXT"
shell: bash
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
- name: Check branch and release type
uses: IABTechLab/uid2-shared-actions/actions/[email protected]
with:
release_type: ${{ inputs.release_type }}
- name: Checkout repo
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Vulnerability Scan
uses: IABTechLab/uid2-shared-actions/actions/[email protected]
with:
publish_vulnerabilities: true
- name: Set version number
id: version
uses: IABTechLab/uid2-shared-actions/actions/[email protected]
with:
type: ${{ inputs.release_type }}
branch_name: ${{ github.ref }}
- name: Update pom.xml
run: |
current_version=$(grep -o '<version>.*</version>' pom.xml | head -1 | sed 's/<version>\(.*\)<\/version>/\1/')
new_version=${{ steps.version.outputs.new_version }}
sed -i "s/$current_version/$new_version/g" pom.xml
echo "Version number updated from $current_version to $new_version"
- name: Commit pom.xml and version.json
uses: EndBug/add-and-commit@v9
with:
add: 'pom.xml version.json'
author_name: Release Workflow
author_email: [email protected]
message: 'Released ${{ inputs.release_type }} version: ${{ steps.version.outputs.new_version }}'
tag: v${{ steps.version.outputs.new_version }}
buildPublic:
name: Public Operator
needs: start
uses: ./.github/workflows/publish-public-operator-docker-image.yaml
with:
release_type: ${{ inputs.release_type }}
version_number_input: ${{ needs.start.outputs.new_version }}
#buildAWS:
# name: AWS Private Operator
# needs: start
# uses: ./.github/workflows/publish-aws-operator-AMI.yaml
# with:
# release_type: ${{ inputs.release_type }}
# version_number_input: ${{ needs.start.outputs.new_version }}
buildGCP:
name: GCP Private Operator
needs: start
uses: ./.github/workflows/publish-gcp-oidc-enclave-docker.yaml
with:
release_type: ${{ inputs.release_type }}
version_number_input: ${{ needs.start.outputs.new_version }}
buildAzure:
name: Azure Private Operator
needs: start
uses: ./.github/workflows/publish-azure-cc-enclave-docker.yaml
with:
release_type: ${{ inputs.release_type }}
version_number_input: ${{ needs.start.outputs.new_version }}
collectAllArtifacts:
name: Collect All Artifacts
runs-on: ubuntu-latest
needs: [buildPublic, buildGCP, buildAzure]
steps:
- name: Download Public Artifacts
uses: actions/download-artifact@v3
with:
name: image_details
path: ./artifacts/public_operator
- name: Download GCP Artifacts
uses: actions/download-artifact@v3
with:
name: gcp-oidc-deployment-files
path: ./artifacts/gcp_oidc_operator
- name: Download Azure Artifacts
uses: actions/download-artifact@v3
with:
name: azure-cc-deployment-files
path: ./artifacts/azure_cc_operator
- name: Delete Public Artifacts
uses: geekyeggo/delete-artifact@v2
with:
name: |
image_details
gcp-oidc-deployment-files
azure-cc-deployment-files
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: operator_release
path: ./artifacts/