Skip to content

Commit 667d2c9

Browse files
SONARPHP-1684 fix and update the automate release workflow (#1445)
Co-authored-by: GabinL21 <[email protected]>
1 parent c3cfafe commit 667d2c9

File tree

2 files changed

+28
-19
lines changed

2 files changed

+28
-19
lines changed

.github/workflows/AutomateRelease.yml

Lines changed: 28 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ env:
55
PROJECT_NAME: "SonarPHP"
66
LANGUAGE: "php"
77
USE_JIRA_SANDBOX: false
8-
DRAFT_RELEASE: false
8+
IS_DRAFT_RELEASE: false
99
PM_EMAIL: '[email protected]'
1010

1111
on:
@@ -16,6 +16,11 @@ on:
1616
A brief summary of what the release contains.
1717
This will be added directly to the release ticket.
1818
required: true
19+
sq_compatibility:
20+
description: |
21+
SonarQube compatibility.
22+
Default needs to be changed only in case of LTA fix release.
23+
default: ">=10.8"
1924
next_version:
2025
description: |
2126
Specify the version for the next release (e.g., 4.2.0).
@@ -26,6 +31,10 @@ on:
2631
The name of the release version in Jira.
2732
If blank, the action will try to use the *only* unreleased version in the project.
2833
required: false
34+
release_notes:
35+
description: |
36+
Github release notes.
37+
If blank, release notes will be generated from the Jira Release.
2938
sonarlint_changelog:
3039
description: |
3140
A summary of release notes relevant to the SonarQube IDE extensions.
@@ -92,7 +101,7 @@ jobs:
92101
project_name: ${{ env.PROJECT_NAME }}
93102
version: ${{ needs.check_releasability.outputs.version }}
94103
short_description: ${{ github.event.inputs.short_description }}
95-
sq_compatibility: ">=LTS"
104+
sq_compatibility: ${{ github.event.inputs.sq_compatibility }}
96105
targeted_product: "11.0"
97106
jira_release_name: ${{ github.event.inputs.jira_release_name }}
98107
sonarlint_changelog: ${{ github.event.inputs.sonarlint_changelog }}
@@ -135,7 +144,8 @@ jobs:
135144
jira_release_name: ${{ needs.create_release_ticket.outputs.release_name }}
136145
jira_user: ${{ fromJSON(steps.secrets.outputs.vault).JIRA_USER }}
137146
jira_token: ${{ fromJSON(steps.secrets.outputs.vault).JIRA_TOKEN }}
138-
draft: ${{ env.DRAFT_RELEASE }}
147+
draft: ${{ env.IS_DRAFT_RELEASE }}
148+
release_notes: ${{ github.event.inputs.release_notes }}
139149

140150
release:
141151
name: Sonar release
@@ -212,9 +222,9 @@ jobs:
212222
id-token: write
213223
outputs:
214224
sqs_ticket_key: ${{ steps.integration_update.outputs.sqs_ticket_key }}
215-
sc_ticket_key: ${{ steps.integration_update.outputs.sc_ticket_key }}
225+
sqc_ticket_key: ${{ steps.integration_update.outputs.sc_ticket_key }}
216226
sqs_ticket_url: ${{ steps.integration_update.outputs.sqs_ticket_url}}
217-
sc_ticket_url: ${{ steps.integration_update.outputs.sc_ticket_url }}
227+
sqc_ticket_url: ${{ steps.integration_update.outputs.sc_ticket_url }}
218228
steps:
219229
- name: Get Jira Credentials from Vault
220230
id: secrets
@@ -230,24 +240,24 @@ jobs:
230240
with:
231241
jira_user: ${{ fromJSON(steps.secrets.outputs.vault).JIRA_USER }}
232242
jira_token: ${{ fromJSON(steps.secrets.outputs.vault).JIRA_TOKEN }}
233-
release_ticket_key: "REL-3639"
243+
release_ticket_key: ${{ needs.create_release_ticket.outputs.release_ticket_key }}
234244
sqs_fix_versions: ${{ github.event.inputs.sqs_fix_versions }}
235245
use_sandbox: ${{ env.USE_JIRA_SANDBOX }}
236246

237247
- name: Echo Found Ticket Keys
238248
run: |
239249
echo "Found SQS integration ticket: ${{ steps.integration_update.outputs.sqs_ticket_key }}"
240-
echo "Found SC integration ticket: ${{ steps.integration_update.outputs.sc_ticket_key }}"
250+
echo "Found SQC integration ticket: ${{ steps.integration_update.outputs.sc_ticket_key }}"
241251
242252
update-analyzers:
243-
name: Update Analyzers in SQS and SC
253+
name: Update Analyzers in SQS and SQC
244254
runs-on: ubuntu-latest
245255
needs: [ update-integration-tickets, check_releasability ]
246256
permissions:
247257
id-token: write
248258
outputs:
249259
sqs_pr_url: ${{ steps.update_step_sqs.outputs.pr-url }}
250-
sc_pr_url: ${{ steps.update_step_sc.outputs.pr-url }}
260+
sqc_pr_url: ${{ steps.update_step_sqc.outputs.pr-url }}
251261
steps:
252262
- name: Get GitHub token from Vault
253263
id: secrets
@@ -262,20 +272,20 @@ jobs:
262272
with:
263273
version: ${{ needs.check_releasability.outputs.version }}
264274
ticket: ${{ needs.update-integration-tickets.outputs.sqs_ticket_key }}
265-
plugin-language: 'php'
275+
plugin-language: ${{ env.LANGUAGE }}
266276
github-token: ${{ fromJSON(steps.secrets.outputs.vault).GITHUB_TOKEN }}
267-
draft: true
277+
draft: ${{ env.IS_DRAFT_RELEASE }}
268278
reviewers: ${{ github.event.inputs.integration_prs_reviewers }}
269279

270-
- name: Update analyzer in SC
271-
id: update_step_sc
280+
- name: Update analyzer in SQC
281+
id: update_step_sqc
272282
uses: SonarSource/release-github-actions/update-analyzer@09c557fb83722adbe2af2ca7e625324e15739362
273283
with:
274284
version: ${{ needs.check_releasability.outputs.version }}
275-
ticket: ${{ needs.update-integration-tickets.outputs.sc_ticket_key }}
276-
plugin-language: 'php'
285+
ticket: ${{ needs.update-integration-tickets.outputs.sqc_ticket_key }}
286+
plugin-language: ${{ env.LANGUAGE }}
277287
github-token: ${{ fromJSON(steps.secrets.outputs.vault).GITHUB_TOKEN }}
278-
draft: true
288+
draft: ${{ env.IS_DRAFT_RELEASE }}
279289
reviewers: ${{ github.event.inputs.integration_prs_reviewers }}
280290

281291
summarize_release:
@@ -294,6 +304,6 @@ jobs:
294304
echo "- **Release Ticket URL:** ${{ needs.create_release_ticket.outputs.release_ticket_url }}" >> $GITHUB_STEP_SUMMARY
295305
echo "- **GitHub Release URL:** ${{ needs.publish_release.outputs.release_url }}" >> $GITHUB_STEP_SUMMARY
296306
echo "- **SQS Integration Ticket URL:** ${{ needs.update-integration-tickets.outputs.sqs_ticket_url }}" >> $GITHUB_STEP_SUMMARY
297-
echo "- **SQC Integration Ticket URL:** ${{ needs.update-integration-tickets.outputs.sc_ticket_url }}" >> $GITHUB_STEP_SUMMARY
307+
echo "- **SQC Integration Ticket URL:** ${{ needs.update-integration-tickets.outputs.sqc_ticket_url }}" >> $GITHUB_STEP_SUMMARY
298308
echo "- **SQS Analyzer PR URL:** ${{ needs.update-analyzers.outputs.sqs_pr_url }}" >> $GITHUB_STEP_SUMMARY
299-
echo "- **SQC Analyzer PR URL:** ${{ needs.update-analyzers.outputs.sc_pr_url }}" >> $GITHUB_STEP_SUMMARY
309+
echo "- **SQC Analyzer PR URL:** ${{ needs.update-analyzers.outputs.sqc_pr_url }}" >> $GITHUB_STEP_SUMMARY

.github/workflows/rule-metadata-update.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
name: rule-metadata-update
22
on:
3-
workflow_call:
43
workflow_dispatch:
54

65
jobs:

0 commit comments

Comments
 (0)