From c22f40d9a5e239fdfd98bfc210a33c26a627b9f6 Mon Sep 17 00:00:00 2001 From: Xin Lin <47510956+xlin7799@users.noreply.github.com> Date: Thu, 28 Jul 2022 10:35:29 -0700 Subject: [PATCH] Add SBOM Generation in auto_release.yml (#524) --- .github/workflows/auto-release.yml | 28 ++++++++++++++++++++++++---- manifest.yml | 4 ++++ 2 files changed, 28 insertions(+), 4 deletions(-) create mode 100644 manifest.yml diff --git a/.github/workflows/auto-release.yml b/.github/workflows/auto-release.yml index 75a34cf21..3bf820a6f 100644 --- a/.github/workflows/auto-release.yml +++ b/.github/workflows/auto-release.yml @@ -13,7 +13,7 @@ on: default: '10.4.4' main_br_version: description: "Version String for task.h on main branch (leave empty to leave as-is)." - require: false + required: false default: '' jobs: @@ -44,14 +44,34 @@ jobs: path: local_kernel fetch-depth: 0 - - name: Release + - name: Configure git identity run: | - # Configure repo for push git config --global user.name ${{ github.actor }} git config --global user.email ${{ github.actor }}@users.noreply.github.com + + - name: create a new branch that references commit id + working-directory: ./local_kernel + run: git checkout -b ${{ github.event.inputs.version_number }} ${{ github.event.inputs.commit_id }} + + - name: Generate SBOM + uses: FreeRTOS/CI-CD-Github-Actions/sbom-generator@main + with: + repo_path: ./local_kernel + source_path: ./ + + - name: commit SBOM file + working-directory: ./local_kernel + run: | + git add . + git commit -m 'Update SBOM' + git push -u origin ${{ github.event.inputs.version_number }} + echo "COMMIT_SHA=$(git rev-parse HEAD)" >> $GITHUB_ENV + + - name: Release + 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=${{ github.event.inputs.commit_id }} --new-kernel-version=${{ github.event.inputs.version_number }} --new-kernel-main-br-version=${{ github.event.inputs.main_br_version }} + ./tools/.github/scripts/release.py FreeRTOS --kernel-repo-path=local_kernel --kernel-commit=${{ env.COMMIT_SHA }} --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 }} diff --git a/manifest.yml b/manifest.yml new file mode 100644 index 000000000..85b552213 --- /dev/null +++ b/manifest.yml @@ -0,0 +1,4 @@ +name : "FreeRTOS-Kernel" +version: "v10.4.6" +description: "FreeRTOS Kernel." +license: "MIT"