Skip to content

Commit affe65f

Browse files
committed
Update release yml.
1 parent 96c6f3a commit affe65f

File tree

1 file changed

+38
-16
lines changed

1 file changed

+38
-16
lines changed

.github/workflows/release.yml

Lines changed: 38 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -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 "FreeRTOS-Plus-TCP Library ${{ github.event.inputs.version_number }}"
49+
git tag "$VERSION_NUMBER" -a -m "FreeRTOS-Plus-TCP 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,28 +75,36 @@ jobs:
6375
cd FreeRTOS-Plus-TCP
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 FreeRTOS-Plus-TCP-${{ github.event.inputs.version_number }}.zip FreeRTOS-Plus-TCP -x "*.git*"
81+
zip -r FreeRTOS-Plus-TCP-"$VERSION_NUMBER".zip FreeRTOS-Plus-TCP -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 FreeRTOS-Plus-TCP-${{ github.event.inputs.version_number }}.zip zip-check
88+
mv FreeRTOS-Plus-TCP-"$VERSION_NUMBER".zip zip-check
7389
cd zip-check
74-
unzip FreeRTOS-Plus-TCP-${{ github.event.inputs.version_number }}.zip -d FreeRTOS-Plus-TCP-${{ github.event.inputs.version_number }}
75-
ls FreeRTOS-Plus-TCP-${{ github.event.inputs.version_number }}
76-
diff -r -x "*.git*" FreeRTOS-Plus-TCP-${{ github.event.inputs.version_number }}/FreeRTOS-Plus-TCP/ ../FreeRTOS-Plus-TCP/
90+
unzip FreeRTOS-Plus-TCP-"$VERSION_NUMBER".zip -d FreeRTOS-Plus-TCP-"$VERSION_NUMBER"
91+
ls FreeRTOS-Plus-TCP-"$VERSION_NUMBER"
92+
diff -r -x "*.git*" FreeRTOS-Plus-TCP-"$VERSION_NUMBER"/FreeRTOS-Plus-TCP/ ../FreeRTOS-Plus-TCP/
7793
cd ../
7894
- name: Build
95+
env:
96+
VERSION_NUMBER: ${{ github.event.inputs.version_number }}
7997
run: |
80-
cd zip-check/FreeRTOS-Plus-TCP-${{ github.event.inputs.version_number }}/FreeRTOS-Plus-TCP
98+
cd zip-check/FreeRTOS-Plus-TCP-"$VERSION_NUMBER"/FreeRTOS-Plus-TCP
8199
sudo apt-get install -y lcov
82100
sudo apt-get install unifdef
83101
cmake -S test/unit-test -B test/unit-test/build/
84102
make -C test/unit-test/build/ all
85103
- name: Test
104+
env:
105+
VERSION_NUMBER: ${{ github.event.inputs.version_number }}
86106
run: |
87-
cd zip-check/FreeRTOS-Plus-TCP-${{ github.event.inputs.version_number }}/FreeRTOS-Plus-TCP
107+
cd zip-check/FreeRTOS-Plus-TCP-"$VERSION_NUMBER"/FreeRTOS-Plus-TCP
88108
pushd test/unit-test/build/
89109
ctest -E system --output-on-failure
90110
popd
@@ -147,6 +167,8 @@ jobs:
147167
- name: Checkout code
148168
uses: actions/checkout@v4
149169
- name: Delete branch created for Tag by SBOM generator
170+
env:
171+
VERSION_NUMBER: ${{ github.event.inputs.version_number }}
150172
run: |
151173
# Delete the branch created for Tag by SBOM generator
152-
git push -u origin --delete refs/heads/${{ github.event.inputs.version_number }}
174+
git push -u origin --delete refs/heads/"$VERSION_NUMBER"

0 commit comments

Comments
 (0)