Skip to content

Commit 495dbbc

Browse files
committed
Add workflow to prepare for the next release
include - updating version files - generating release notes
1 parent 1fb0cc3 commit 495dbbc

File tree

1 file changed

+66
-0
lines changed

1 file changed

+66
-0
lines changed

.github/workflows/prepare_release.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# Copyright (C) 2019 Intel Corporation. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
3+
4+
# It includes:
5+
# - add new content into the RELEASE_NOTES.md
6+
# - update the version in build-scripts/version.cmake and core/version.h
7+
#
8+
# The new content is added to the beginning of the RELEASE_NOTES.md file.
9+
# It includes all merged PR titles since the last release(tag).
10+
# Based on every PR's label, it will be categorized into different sections.
11+
#
12+
# The version number is updated to the next version.
13+
# Based on new content in the RELEASE_NOTES.md, it will be determined
14+
# 1. if there is breaking change or new features, the next version will be a minor version
15+
# 2. if there is no breaking change and new features, the next version will be a patch version
16+
#
17+
# At the end, file a PR to update the files.
18+
19+
name: preparation for a release.
20+
21+
on:
22+
workflow_dispatch:
23+
24+
# Cancel any in-flight jobs for the same PR/branch so there's only one active
25+
# at a time
26+
concurrency:
27+
group: ${{ github.workflow }}-${{ github.ref }}
28+
cancel-in-progress: true
29+
30+
jobs:
31+
prepare_release:
32+
permissions:
33+
contents: write # update files
34+
runs-on: ubuntu-latest
35+
steps:
36+
- uses: actions/checkout@v4
37+
38+
- name: prepare the release note
39+
id: generate_release_notes
40+
run: |
41+
python3 ./.github/scripts/generate_release_notes.py ./RELEASE_NOTES.md"
42+
43+
- name: extract next version from previous step's output
44+
id: extract_version
45+
run: |
46+
echo "next_version=${{ steps.generate_release_notes.outputs.next_version }}" >> $GITHUB_ENV
47+
48+
- name: update version files
49+
run: |
50+
python3 ./.github/scripts/update_version_files.py ${{ env.next_version }}
51+
52+
- name: file a PR
53+
id: file_pr
54+
uses: peter-evans/create-pull-request@v4
55+
with:
56+
token: ${{ secrets.GITHUB_TOKEN }}
57+
title: "Prepare for the next release"
58+
body: |
59+
This PR prepares for the next release.
60+
It updates the version files and adds new content to the RELEASE_NOTES.md.
61+
commit-message: "prepare for the next release"
62+
branch: prepare-release-${{ github.run_id }}
63+
paths: |
64+
RELEASE_NOTES.md
65+
build-scripts/version.cmake
66+
core/version.h

0 commit comments

Comments
 (0)