Skip to content

Commit 755af17

Browse files
committed
Add release action to update version info in source files
1 parent 1bf8afe commit 755af17

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

.github/workflows/release.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,19 @@ jobs:
3030
VERSION_NUMBER: ${{ github.event.inputs.version_number }}
3131
COMMIT_ID: ${{ github.event.inputs.commit_id }}
3232
run: git checkout -b "$VERSION_NUMBER" "$COMMIT_ID"
33+
- name: Update version number in source files
34+
env:
35+
VERSION_NUMBER: ${{ github.event.inputs.version_number }}
36+
REPO_NAME: ${{ github.event.repository.name }}
37+
source_folder_list: "source test"
38+
run: |
39+
echo "${{ env.source_folder_list }}" | \
40+
xargs -n 1 sh -c \
41+
'find $1 -type f \( -name "*.c" -o -name "*.h" \) \
42+
-exec sed -i -b -E "0,/^ \* FreeRTOS\+TCP/s/^ \* FreeRTOS\+TCP.*/ \* FreeRTOS\+TCP $VERSION_NUMBER/g" {} +'
43+
git add .
44+
git commit -m '[AUTO][RELEASE]: Update version number in source files'
45+
git push -u origin "$VERSION_NUMBER"
3346
- name: Generate SBOM
3447
uses: FreeRTOS/CI-CD-Github-Actions/sbom-generator@main
3548
with:

0 commit comments

Comments
 (0)