Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FreeRTOS/FreeRTOS-Kernel.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkar-rahul-aws <118818625+kar-rahul-aws@users.noreply.github.com>2023-08-17 11:07:58 +0300
committerGitHub <noreply@github.com>2023-08-17 11:07:58 +0300
commitcd87a397366cb009581c9a1ddc92c2d2ae013929 (patch)
tree142ae97034f9a62af41dcd58a88f9e74e4d665ce /.github
parentb1a85116bdbc22063f9ca0df9eadc95e17f221af (diff)
Update version number in manifest.yml (#755)
* Add automation to update version number in manifest.yml * Make updater file executable
Diffstat (limited to '.github')
-rwxr-xr-x.github/scripts/manifest_updater.py32
-rw-r--r--.github/workflows/auto-release.yml17
2 files changed, 47 insertions, 2 deletions
diff --git a/.github/scripts/manifest_updater.py b/.github/scripts/manifest_updater.py
new file mode 100755
index 000000000..684c7cb5a
--- /dev/null
+++ b/.github/scripts/manifest_updater.py
@@ -0,0 +1,32 @@
+#!/usr/bin/env python3
+import os
+import argparse
+
+THIS_FILE_PATH = os.path.dirname(os.path.abspath(__file__))
+MANIFEST_FILE = os.path.join(THIS_FILE_PATH, '..', '..', 'manifest.yml')
+
+def update_manifest_file(new_version_number):
+ updated_lines = []
+ with open(MANIFEST_FILE, 'r') as f:
+ for line in f:
+ line = line.strip()
+ if line.startswith('version'):
+ updated_lines.append(f'version: "v{new_version_number}"\n')
+ else:
+ updated_lines.append(f'{line}\n')
+
+ with open(MANIFEST_FILE, 'w') as f:
+ f.writelines(updated_lines)
+
+def parse_args():
+ parser = argparse.ArgumentParser()
+ parser.add_argument('-v', '--version', required=True, help='New version number.')
+ args = parser.parse_args()
+ return args
+
+def main():
+ args = parse_args()
+ update_manifest_file(args.version)
+
+if __name__ == '__main__':
+ main()
diff --git a/.github/workflows/auto-release.yml b/.github/workflows/auto-release.yml
index 426d8f0c0..21788c8a6 100644
--- a/.github/workflows/auto-release.yml
+++ b/.github/workflows/auto-release.yml
@@ -63,6 +63,19 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ - name : Update version number in manifest.yml
+ working-directory: ./local_kernel
+ run: |
+ ./.github/scripts/manifest_updater.py -v ${{ github.event.inputs.version_number }}
+ exit $?
+
+ - name : Commit version number change in manifest.yml
+ working-directory: ./local_kernel
+ run: |
+ git add .
+ git commit -m '[AUTO][RELEASE]: Update version number in manifest.yml'
+ git push -u origin ${{ github.event.inputs.version_number }}
+
- name: Generate SBOM
uses: FreeRTOS/CI-CD-Github-Actions/sbom-generator@main
with:
@@ -73,7 +86,7 @@ jobs:
working-directory: ./local_kernel
run: |
git add .
- git commit -m 'Update SBOM'
+ git commit -m '[AUTO][RELEASE]: Update SBOM'
git push -u origin ${{ github.event.inputs.version_number }}
echo "COMMIT_SHA_2=$(git rev-parse HEAD)" >> $GITHUB_ENV
@@ -81,7 +94,7 @@ jobs:
run: |
# Install deps and run
pip install -r ./tools/.github/scripts/release-requirements.txt
- ./tools/.github/scripts/release.py FreeRTOS --kernel-repo-path=local_kernel --kernel-commit=${{ env.COMMIT_SHA_2 }} --new-kernel-version=${{ github.event.inputs.version_number }} --new-kernel-main-br-version=${{ github.event.inputs.main_br_version }}
+ ./tools/.github/scripts/release.py ${{ github.repository_owner }} --kernel-repo-path=local_kernel --kernel-commit=${{ env.COMMIT_SHA_2 }} --new-kernel-version=${{ github.event.inputs.version_number }} --new-kernel-main-br-version=${{ github.event.inputs.main_br_version }}
exit $?
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}