Skip to content

Commit 86e8a28

Browse files
authored
SLE-1498 Add DevEx automated release workflow (#1052)
1 parent 65a9168 commit 86e8a28

2 files changed

Lines changed: 83 additions & 1 deletion

File tree

.github/workflows/full-release.yml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: Full release
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
short-description:
7+
description: 'A short description for the release ticket'
8+
required: true
9+
type: string
10+
branch:
11+
description: 'The branch from which to release.'
12+
required: false
13+
default: 'master'
14+
type: string
15+
new-version:
16+
description: 'New Jira version to create after the release (e.g. 10.9). Leave empty to auto-increment the last segment.'
17+
required: false
18+
type: string
19+
dry-run:
20+
description: 'Test mode: use Jira sandbox and create a draft GitHub release'
21+
required: false
22+
default: false
23+
type: boolean
24+
25+
jobs:
26+
release:
27+
name: Release
28+
uses: SonarSource/release-github-actions/.github/workflows/ide-automated-release.yml@706e44289960d7768dc6f953bc1c0df003e812cb # 1.5.9
29+
permissions:
30+
statuses: read
31+
id-token: write
32+
contents: write
33+
actions: write
34+
pull-requests: write
35+
with:
36+
jira-project-key: "SLE"
37+
project-name: "SonarLint for Eclipse"
38+
short-description: ${{ inputs.short-description }}
39+
branch: ${{ inputs.branch }}
40+
slack-channel: "C02E6L5C01H"
41+
is-test-run: ${{ inputs.dry-run }}
42+
new-version: ${{ inputs.new-version }}
43+
44+
bump-version:
45+
name: Bump Tycho version
46+
needs: [release]
47+
# Dry-run safety: never open a Tycho version-bump PR against master during a sandbox test
48+
if: ${{ !inputs.dry-run && needs.release.result == 'success' }}
49+
runs-on: github-ubuntu-latest-s
50+
permissions:
51+
contents: write
52+
pull-requests: write
53+
steps:
54+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
55+
with:
56+
ref: ${{ inputs.branch }}
57+
58+
- name: Bump Tycho version
59+
env:
60+
NEW_VERSION: ${{ needs.release.outputs.new-version }}
61+
run: |
62+
NV="$NEW_VERSION"
63+
# new-version is the Jira short version (X.Y for minor, X.Y.Z for patch — never 4-segment).
64+
# Tycho requires 3-segment OSGi format: pad X.Y to X.Y.0; X.Y.Z passes through unchanged.
65+
if [[ "$NV" =~ ^[0-9]+\.[0-9]+$ ]]; then NV="${NV}.0"; fi
66+
mvn -B org.eclipse.tycho:tycho-versions-plugin:set-version \
67+
-Dtycho.mode=maven -DnewVersion="${NV}-SNAPSHOT"
68+
69+
- uses: SonarSource/release-github-actions/create-pull-request@706e44289960d7768dc6f953bc1c0df003e812cb # 1.5.9
70+
with:
71+
commit-message: Prepare next development iteration ${{ needs.release.outputs.new-version }}
72+
title: Prepare next development iteration ${{ needs.release.outputs.new-version }}
73+
branch: bot/prepare-next-development-iteration-${{ needs.release.outputs.new-version }}
74+
base: ${{ inputs.branch }}
75+
reviewers: ${{ github.actor }}

.github/workflows/release.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,21 @@ on:
55
version:
66
description: 'Full version including build number, e.g. 1.2.3.456'
77
required: true
8+
type: string
9+
dryRun:
10+
description: 'Flag to enable the dry-run execution'
11+
required: false
12+
default: false
13+
type: boolean
814

915
jobs:
1016
sonar_release:
1117
permissions:
1218
id-token: write
1319
contents: write
14-
uses: SonarSource/gh-action_release/.github/workflows/main.yaml@95ca260926950eedcc8c69437f9f12b6f0584de4 # v7.0.1
20+
uses: SonarSource/gh-action_release/.github/workflows/main.yaml@95ca260926950eedcc8c69437f9f12b6f0584de4 # 7.0.1
1521
with:
1622
version: ${{ inputs.version }}
1723
publishToBinaries: true
24+
dryRun: ${{ inputs.dryRun }}
1825
slackChannel: C02E6L5C01H # squad-devex-private

0 commit comments

Comments
 (0)