Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# https://github.com/release-drafter/release-drafter?tab=readme-ov-file#configuration-options
template: |
$CHANGES

**Full Changelog**: https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...v$RESOLVED_VERSION
name-template: 'oblt-actions v$RESOLVED_VERSION'
tag-template: 'v$RESOLVED_VERSION'
change-template: '- $TITLE by @$AUTHOR in #$NUMBER'
categories:
- title: '💥 Breaking Changes'
labels:
- 'changelog:breaking' # When a breaking change is introduced
- title: '✨ Features'
labels:
- 'changelog:feature' # When a new feature is introduced
- 'changelog:enhancement' # When an existing feature is improved
- title: '🐛 Bug Fixes'
labels:
- 'changelog:fix' # When a bug is fixed
- title: '📝 Documentation'
labels:
- 'changelog:docs' # When documentation is updated
- title: '🧰 Maintenance'
labels:
- 'changelog:chore' # When a chore is done
- 'changelog:ci' # When CI is updated
- 'changelog:dependencies' # When dependencies are updated
exclude-labels:
- 'changelog:skip' # When a PR should be excluded from the changelog
version-resolver:
major:
labels:
- 'changelog:breaking'
minor:
labels:
- 'changelog:feature'
default: patch
23 changes: 23 additions & 0 deletions .github/workflows/create-major-tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: create-major-tag

on:
release:
types:
- published

permissions:
contents: write

jobs:
create-major-tag:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Get major version
run: |
MAJOR_VERSION=$(echo "${GITHUB_REF#refs/tags/v}" | awk -F. '{print $1}')
echo "MAJOR_VERSION=${MAJOR_VERSION}" >> "${GITHUB_ENV}"
- name: Create major tag
run: |
git tag "v${MAJOR_VERSION}"
git push -f origin "refs/tags/v${MAJOR_VERSION}"
20 changes: 20 additions & 0 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: release-drafter

on:
push:
branches:
- main

permissions:
contents: read

jobs:
update-release-draft:
permissions:
contents: write
pull-requests: read
runs-on: ubuntu-latest
steps:
- uses: release-drafter/release-drafter@3f0f87098bd6b5c5b9a36d49c41d998ea58f9348 # v6.0.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33 changes: 33 additions & 0 deletions .github/workflows/required-labels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: required-labels

on:
pull_request_target:
types:
- opened
- labeled
- unlabeled
- synchronize

permissions:
contents: read

jobs:
check-labels:
permissions:
contents: read
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- id: get-labels
run: |
labels=$(yq '[.categories[].labels] + .exclude-labels | flatten | unique | sort | @tsv' .github/release-drafter.yml | tr '\t' ',')
echo "labels=$labels" >> "${GITHUB_OUTPUT}"
- id: check-labels
uses: mheap/github-action-required-labels@5847eef68201219cf0a4643ea7be61e77837bbce # v5.4.1
with:
mode: exactly
count: 1
use_regex: false
add_comment: true
labels: ${{ steps.get-labels.outputs.labels }}
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# GitHub Actions for Elastic Observability projects

TBD
This repository contains GitHub Actions for Elastic Observability projects.

## Releasing

See [RELEASE.md](docs/RELEASE.md) for the release process.

<sup><br>Made with ♥️ and ☕️ by Elastic and our community.</sup>
26 changes: 26 additions & 0 deletions docs/RELEASE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Release Process

This document outlines the process for releasing a new version of this project.

## Versioning

This project uses [Semantic Versioning](https://semver.org/) and its version is
automatically determined by [release-drafter](https://github.com/release-drafter/release-drafter)
based on the labels of the pull requests merged into the `main` branch.

See the [release-drafter configuration](../.github/release-drafter.yml) for more details.

## Creating a New Release

Every time a pull request is merged into the `main` branch, release-drafter will
create a draft release or update the existing draft release in the [Releases](https://github.com/elastic/oblt-actions/releases) page.

To create a new release you need to publish the existing draft release created by release-drafter.

> [!IMPORTANT]
> Make sure the [release-drafter workflow](../.github/workflows/release-drafter.yml) is finished before publishing the release.

> [!NOTE]
> When a release is published, the [create-major-tag workflow](../.github/workflows/create-major-tag.yml)
> will force push a new major tag in the format `vX` where `X` is the major version of the release.
> For example, if the release is `v1.2.3` was published, the workflow will force push a new tag `v1` on the same commit.