99 runs-on : ubuntu-latest
1010 environment : release-check
1111 steps :
12- - name : Check For Admin Permission
12+ - name : Verify Admin Permission
1313 uses : actions-cool/check-user-permission@v2
1414 with :
1515 require : admin
1616 username : ${{ github.triggering_actor }}
1717
18- - name : Check Repository
18+ - name : Verifying Release Workflow
1919 run : |
2020 if [ "${{ vars.RUN_RELEASE_BUILDS }}" = "1" ]; then
2121 MSG="Running workflow because RUN_RELEASE_BUILDS=1"
3838 echo "${MSG}" >> "${GITHUB_STEP_SUMMARY}"
3939 fi
4040
41- - name : Check Branch
41+ - name : Verifying Branch
4242 run : |
4343 echo "Trying to run the release workflow from branch ${{ github.ref_name }}"
4444 if [ "${{ github.ref_name }}" != "main" ]; then
5050 fi
5151
5252 update-main :
53- name : Update CHANGELOG.md and linux/svtminion.sh windows/svtminion.ps1
53+ name : Prepare Files for Release
5454 runs-on : ubuntu-latest
5555 permissions :
5656 contents : write # To be able to publish the release
@@ -146,19 +146,23 @@ jobs:
146146 CUT_RELEASE_VERSION=$(cat .cut_release_version)
147147 echo "CUT_RELEASE_VERSION=${CUT_RELEASE_VERSION}" >> "$GITHUB_ENV"
148148
149- - name : Update linux/svtminion.sh sha256sum's
149+ - name : Prepare Release Artifacts
150150 run : |
151- (cd linux && sha256sum svtminion.sh > ../svtminion.sh.sha256)
152- (cd windows && sha256sum svtminion.ps1 > ../svtminion.ps1.sha256)
153- git add svtminion.sh.sha256
154- git add svtminion.ps1.sha256
155- git commit --allow-empty -am "Update sha256 checksums" || git commit --allow-empty -am "Update sha256 checksums"
151+ # Move scripts to dist directory so we don't update the source files
152+ mkdir -p dist
153+ cp linux/svtminion.sh dist/svtminion.sh
154+ cp windows/svtminion.ps1 dist/svtminion.ps1
155+ # Inject release version into artifact copies via helper script
156+ python3 .github/workflows/scripts/update-svtminion-versions.py "${CUT_RELEASE_VERSION}"
157+ # Generate checksums for the release artifacts
158+ (cd dist && sha256sum svtminion.sh > ../svtminion.sh.sha256)
159+ (cd dist && sha256sum svtminion.ps1 > ../svtminion.ps1.sha256)
156160
157- - name : Tag The ${{ needs.update-main.outputs.release-version }} Release
161+ - name : Create Tag: ${{ needs.update-main.outputs.release-version }}
158162 run : |
159163 git tag -f --no-sign -m "Release ${{ needs.update-main.outputs.release-version }}" -a ${{ needs.update-main.outputs.release-version }}
160164
161- - name : Create Github Release
165+ - name : Create GitHub Release
162166 uses : softprops/action-gh-release@v1
163167 with :
164168 name : ${{ env.CUT_RELEASE_VERSION }}
@@ -169,8 +173,8 @@ jobs:
169173 prerelease : false
170174 generate_release_notes : false
171175 files : |
172- linux /svtminion.sh
173- windows /svtminion.ps1
176+ dist /svtminion.sh
177+ dist /svtminion.ps1
174178 svtminion.sh.sha256
175179 svtminion.ps1.sha256
176180 LICENSE
@@ -182,9 +186,10 @@ jobs:
182186 failOnError : false
183187
184188 update-main-checksums :
185- name : Update Release Checksums on Main
189+ name : Update Release Checksums
186190 runs-on : ubuntu-latest
187191 needs :
192+ - update-main
188193 - publish-release
189194 environment : release
190195 permissions :
@@ -198,17 +203,6 @@ jobs:
198203 repository : ${{ github.repository }}
199204 ssh-key : ${{ secrets.SALT_VMTOOLS_RELEASE_KEY }}
200205
201- - name : Get linux/svtminion.sh on main branch sha256sum
202- run : |
203- echo "SH=$(sha256sum linux/svtminion.sh | awk '{ print $1 }')" >> "$GITHUB_ENV"
204- echo "VMTS_VERSION=$(bash linux/svtminion.sh --version | awk '{ print $1 }')" >> "$GITHUB_ENV"
205-
206- - uses : actions/checkout@v6
207- with :
208- ref : main
209- repository : ${{ github.repository }}
210- ssh-key : ${{ secrets.SALT_VMTOOLS_RELEASE_KEY }}
211-
212206 - name : Configure Git
213207 shell : bash
214208 run : |
@@ -217,9 +211,13 @@ jobs:
217211 git config --global user.email saltproject.pdl@broadcom.com
218212 git config --global commit.gpgsign false
219213
220- - name : Update Latest Release on README
214+ - name : Update Checksums in README.md
215+ shell : bash
221216 run : |
222- python3 .github/workflows/scripts/update-release-shasum.py ${{ env.VMTS_VERSION }} ${{ env.SH }}
217+ VERSION="${{ needs.update-main.outputs['release-version'] }}"
218+ curl -sL "https://github.com/${{ github.repository }}/releases/download/${VERSION}/svtminion.sh" -o svtminion.sh
219+ SH="$(sha256sum svtminion.sh | awk '{ print $1 }')"
220+ python3 .github/workflows/scripts/update-release-shasum.py "$VERSION" "$SH"
223221
224222 - name : Show Changes
225223 run : |
0 commit comments