Skip to content

Commit 214456c

Browse files
SONARRUBY-118 Add automated release workflow (#100)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 4e199e0 commit 214456c

File tree

2 files changed

+94
-0
lines changed

2 files changed

+94
-0
lines changed
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: Automated Release
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
short-description:
6+
description: "Short description for the REL ticket"
7+
required: true
8+
type: string
9+
branch:
10+
description: "Branch from which to do the release"
11+
required: true
12+
default: "master"
13+
type: string
14+
new-version:
15+
description: "New version to release (without -SNAPSHOT; if left empty, the current minor version will be auto-incremented)"
16+
required: false
17+
type: string
18+
rule-props-changed:
19+
description: >
20+
"@RuleProperty" changed? See SC-4654
21+
type: boolean
22+
default: false
23+
verbose:
24+
description: "Enable verbose logging"
25+
type: boolean
26+
default: false
27+
dry-run:
28+
description: "Test mode: uses Jira sandbox and creates draft GitHub release"
29+
type: boolean
30+
default: true
31+
sqc-integration:
32+
description: "Integrate into SQC"
33+
type: boolean
34+
default: true
35+
sqs-integration:
36+
description: "Integrate into SQS"
37+
type: boolean
38+
default: true
39+
sli-integration:
40+
description: "Create SLI ticket (SonarLint for IntelliJ)"
41+
type: boolean
42+
default: true
43+
issue-categories:
44+
description: "Jira issue categories to include in the release notes"
45+
required: false
46+
type: string
47+
default: "New Feature,False Positive,False Negative,Bug,Improvement,Task"
48+
49+
jobs:
50+
release:
51+
name: Release
52+
uses: SonarSource/release-github-actions/.github/workflows/automated-release.yml@v1
53+
permissions:
54+
statuses: read
55+
id-token: write
56+
contents: write
57+
actions: write
58+
pull-requests: write
59+
with:
60+
project-name: "SonarRuby"
61+
plugin-name: "ruby"
62+
jira-project-key: "SONARRUBY"
63+
runner-environment: "github-ubuntu-latest-s"
64+
rule-props-changed: ${{ github.event.inputs.rule-props-changed }}
65+
short-description: ${{ github.event.inputs.short-description }}
66+
new-version: ${{ github.event.inputs.new-version }}
67+
sqc-integration: ${{ github.event.inputs.sqc-integration == 'true' }}
68+
sqs-integration: ${{ github.event.inputs.sqs-integration == 'true' }}
69+
create-sli-ticket: ${{ github.event.inputs.sli-integration == 'true' }}
70+
branch: ${{ github.event.inputs.branch }}
71+
pm-email: "jean.jimbo@sonarsource.com"
72+
slack-channel: "squad-jvm-notifs"
73+
verbose: ${{ github.event.inputs.verbose == 'true' }}
74+
use-jira-sandbox: ${{ github.event.inputs.dry-run == 'true' }}
75+
is-draft-release: ${{ github.event.inputs.dry-run == 'true' }}
76+
bump-version: true
77+
issue-categories: ${{ github.event.inputs.issue-categories }}

.github/workflows/release.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,20 @@ on:
44
release:
55
types:
66
- published
7+
workflow_dispatch:
8+
inputs:
9+
version:
10+
type: string
11+
description: Version
12+
required: true
13+
releaseId:
14+
type: string
15+
description: Release ID
16+
required: true
17+
dryRun:
18+
type: boolean
19+
description: Flag to enable the dry-run execution
20+
default: false
721

822
env:
923
PYTHONUNBUFFERED: 1
@@ -18,3 +32,6 @@ jobs:
1832
publishToBinaries: true
1933
mavenCentralSync: true
2034
slackChannel: squad-jvm-notifs
35+
version: ${{ inputs.version || github.event.release.tag_name }}
36+
releaseId: ${{ inputs.releaseId || github.event.release.id }}
37+
dryRun: ${{ inputs.dryRun == true }}

0 commit comments

Comments
 (0)