@@ -20,31 +20,43 @@ jobs:
2020 with :
2121 ref : ${{ github.event.inputs.commit_id }}
2222 - name : Configure git identity
23+ env :
24+ ACTOR : ${{ github.actor }}
2325 run : |
24- git config --global user.name ${{ github.actor }}
25- git config --global user.email ${{ github.actor }} @users.noreply.github.com
26+ git config --global user.name "$ACTOR"
27+ git config --global user.email "$ACTOR" @users.noreply.github.com
2628 - name : create a new branch that references commit id
27- run : git checkout -b ${{ github.event.inputs.version_number }} ${{ github.event.inputs.commit_id }}
29+ env :
30+ VERSION_NUMBER : ${{ github.event.inputs.version_number }}
31+ COMMIT_ID : ${{ github.event.inputs.commit_id }}
32+ run : git checkout -b "$VERSION_NUMBER" "$COMMIT_ID"
2833 - name : Generate SBOM
2934 uses : FreeRTOS/CI-CD-Github-Actions/sbom-generator@main
3035 with :
3136 repo_path : ./
3237 source_path : ./source
3338 - name : commit SBOM file
39+ env :
40+ VERSION_NUMBER : ${{ github.event.inputs.version_number }}
3441 run : |
3542 git add .
3643 git commit -m 'Update SBOM'
37- git push -u origin ${{ github.event.inputs.version_number }}
44+ git push -u origin "$VERSION_NUMBER"
3845 - name : Tag Commit and Push to remote
46+ env :
47+ VERSION_NUMBER : ${{ github.event.inputs.version_number }}
3948 run : |
40- git tag ${{ github.event.inputs.version_number }} -a -m "backoffAlgorithm Library ${{ github.event.inputs.version_number }} "
49+ git tag "$VERSION_NUMBER" -a -m "backoffAlgorithm Library $VERSION_NUMBER "
4150 git push origin --tags
4251 - name : Verify tag on remote
52+ env :
53+ VERSION_NUMBER : ${{ github.event.inputs.version_number }}
54+ COMMIT_ID : ${{ github.event.inputs.commit_id }}
4355 run : |
44- git tag -d ${{ github.event.inputs.version_number }}
56+ git tag -d "$VERSION_NUMBER"
4557 git remote update
46- git checkout tags/${{ github.event.inputs.version_number }}
47- git diff ${{ github.event.inputs.commit_id }} tags/${{ github.event.inputs.version_number }}
58+ git checkout tags/"$VERSION_NUMBER"
59+ git diff "$COMMIT_ID" tags/"$VERSION_NUMBER"
4860 create-zip :
4961 needs : tag-commit
5062 name : Create ZIP and verify package for release asset.
@@ -63,21 +75,27 @@ jobs:
6375 cd backoffAlgorithm
6476 git submodule update --init --checkout --recursive
6577 - name : Create ZIP
78+ env :
79+ VERSION_NUMBER : ${{ github.event.inputs.version_number }}
6680 run : |
67- zip -r backoffAlgorithm-${{ github.event.inputs.version_number }} .zip backoffAlgorithm -x "*.git*"
81+ zip -r backoffAlgorithm-"$VERSION_NUMBER" .zip backoffAlgorithm -x "*.git*"
6882 ls ./
6983 - name : Validate created ZIP
84+ env :
85+ VERSION_NUMBER : ${{ github.event.inputs.version_number }}
7086 run : |
7187 mkdir zip-check
72- mv backoffAlgorithm-${{ github.event.inputs.version_number }} .zip zip-check
88+ mv backoffAlgorithm-"$VERSION_NUMBER" .zip zip-check
7389 cd zip-check
74- unzip backoffAlgorithm-${{ github.event.inputs.version_number }}. zip -d backoffAlgorithm-${{ github.event.inputs.version_number }}
75- ls backoffAlgorithm-${{ github.event.inputs.version_number }}
76- diff -r -x "*.git*" backoffAlgorithm-${{ github.event.inputs.version_number }} /backoffAlgorithm/ ../backoffAlgorithm/
90+ unzip backoffAlgorithm-"$VERSION_NUMBER". zip -d backoffAlgorithm-"$VERSION_NUMBER"
91+ ls backoffAlgorithm-"$VERSION_NUMBER"
92+ diff -r -x "*.git*" backoffAlgorithm-"$VERSION_NUMBER" /backoffAlgorithm/ ../backoffAlgorithm/
7793 cd ../
7894 - name : Build
95+ env :
96+ VERSION_NUMBER : ${{ github.event.inputs.version_number }}
7997 run : |
80- cd zip-check/backoffAlgorithm-${{ github.event.inputs.version_number }} /backoffAlgorithm
98+ cd zip-check/backoffAlgorithm-"$VERSION_NUMBER" /backoffAlgorithm
8199 sudo apt-get install -y lcov
82100 cmake -S test -B build/ \
83101 -G "Unix Makefiles" \
@@ -86,8 +104,10 @@ jobs:
86104 -DCMAKE_C_FLAGS='--coverage -Wall -Wextra -Werror'
87105 make -C build/ all
88106 - name : Test
107+ env :
108+ VERSION_NUMBER : ${{ github.event.inputs.version_number }}
89109 run : |
90- cd zip-check/backoffAlgorithm-${{ github.event.inputs.version_number }} /backoffAlgorithm/build/
110+ cd zip-check/backoffAlgorithm-"$VERSION_NUMBER" /backoffAlgorithm/build/
91111 ctest -E system --output-on-failure
92112 cd ..
93113 - name : Create artifact of ZIP
0 commit comments