Skip to content

Commit cd634c6

Browse files
GHA-176 Add automated release workflow setup and documentation (#86)
1 parent 269441b commit cd634c6

File tree

6 files changed

+694
-330
lines changed

6 files changed

+694
-330
lines changed

CLAUDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Related Jira tickets for this project are tracked in the **GHA** (GitHub Automat
1212

1313
## Branching
1414

15-
**Important:** Changes must always be made on a feature branch, never directly on `master`.
15+
**Critical:** Changes must always be made on a feature branch, never directly on `master`. Before any commit, verify you are not on `master`.
1616
- If on `master`, create a new branch using the format: `ab/<feature-name>` (e.g., `ab/add-slack-notifications`)
1717
- The prefix `ab` represents the developer's initials (first letter of first name + first letter of last name)
1818
- Adapt `<feature-name>` based on the task/prompt (use lowercase, hyphen-separated)

README.md

Lines changed: 27 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,36 @@ A centralized collection of reusable GitHub Actions designed to streamline and a
44

55
## Available Actions
66

7-
* [**Check Releasability Status**](check-releasability-status/README.md): Checks the releasability status and extracts the version if successful.
8-
* [**Create Integration Ticket**](create-integration-ticket/README.md): Creates a Jira integration ticket with a custom summary and links it to another existing ticket.
9-
* [**Create Jira Release Ticket**](create-jira-release-ticket/README.md): Automates the creation of an "Ask for release" ticket in Jira.
10-
* [**Create Jira Version**](create-jira-version/README.md): Creates a new version in a Jira project, with the ability to automatically determine the next version number.
11-
* [**Get Jira Release Notes**](get-jira-release-notes/README.md): Fetches Jira release notes and generates the release notes URL for a given project and version.
12-
* [**Get Jira Version**](get-jira-version/README.md): Extracts a Jira-compatible version number from a release version by formatting it appropriately for Jira.
13-
* [**Get Release Version**](get-release-version/README.md): Extracts the release version from the repox status on a specified branch.
14-
* [**Lock Branch**](lock-branch/README.md): Locks or unlocks a branch by modifying the `lock_branch` setting in branch protection rules.
15-
* [**Notify Slack on Failure**](notify-slack/README.md): Sends a Slack notification when a job fails.
16-
* [**Publish GitHub Release**](publish-github-release/README.md): Publishes a GitHub Release with notes fetched from Jira or provided directly.
17-
* [**Release Jira Version**](release-jira-version/README.md): Releases a Jira version and creates the next one.
18-
* [**Update Analyzer**](update-analyzer/README.md): Updates an analyzer version in SonarQube or SonarCloud and creates a pull request.
19-
* [**Update Release Ticket Status**](update-release-ticket-status/README.md): Updates the status of a Jira release ticket and can change its assignee.
20-
* [**Update Rule Metadata**](update-rule-metadata/README.md): Automates updating rule metadata across all supported languages using the rule-api tooling.
7+
| Action | Description |
8+
|--------|-------------|
9+
| [Check Releasability Status](check-releasability-status/README.md) | Checks the releasability status and extracts the version if successful |
10+
| [Create Integration Ticket](create-integration-ticket/README.md) | Creates a Jira integration ticket with a custom summary and links it to another existing ticket |
11+
| [Create Jira Release Ticket](create-jira-release-ticket/README.md) | Automates the creation of an "Ask for release" ticket in Jira |
12+
| [Create Jira Version](create-jira-version/README.md) | Creates a new version in a Jira project, with the ability to automatically determine the next version number |
13+
| [Get Jira Release Notes](get-jira-release-notes/README.md) | Fetches Jira release notes and generates the release notes URL for a given project and version |
14+
| [Get Jira Version](get-jira-version/README.md) | Extracts a Jira-compatible version number from a release version by formatting it appropriately for Jira |
15+
| [Get Release Version](get-release-version/README.md) | Extracts the release version from the repox status on a specified branch |
16+
| [Lock Branch](lock-branch/README.md) | Locks or unlocks a branch by modifying the `lock_branch` setting in branch protection rules |
17+
| [Notify Slack on Failure](notify-slack/README.md) | Sends a Slack notification when a job fails |
18+
| [Publish GitHub Release](publish-github-release/README.md) | Publishes a GitHub Release with notes fetched from Jira or provided directly |
19+
| [Release Jira Version](release-jira-version/README.md) | Releases a Jira version and creates the next one |
20+
| [Update Analyzer](update-analyzer/README.md) | Updates an analyzer version in SonarQube or SonarCloud and creates a pull request |
21+
| [Update Release Ticket Status](update-release-ticket-status/README.md) | Updates the status of a Jira release ticket and can change its assignee |
22+
| [Update Rule Metadata](update-rule-metadata/README.md) | Automates updating rule metadata across all supported languages using the rule-api tooling |
2123

2224
## Available Workflows
2325

24-
* [**Automated Release Workflow**](docs/AUTOMATED_RELEASE.md): Orchestrates the end-to-end release across Jira and GitHub, with optional integration tickets and analyzer PRs.
26+
| Workflow | Description |
27+
|----------|-------------|
28+
| [Automated Release Workflow](docs/AUTOMATED_RELEASE.md) | Orchestrates the end-to-end release across Jira and GitHub, with optional integration tickets and analyzer PRs |
29+
30+
## Claude Code Skills
31+
32+
This repository includes [Claude Code skills](skills/README.md) for automating common tasks related to release workflows.
33+
34+
| Skill | Description |
35+
|-------|-------------|
36+
| [automated-release-setup](./skills/automated-release-setup/) | Set up automated release workflow for SonarSource analyzer projects |
2537

2638
## Development
2739

docs/AUTOMATED_RELEASE.md

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
This reusable GitHub Actions workflow automates the end-to-end release process across Jira and GitHub, and optionally creates integration tickets and analyzer update PRs. It is designed to be invoked via `workflow_call` from other repositories.
44

5+
> **Quick Setup**: Use the [automated-release-setup Claude Code skill](../skills/automated-release-setup/) to automatically set up this workflow in your repository. The skill will guide you through prerequisites, create the necessary workflow files, and configure vault permissions.
6+
57
## Description
68

79
The workflow orchestrates these steps:
@@ -139,9 +141,94 @@ jobs:
139141
- Each job includes a "Summary" step that writes to `$GITHUB_STEP_SUMMARY` only when `verbose: true`.
140142
- Permissions and environments are scoped per job to minimize required privileges.
141143

144+
## Setup
145+
146+
To set up this workflow in your repository, you need to complete the following prerequisites and create the necessary workflow files.
147+
148+
### Prerequisites
149+
150+
1. **Jira Configuration**:
151+
- Add `Jira Tech User GitHub` as Administrator on your Jira project (Project settings → People → Administrator role)
152+
- For dry-run testing, also add the user to the Jira sandbox: https://sonarsource-sandbox-811.atlassian.net/
153+
154+
2. **Vault Permissions**:
155+
- Create a PR in `re-terraform-aws-vault` to add the `release-automation` secret
156+
- File: `orders/{squad}.yaml` (e.g., `orders/analysis-jvm-squad.yaml`)
157+
- Add the `release_automation` anchor if not present:
158+
```yaml
159+
release_automation: &release_automation
160+
suffix: release-automation
161+
description: access to sonar-enterprise and sonarcloud-core repositories to create PRs to update analyzers
162+
organization: SonarSource
163+
permissions:
164+
contents: write
165+
pull_requests: write
166+
```
167+
- Add to your repository's `github.customs` section:
168+
```yaml
169+
- <<: *release_automation
170+
repositories: [your-repo-name, sonar-enterprise, sonarcloud-core]
171+
```
172+
- Example PR: https://github.com/SonarSource/re-terraform-aws-vault/pull/8406
173+
174+
3. **Release Workflow**:
175+
- Update `release.yml` to support `workflow_dispatch` with inputs: `version`, `releaseId`, `dryRun`
176+
- Add fallbacks for release events:
177+
```yaml
178+
with:
179+
version: ${{ inputs.version || github.event.release.tag_name }}
180+
releaseId: ${{ inputs.releaseId || github.event.release.id }}
181+
dryRun: ${{ inputs.dryRun == true }}
182+
```
183+
184+
### Required Workflow Files
185+
186+
You need to create two workflow files:
187+
188+
1. **`automated-release.yml`**: Main workflow that calls this reusable workflow
189+
2. **`bump-versions.yaml`**: Bumps version after release (Maven or Gradle)
190+
191+
See the [Usage](#usage) section for examples, or use the [automated-release-setup skill](../skills/automated-release-setup/) for guided setup.
192+
193+
### SonarLint Integration
194+
195+
When your analyzer is used by SonarLint, you can enable integration ticket creation for IDE teams:
196+
197+
| Input | Jira Project | Description |
198+
|-------|--------------|-------------|
199+
| `create-slvs-ticket` | SLVS | SonarLint for Visual Studio |
200+
| `create-slvscode-ticket` | SLVSCODE | SonarLint for VS Code |
201+
| `create-sle-ticket` | SLE | SonarLint for Eclipse |
202+
| `create-sli-ticket` | SLI | SonarLint for IntelliJ |
203+
204+
Use `sq-ide-short-description` to describe changes relevant for IDE integrations.
205+
142206
## Troubleshooting
143207

144208
- Ensure the caller repository has appropriate permissions to use this workflow and to write releases and PRs.
145209
- Verify that `release-automation-secret-name` exists and grants access for creating analyzer update PRs. If omitted, ensure the default secret (`sonar-{plugin-name}-release-automation`) exists and is configured with the required permissions.
146210
- Check job logs if the final summary indicates failure; the per-job logs contain detailed outputs even when `verbose` is disabled.
147211
- Ensure the `Jira Tech User GitHub` is an Administrator on the target Jira project; admin rights are required to release the Jira version and to create a new version.
212+
213+
## Testing
214+
215+
1. **Test with dry-run first**:
216+
- Go to Actions → Automated Release → Run workflow
217+
- Set `dry-run: true`
218+
- Verify Jira tickets in sandbox, draft GitHub release, draft PRs
219+
220+
2. **Production release**:
221+
- Set `dry-run: false`
222+
- All tickets, releases, and PRs will be created in production
223+
224+
## Post-Release Checklist
225+
226+
- Review and merge the bump-version PR
227+
- Review and merge the SQS PR in sonar-enterprise
228+
- Review and merge the SQC PR in sonarcloud-core
229+
- Update integration ticket statuses in Jira
230+
- Set fix versions on the SONAR ticket
231+
232+
**If SonarLint integration is enabled:**
233+
- Monitor the SLVS, SLVSCode, SLE, and/or SLI tickets created in Jira
234+
- Coordinate with IDE teams for integration timelines

0 commit comments

Comments
 (0)