@@ -3,16 +3,6 @@ name: release-issue-os
3
3
4
4
on :
5
5
workflow_dispatch :
6
- inputs :
7
- logLevel :
8
- description : Log level
9
- required : true
10
- default : warning
11
- type : choice
12
- options :
13
- - info
14
- - warning
15
- - debug
16
6
schedule :
17
7
- cron : 0 1 * * *
18
8
@@ -21,103 +11,59 @@ jobs:
21
11
if : github.repository == 'opensearch-project/opensearch-build'
22
12
runs-on : ubuntu-latest
23
13
outputs :
24
- matrix : ${{ steps.set-matrix.outputs.matrix }}
14
+ versions_matrix : ${{ steps.set-matrix.outputs.versions }}
25
15
steps :
26
- - uses : actions/checkout@v3
27
- with :
28
- repository : opensearch-project/opensearch-build
29
- ref : main
16
+ - uses : actions/checkout@v4
30
17
- id : set-matrix
31
- # produces a list of major versions, e.g. ["1.4.0","2.10.0","2.6.0","2.7.0","2.8.0","2.9.0","3.0.0"]
32
- run : echo "::set-output name=matrix::$(ls manifests/**/opensearch*.yml | cut -d'/' -f2 | grep '0$' | grep -v '[0-9]0$' | sort | uniq | jq -R -s -c 'split("\n")[:-1]')"
33
- component-release-issue :
18
+ # produces a list of major.minor versions only, no patch versions e.g. ["1.4.0","2.10.0","2.6.0","2.7.0","2.8.0","2.9.0","3.0.0"]
19
+ run : echo "versions=$(ls manifests/**/opensearch*.yml | cut -d'/' -f2 | grep '0$' | grep -v '[0-9]0$' | sort | uniq | jq -R -s -c 'split("\n")[:-1]')" >> $GITHUB_OUTPUT
20
+
21
+ list-components-per-version :
34
22
needs : list-manifest-versions
35
23
runs-on : ubuntu-latest
36
- strategy :
37
- fail-fast : false
38
- matrix :
39
- entry :
40
- - {repo: OpenSearch}
41
- - {repo: alerting}
42
- - {repo: anomaly-detection}
43
- - {repo: asynchronous-search}
44
- - {repo: common-utils}
45
- - {repo: cross-cluster-replication}
46
- - {repo: geospatial}
47
- - {repo: index-management}
48
- - {repo: job-scheduler}
49
- - {repo: k-NN}
50
- - {repo: neural-search}
51
- - {repo: ml-commons}
52
- - {repo: notifications}
53
- - {repo: observability}
54
- - {repo: performance-analyzer}
55
- - {repo: performance-analyzer-rca}
56
- - {repo: reporting}
57
- - {repo: security}
58
- - {repo: security-analytics}
59
- - {repo: sql}
60
- - {repo: custom-codecs}
61
- - {repo: flow-framework}
62
- - {repo: skills}
63
- - {repo: query-insights}
64
- - {repo: opensearch-system-templates}
65
- release_version : ${{ fromJson(needs.list-manifest-versions.outputs.matrix) }}
24
+ outputs :
25
+ version_components_matrix : ${{ steps.get-all-components.outputs.combined_matrix }}
66
26
steps :
67
- - name : GitHub App token
68
- id : github_app_token
69
- uses : tibdex/github-app-token@v1.6.0
70
- with :
71
- app_id : ${{ secrets.APP_ID }}
72
- private_key : ${{ secrets.APP_PRIVATE_KEY }}
73
- installation_id : 22958780
74
- - name : Checkout
75
- uses : actions/checkout@v3
76
- - name : Check if build repo release issue exists
77
- id : check_if_build_repo_issue_exists
78
- uses : actions-cool/issues-helper@v3
79
- with :
80
- actions : ' find-issues'
81
- repo : opensearch-project/opensearch-build
82
- token : ${{ steps.github_app_token.outputs.token }}
83
- issue-state : ' open'
84
- title-includes : ' [RELEASE] Release version ${{ matrix.release_version }}'
85
- - name : Check out plugin repo
86
- uses : actions/checkout@v3
87
- with :
88
- path : plugin-repo
89
- repository : opensearch-project/${{ matrix.entry.repo }}
90
- - name : Check if plugin repo release issue exists
91
- if : steps.check_if_build_repo_issue_exists.outputs.issues != '[]'
92
- id : check_if_plugin_repo_issue_exists
93
- uses : actions-cool/issues-helper@v3
94
- with :
95
- actions : ' find-issues'
96
- repo : opensearch-project/${{ matrix.entry.repo }}
97
- token : ${{ steps.github_app_token.outputs.token }}
98
- title-includes : ' [RELEASE] Release version ${{ matrix.release_version }}'
99
- - name : Replace Placeholders
100
- if : steps.check_if_plugin_repo_issue_exists.outputs.issues == '[]'
27
+ - uses : actions/checkout@v4
28
+
29
+ - id : get-all-components
101
30
run : |
102
- # Read the file contents and replace the placeholders
103
- file_path="../opensearch-build/.github/ISSUE_TEMPLATE/component_release_template.md"
104
- RELEASE_VERSION="${{ matrix.release_version }}"
105
- RELEASE_BRANCH=$(echo ${{ matrix.release_version }} | cut -d. -f1-2)
106
- BUILD_REPO_ISSUE_OUTPUT=$(cat <<EOF
107
- ${{ steps.check_if_build_repo_issue_exists.outputs.issues }}
108
- EOF
109
- )
110
- RELEASE_ISSUE_NUMBER=$(echo $BUILD_REPO_ISSUE_OUTPUT | jq -r '.[0].number')
111
- RELEASE_ISSUE="https://github.com/opensearch-project/opensearch-build/issues/${RELEASE_ISSUE_NUMBER}"
112
- RELEASE_VERSION_X=$(echo "${{ matrix.release_version }}" | awk -F'.' '{print $1}').x
113
- sed -e "s|{{RELEASE_VERSION}}|${RELEASE_VERSION}|g" -e "s|{{RELEASE_ISSUE}}|${RELEASE_ISSUE}|g" -e "s|{{RELEASE_BRANCH}}|${RELEASE_BRANCH}|g" -e "s|{{RELEASE_VERSION_X}}|${RELEASE_VERSION_X}|g" "$file_path" > "$file_path.tmp" && mv "$file_path.tmp" "$file_path"
114
- - name : Create component release issue from file
115
- if : steps.check_if_plugin_repo_issue_exists.outputs.issues == '[]'
116
- uses : peter-evans/create-issue-from-file@v4
117
- with :
118
- title : ' [RELEASE] Release version ${{ matrix.release_version }}'
119
- content-filepath : ../opensearch-build/.github/ISSUE_TEMPLATE/component_release_template.md
120
- labels : |
121
- v${{ matrix.release_version }}
122
- token : ${{ steps.github_app_token.outputs.token }}
123
- repository : opensearch-project/${{ matrix.entry.repo }}
31
+ versions_array=${{ needs.list-manifest-versions.outputs.versions_matrix }}
32
+
33
+ # Remove brackets from the array string
34
+ versions_array="${versions_array:1:-1}"
35
+
36
+ # Split by commas and process each version
37
+ IFS=',' read -ra VERSIONS <<< "$versions_array"
38
+
39
+ # Initialize an array to store all entries
40
+ declare -a matrix_entries=()
41
+
42
+ for version in "${VERSIONS[@]}"; do
43
+ # Remove quotes and whitespace from version
44
+ version=$(echo $version | tr -d '"' | xargs)
45
+
46
+ # Get components for this version
47
+ components=$(yq eval '.components[].repository' "manifests/$version/opensearch-$version.yml" | \
48
+ sed 's/.*\///;s/\.git$//' | \
49
+ jq -R -s -c 'split("\n")[:-1]')
50
+
51
+ # Add this version-components pair to the matrix
52
+ matrix_entries+=("{\"version\":\"$version\",\"components\":$components}")
53
+ done
54
+
55
+ # Combine all entries into the final matrix format
56
+ matrix_json="{\"include\":[$(IFS=,; echo "${matrix_entries[*]}")]}"
57
+
58
+ echo "combined_matrix=$matrix_json" >> $GITHUB_OUTPUT
59
+
60
+ trigger-issue-creation-workflow :
61
+ needs : list-components-per-version
62
+ strategy :
63
+ matrix : ${{ fromJson(needs.list-components-per-version.outputs.version_components_matrix) }}
64
+ fail-fast : false
65
+ uses : ./.github/workflows/create-release-issues.yml
66
+ secrets : inherit
67
+ with :
68
+ version : ${{ matrix.version }}
69
+ repos : ${{ toJson(matrix.components) }}
0 commit comments