Skip to content

Commit 84432af

Browse files
zgliczclaude
andauthored
JS-1126 Add automated release workflow (#6212)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 81578b6 commit 84432af

3 files changed

Lines changed: 134 additions & 1 deletion

File tree

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
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+
sq-ide-short-description:
10+
description: "Short summary of SQ IDE related changes (optional, falls back to short-description)"
11+
required: false
12+
type: string
13+
sqc-integration:
14+
description: "Integrate into SQC"
15+
type: boolean
16+
default: true
17+
sqs-integration:
18+
description: "Integrate into SQS"
19+
type: boolean
20+
default: true
21+
branch:
22+
description: "Branch from which to do the release"
23+
required: true
24+
default: "master"
25+
type: string
26+
new-version:
27+
description: "New version to release (without -SNAPSHOT; if left empty, the current minor version will be auto-incremented)"
28+
required: false
29+
type: string
30+
rule-props-changed:
31+
description: >
32+
"@RuleProperty" changed? See SC-4654
33+
type: boolean
34+
default: false
35+
36+
jobs:
37+
release:
38+
name: Release
39+
uses: SonarSource/release-github-actions/.github/workflows/automated-release.yml@v1
40+
permissions:
41+
statuses: read
42+
id-token: write
43+
contents: write
44+
actions: write
45+
pull-requests: write
46+
with:
47+
project-name: "SonarJS"
48+
plugin-name: "javascript"
49+
jira-project-key: "JS"
50+
rule-props-changed: ${{ github.event.inputs.rule-props-changed }}
51+
short-description: ${{ github.event.inputs.short-description }}
52+
sq-ide-short-description: ${{ github.event.inputs.sq-ide-short-description }}
53+
new-version: ${{ github.event.inputs.new-version }}
54+
sqc-integration: ${{ github.event.inputs.sqc-integration == 'true' }}
55+
sqs-integration: ${{ github.event.inputs.sqs-integration == 'true' }}
56+
create-slvs-ticket: true
57+
create-slvscode-ticket: true
58+
create-sle-ticket: true
59+
create-sli-ticket: true
60+
branch: ${{ github.event.inputs.branch }}
61+
pm-email: "gabriel.vivas@sonarsource.com"
62+
slack-channel: "ask-squad-web"
63+
release-automation-secret-name: "SonarJS-release-automation"
64+
verbose: true
65+
use-jira-sandbox: false
66+
is-draft-release: true
67+
68+
bump_versions:
69+
name: Bump versions
70+
needs: release
71+
uses: ./.github/workflows/bump-versions.yml
72+
permissions:
73+
contents: write
74+
pull-requests: write
75+
with:
76+
version: ${{ needs.release.outputs.new-version }}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Bump versions
2+
on:
3+
workflow_call:
4+
inputs:
5+
version:
6+
description: The new version
7+
required: true
8+
type: string
9+
workflow_dispatch:
10+
inputs:
11+
version:
12+
description: The new version
13+
required: true
14+
type: string
15+
16+
jobs:
17+
bump-version:
18+
runs-on: github-ubuntu-latest-s
19+
permissions:
20+
contents: write
21+
pull-requests: write
22+
steps:
23+
- uses: actions/checkout@v4
24+
- name: Update version in pom.xml
25+
env:
26+
VERSION: ${{ inputs.version }}
27+
run: |
28+
snapshot_version="${VERSION}-SNAPSHOT"
29+
# Update only root pom.xml to the new snapshot version
30+
sed -i "s/<version>.*-SNAPSHOT<\/version>/<version>${snapshot_version}<\/version>/" pom.xml
31+
- uses: peter-evans/create-pull-request@v7
32+
with:
33+
author: ${{ github.actor }} <${{ github.actor }}>
34+
commit-message: Prepare next development iteration
35+
title: Prepare next development iteration
36+
branch: bot/bump-project-version
37+
branch-suffix: timestamp
38+
base: master
39+
reviewers: ${{ github.actor }}

.github/workflows/release.yml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,21 @@ on:
66
release:
77
types:
88
- published
9+
workflow_dispatch:
10+
inputs:
11+
version:
12+
type: string
13+
description: Version
14+
required: true
15+
releaseId:
16+
type: string
17+
description: Release ID
18+
required: true
19+
dryRun:
20+
type: boolean
21+
description: Flag to enable the dry-run execution
22+
default: false
23+
required: false
924

1025
jobs:
1126
release:
@@ -16,4 +31,7 @@ jobs:
1631
with:
1732
publishToBinaries: true
1833
mavenCentralSync: true
19-
slackChannel: squad-web
34+
slackChannel: squad-web
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)