mirror of
https://github.com/rstrouse/ESPSomfy-RTS.git
synced 2026-11-20 15:52:12 +01:00
ci: review fixes for the release job and set_version.sh
- set_version.sh: three of its four patterns only matched digits and dots, so FW_VERSION and index.js stayed at v4.0.0.beta and index.html at ?v=3.0.14d. They now match any version, and the script fails when a file doesn't end up with the new one. test/scripts/test_set_version.sh covers it and runs with the native tests. - Release job: each build's files are collected from its own folder, with 4 files each and no name in two builds, before they're signed. The version bump is made on the release's branch as it is now, not the tag, so a merge during the builds doesn't reject the push. - Scorecard reports to code scanning only: publishing from a fork isn't supported, so no badge. - New workflows renamed to .yaml like build.yaml. SECURITY.md: the routes open in Secured mode, and which jobs can write what. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
5c57d1a2cd
commit
787cebdb18
9 changed files with 124 additions and 18 deletions
23
.github/set_version.sh
vendored
23
.github/set_version.sh
vendored
|
|
@ -1,6 +1,7 @@
|
|||
#!/usr/bin/env bash
|
||||
# Writes a release's version into the sources: bash .github/set_version.sh v4.0.1
|
||||
# The build jobs build with it, the release job commits it.
|
||||
# Tested by test/scripts/test_set_version.sh.
|
||||
set -euo pipefail
|
||||
|
||||
VERSION="${1#v}"
|
||||
|
|
@ -11,7 +12,21 @@ if [[ ! "$VERSION" =~ ^[0-9]+(\.[0-9A-Za-z-]+)*$ ]]; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
sed -i "s/#define FW_VERSION \"v[0-9.]*\"/#define FW_VERSION \"v${VERSION}\"/" src/ConfigSettings.h
|
||||
sed -i "s/^[0-9.].*/${VERSION}/" data-src/appversion
|
||||
sed -i "s/\?v=[0-9.]*c/?v=${VERSION}c/g" data-src/index.html
|
||||
sed -i "s/appVersion = 'v[0-9.]*'/appVersion = 'v${VERSION}'/" data-src/index.js
|
||||
# Each pattern matches whatever version is there now, suffixes included
|
||||
# (v4.0.0.beta, ?v=3.0.14d). The ?v= suffix letter busts the browser cache.
|
||||
sed -i "s/#define FW_VERSION \"v[^\"]*\"/#define FW_VERSION \"v${VERSION}\"/" src/ConfigSettings.h
|
||||
sed -i "s/^[0-9].*/${VERSION}/" data-src/appversion
|
||||
sed -i "s/[?]v=[0-9][0-9A-Za-z.-]*/?v=${VERSION}c/g" data-src/index.html
|
||||
sed -i "s/appVersion = 'v[^']*'/appVersion = 'v${VERSION}'/" data-src/index.js
|
||||
|
||||
# sed succeeds when nothing matches, so check each file got the version.
|
||||
check() {
|
||||
if ! grep -qF -- "$2" "$1"; then
|
||||
echo "$1 doesn't have $2: its version string changed shape" >&2
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
check src/ConfigSettings.h "#define FW_VERSION \"v${VERSION}\""
|
||||
check data-src/appversion "${VERSION}"
|
||||
check data-src/index.html "?v=${VERSION}c"
|
||||
check data-src/index.js "appVersion = 'v${VERSION}'"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue