]> begriffs open source - freertos/blob - .github/workflows/auto-release.yml
Paranthesize expression-like macro (#668)
[freertos] / .github / workflows / auto-release.yml
1 name: Kernel-Auto-Release
2
3 on:
4   workflow_dispatch:
5     inputs:
6       commit_id:
7         description: 'Commit ID'
8         required: true
9         default: 'HEAD'
10       version_number:
11         description: 'Version Number (Ex. 10.4.4)'
12         required: true
13         default: '10.4.4'
14       main_br_version:
15         description: "Version String for task.h on main branch (leave empty to leave as-is)."
16         required: false
17         default: ''
18
19 jobs:
20   release-packager:
21     name: Release Packager
22     runs-on: ubuntu-latest
23     steps:
24       # Install python 3
25       - name: Tool Setup
26         uses: actions/setup-python@v2
27         with:
28           python-version: 3.7.10
29           architecture:   x64
30         env:
31           GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32
33       # Currently FreeRTOS/.github/scripts houses the release script. Download it for upcoming usage
34       - name: Checkout FreeRTOS Release Tools
35         uses: actions/checkout@v2
36         with:
37           repository: FreeRTOS/FreeRTOS
38           path: tools
39
40       # Simpler git auth if we use checkout action and forward the repo to release script
41       - name: Checkout FreeRTOS Kernel
42         uses: actions/checkout@v2
43         with:
44           path: local_kernel
45           fetch-depth: 0
46
47       - name: Configure git identity
48         run: |
49           git config --global user.name ${{ github.actor }}
50           git config --global user.email ${{ github.actor }}@users.noreply.github.com
51
52       - name: create a new branch that references commit id
53         working-directory: ./local_kernel
54         run: git checkout -b ${{ github.event.inputs.version_number }} ${{ github.event.inputs.commit_id }}
55
56       - name: Generate SBOM
57         uses: FreeRTOS/CI-CD-Github-Actions/sbom-generator@main
58         with:
59           repo_path: ./local_kernel
60           source_path: ./
61
62       - name: commit SBOM file
63         working-directory: ./local_kernel
64         run: |
65           git add .
66           git commit -m 'Update SBOM'
67           git push -u origin ${{ github.event.inputs.version_number }}
68           echo "COMMIT_SHA=$(git rev-parse HEAD)" >> $GITHUB_ENV
69
70       - name: Release
71         run: |
72           # Install deps and run
73           pip install -r ./tools/.github/scripts/release-requirements.txt
74           ./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 }}
75           exit $?
76         env:
77             GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}