@@ -65,12 +65,26 @@ jobs:
65
65
id : dts-ver
66
66
shell : bash
67
67
run : |
68
- DTS_VER=v`cat meta-dts/meta-dts-distro/conf/distro/dts-distro.conf | grep DISTRO_VERSION | tr -d "\" [A-Z]_="`
69
- echo "DTS_VER=${DTS_VER}" >> $GITHUB_OUTPUT
68
+ # Extract tag version from GITHUB_REF
69
+ TAG=${GITHUB_REF#refs/tags/}
70
+ DTS_VER=$(echo "${TAG}" | sed -E 's/^v//')
71
+ echo "DTS_VER=${DTS_VER}" >> $GITHUB_ENV
72
+ - name : Validate DTS_VER
73
+ if : ${{ success() }}
74
+ shell : bash
75
+ run : |
76
+ # Retrieve DTS_VER from previous step
77
+ DTS_VER_EXPECTED="${{ env.DTS_VER }}"
78
+ DTS_VER_ACTUAL=$(cat meta-dts/meta-dts-distro/conf/distro/dts-distro.conf | grep DISTRO_VERSION | tr -d "\" [A-Z]_=")
79
+
80
+ if [ "${DTS_VER_EXPECTED}" != "${DTS_VER_ACTUAL}" ]; then
81
+ echo "Tag (${DTS_VER_EXPECTED}) does not match version (${DTS_VER_ACTUAL}) in `meta-dts/meta-dts-distro/conf/distro/dts-distro.conf`"
82
+ exit 1
83
+ fi
70
84
- name : Deploy DTS on boot.dasharo.com
71
85
shell : bash
72
86
run : |
73
- DTS_VER="${{steps.dts-ver.outputs. DTS_VER}}"
87
+ DTS_VER="${{ env. DTS_VER }}"
74
88
ssh -i ~/.ssh/dts-ci-key builder@10.1.40.2 "mkdir -p boot/dts/${DTS_VER}"
75
89
cd build/tmp/deploy/images/genericx86-64/
76
90
cp bzImage bzImage-${DTS_VER}
86
100
- name : Deploy sha256 on boot.dasharo.com
87
101
shell : bash
88
102
run : |
89
- DTS_VER="${{steps.dts-ver.outputs. DTS_VER}}"
103
+ DTS_VER="${{ env. DTS_VER }}"
90
104
cd build/tmp/deploy/images/genericx86-64/
91
105
sha256sum bzImage-${DTS_VER} > bzImage-${DTS_VER}.sha256
92
106
sha256sum dts-base-image-${DTS_VER}.cpio.gz > dts-base-image-${DTS_VER}.cpio.gz.sha256
@@ -101,12 +115,12 @@ jobs:
101
115
- name : Update iPXE menu
102
116
shell : bash
103
117
run : |
104
- ./meta-dts/scripts/generate-ipxe-menu.sh ${{steps.dts-ver.outputs. DTS_VER}}
118
+ ./meta-dts/scripts/generate-ipxe-menu.sh DTS_VER=" ${{ env. DTS_VER }}"
105
119
scp -i ~/.ssh/dts-ci-key dts-rc.ipxe builder@10.1.40.2:boot/dts/
106
120
- name : Trigger signing
107
121
shell : bash
108
122
run : |
109
- DTS_VER="${{steps.dts-ver.outputs. DTS_VER}}"
123
+ DTS_VER="${{ env. DTS_VER }}"
110
124
git clone ssh://git@git.3mdeb.com:2222/3mdeb/dts-release-cicd-pipeline.git
111
125
cd dts-release-cicd-pipeline
112
126
echo ${DTS_VER} > LATEST_RELEASE
0 commit comments