|
| 1 | +name: Automate release |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + inputs: |
| 6 | + short-description: |
| 7 | + description: | |
| 8 | + A brief summary of what the release contains. |
| 9 | + This will be added directly to the release ticket. |
| 10 | + required: true |
| 11 | + rule-props-changed: |
| 12 | + type: choice |
| 13 | + description: | |
| 14 | + Did any rule properties change in this release? |
| 15 | + required: true |
| 16 | + default: "No" |
| 17 | + options: |
| 18 | + - "Yes" |
| 19 | + - "No" |
| 20 | + branch: |
| 21 | + description: | |
| 22 | + Branch from which to do the release. |
| 23 | + required: true |
| 24 | + default: "master" |
| 25 | + release-notes: |
| 26 | + description: | |
| 27 | + Release notes. |
| 28 | + If blank, release notes will be generated from the Jira Release. |
| 29 | + sq-ide-short-description: |
| 30 | + description: | |
| 31 | + A brief summary of SQ IDE related changes. |
| 32 | + If blank, the generic brief summary defined above will be used. |
| 33 | + new-version: |
| 34 | + description: | |
| 35 | + Specify the version for the next release (e.g., 4.2.0). |
| 36 | + If left blank, the last version number will be automatically incremented (e.g., 1.51 -> 1.52, 1.51.1 -> 1.51.2). |
| 37 | + require-rule-metadata-update: |
| 38 | + type: boolean |
| 39 | + description: | |
| 40 | + Toggle whether the pre release checks should include a rule metadata update. |
| 41 | + It is false for now as the action is broken, because of RSPEC repo went private, see GHA-184 for more details. |
| 42 | + default: false |
| 43 | + dry-run: |
| 44 | + description: "Test mode: uses Jira sandbox and creates draft GitHub release" |
| 45 | + type: boolean |
| 46 | + default: false |
| 47 | + |
| 48 | +jobs: |
| 49 | + lock-branch: |
| 50 | + name: Lock ${{ inputs.branch }} branch |
| 51 | + uses: ./.github/workflows/ToggleLockBranch.yml |
| 52 | + permissions: |
| 53 | + id-token: write |
| 54 | + with: |
| 55 | + branch: ${{ inputs.branch }} |
| 56 | + |
| 57 | + release: |
| 58 | + name: Release |
| 59 | + uses: SonarSource/release-github-actions/.github/workflows/cloud-security-automated-release.yml@v1 |
| 60 | + needs: lock-branch |
| 61 | + permissions: |
| 62 | + statuses: read |
| 63 | + id-token: write |
| 64 | + contents: write |
| 65 | + actions: write |
| 66 | + pull-requests: write |
| 67 | + with: |
| 68 | + jira-project-key: "SONARKT" |
| 69 | + project-name: "SonarKotlin" |
| 70 | + plugin-name: "kotlin" |
| 71 | + plugin-artifacts-sqs: "kotlin" |
| 72 | + plugin-artifacts-sqc: "kotlin" |
| 73 | + use-jira-sandbox: ${{ github.event.inputs.dry-run == 'true' }} |
| 74 | + is-draft-release: ${{ github.event.inputs.dry-run == 'true' }} |
| 75 | + pm-email: "alexandre.gigleux@sonarsource.com" |
| 76 | + release-automation-secret-name: "sonar-kotlin-release-automation" |
| 77 | + short-description: ${{ inputs.short-description }} |
| 78 | + rule-props-changed: ${{ inputs.rule-props-changed }} |
| 79 | + branch: ${{ inputs.branch }} |
| 80 | + release-notes: ${{ inputs.release-notes }} |
| 81 | + sq-ide-short-description: ${{ inputs.sq-ide-short-description }} |
| 82 | + new-version: ${{ inputs.new-version }} |
| 83 | + create-slvs-ticket: false |
| 84 | + create-sle-ticket: false |
| 85 | + require-rule-metadata-update: ${{ inputs.require-rule-metadata-update }} |
| 86 | + |
| 87 | + unlock-branch: |
| 88 | + name: Unlock ${{ inputs.branch }} branch |
| 89 | + uses: ./.github/workflows/ToggleLockBranch.yml |
| 90 | + needs: release |
| 91 | + permissions: |
| 92 | + id-token: write |
| 93 | + with: |
| 94 | + branch: ${{ inputs.branch }} |
| 95 | + |
| 96 | + bump_versions: |
| 97 | + name: Bump versions |
| 98 | + needs: [release, unlock-branch] |
| 99 | + uses: ./.github/workflows/bump-versions.yaml |
| 100 | + permissions: |
| 101 | + contents: write |
| 102 | + pull-requests: write |
| 103 | + with: |
| 104 | + version: ${{ needs.release.outputs.new-version }}-SNAPSHOT |
0 commit comments