Skip to content

Commit c615df6

Browse files
authored
[FR] Update the release versioning process and workflow (#4257)
1 parent d1b1027 commit c615df6

File tree

3 files changed

+20
-5
lines changed

3 files changed

+20
-5
lines changed

.github/workflows/version-code-and-release.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ jobs:
6464
fi
6565
fi
6666
67-
release_drafter:
67+
tag_and_draft_release:
6868
if: github.event.pull_request.merged == true
6969
runs-on: ubuntu-latest
7070
permissions:
@@ -73,6 +73,19 @@ jobs:
7373
- name: Checkout repository
7474
uses: actions/checkout@v4
7575

76+
- name: Set github config
77+
run: |
78+
git config --global user.email "[email protected]"
79+
git config --global user.name "protectionsmachine"
80+
81+
- name: Extract version from pyproject.toml and create tag
82+
id: extract_version
83+
run: |
84+
version=$(grep '^version = ' pyproject.toml | cut -d '"' -f2)
85+
echo "Detected version: $version"
86+
git tag -a "dev-v$version" -m "Release version $version"
87+
git push origin "v$version"
88+
7689
- name: Run Release Drafter
7790
uses: release-drafter/release-drafter@v6
7891
with:

docs/versioning.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ Increment the patch version when making bug fixes, performance improvements, or
8080
- Small performance tweaks for the hunting rule management.
8181
- **Docs Folder**:
8282
- Updates to documentation.
83+
- **JSON Schemas**:
84+
- Recurring update to schema definitions that don't break compatibility (not .py schema updates).
8385

8486
</p>
8587
</details>
@@ -140,7 +142,7 @@ Increment the major version when introducing backward-incompatible changes that
140142

141143
## Tagging Process
142144

143-
Each release will be tagged using the following format:
145+
Each pyproject.toml update will be tagged using the following format:
144146
- **Tag Format**: `dev-vX.Y.Z` (e.g., `dev-v1.2.0`).
145147
- **Single Tag for Combined Releases**: If there are changes to the core detection-rules code or libraries (`kql`, `kibana`), they will be tagged together as a single release with the core detection-rules versioning.
146148
- **Hunting Folder**: Changes to the hunting logic will be included in the combined release.
@@ -151,11 +153,11 @@ Each release will be tagged using the following format:
151153

152154
## When to Trigger a GitHub Release
153155

154-
A draft release will be triggered in the following cases:
156+
A draft release will be triggered on all version updates. For example, in the following cases:
155157
- **New Feature or Bug Fix**: Once a feature or bug fix is merged into `main`, a version bump is made according to the semantic versioning rules.
156158
- **Version Bump**: After the version bump, a GitHub release will be created using **release-drafter** CI workflow to automate draft release generation.
157159

158160
As pull requests are merged, a draft release is kept up-to-date listing the changes, ready to publish quarterly.
159161

160162
> [!IMPORTANT]
161-
> Proper PR labels need to be added for this to properly be labeled and added to the draft.
163+
> Releases are published on minor and major version bumps at a minimum. Prior to publishing, the release notes should be reviewed and updated with any additional information, or remove any unnecessary details not related to code changes (which may occur due to release-drafter pulling in all commits).

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "detection_rules"
3-
version = "0.1.1"
3+
version = "0.1.2"
44
description = "Detection Rules is the home for rules used by Elastic Security. This repository is used for the development, maintenance, testing, validation, and release of rules for Elastic Security’s Detection Engine."
55
readme = "README.md"
66
requires-python = ">=3.12"

0 commit comments

Comments
 (0)