22
22
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
23
23
steps :
24
24
- name : Checkout code
25
- uses : actions/checkout@v2
25
+ uses : actions/checkout@v4
26
26
- name : Check if tag exists
27
27
run : |
28
28
git fetch origin
@@ -49,35 +49,47 @@ jobs:
49
49
runs-on : ubuntu-latest
50
50
steps :
51
51
- name : Checkout code
52
- uses : actions/checkout@v2
52
+ uses : actions/checkout@v4
53
53
with :
54
54
ref : ${{ github.event.inputs.commit_id }}
55
55
- name : Configure git identity
56
+ env :
57
+ ACTOR : ${{ github.actor }}
56
58
run : |
57
- git config --global user.name ${{ github.actor }}
58
- git config --global user.email ${{ github.actor }} @users.noreply.github.com
59
+ git config --global user.name "$ACTOR"
60
+ git config --global user.email "$ACTOR" @users.noreply.github.com
59
61
- name : create a new branch that references commit id
60
- run : git checkout -b ${{ github.event.inputs.version_number }} ${{ github.event.inputs.commit_id }}
62
+ env :
63
+ VERSION_NUMBER : ${{ github.event.inputs.version_number }}
64
+ COMMIT_ID : ${{ github.event.inputs.commit_id }}
65
+ run : git checkout -b "$VERSION_NUMBER" "$COMMIT_ID"
61
66
- name : Generate SBOM
62
67
uses : FreeRTOS/CI-CD-Github-Actions/sbom-generator@main
63
68
with :
64
69
repo_path : ./
65
70
source_path : ./source
66
71
- name : commit SBOM file
72
+ env :
73
+ VERSION_NUMBER : ${{ github.event.inputs.version_number }}
67
74
run : |
68
75
git add .
69
76
git commit -m 'Update SBOM'
70
- git push -u origin ${{ github.event.inputs.version_number }}
77
+ git push -u origin "$VERSION_NUMBER"
71
78
- name : Tag Commit and Push to remote
79
+ env :
80
+ VERSION_NUMBER : ${{ github.event.inputs.version_number }}
72
81
run : |
73
- git tag ${{ github.event.inputs.version_number }} -a -m "coreMQTT-Agent Library ${{ github.event.inputs.version_number }} "
82
+ git tag "$VERSION_NUMBER" -a -m "coreMQTT-Agent Library $VERSION_NUMBER "
74
83
git push origin --tags
75
84
- name : Verify tag on remote
85
+ env :
86
+ VERSION_NUMBER : ${{ github.event.inputs.version_number }}
87
+ COMMIT_ID : ${{ github.event.inputs.commit_id }}
76
88
run : |
77
- git tag -d ${{ github.event.inputs.version_number }}
89
+ git tag -d "$VERSION_NUMBER"
78
90
git remote update
79
- git checkout tags/${{ github.event.inputs.version_number }}
80
- git diff ${{ github.event.inputs.commit_id }} tags/${{ github.event.inputs.version_number }}
91
+ git checkout tags/"$VERSION_NUMBER"
92
+ git diff "$COMMIT_ID" tags/"$VERSION_NUMBER"
81
93
create-zip :
82
94
if : ${{ ( github.event.inputs.delete_existing_tag_release == 'true' && success() ) || ( github.event.inputs.delete_existing_tag_release == 'false' && always() ) }}
83
95
needs : tag-commit
87
99
- name : Install ZIP tools
88
100
run : sudo apt-get install zip unzip
89
101
- name : Checkout code
90
- uses : actions/checkout@v2
102
+ uses : actions/checkout@v4
91
103
with :
92
104
ref : ${{ github.event.inputs.commit_id }}
93
105
path : coreMQTT-Agent
@@ -125,7 +137,7 @@ jobs:
125
137
ctest -E system --output-on-failure
126
138
cd ..
127
139
- name : Create artifact of ZIP
128
- uses : actions/upload-artifact@v2
140
+ uses : actions/upload-artifact@v4
129
141
with :
130
142
name : coreMQTT-Agent-${{ github.event.inputs.version_number }}.zip
131
143
path : zip-check/coreMQTT-Agent-${{ github.event.inputs.version_number }}.zip
@@ -172,7 +184,7 @@ jobs:
172
184
draft : false
173
185
prerelease : false
174
186
- name : Download ZIP artifact
175
- uses : actions/download-artifact@v2
187
+ uses : actions/download-artifact@v4
176
188
with :
177
189
name : coreMQTT-Agent-${{ github.event.inputs.version_number }}.zip
178
190
- name : Upload Release Asset
0 commit comments