All nRF52 images: platform 10.12.0, toolchain and every library pinned
Changelog: All nRF52 images build on a pinned platform (nordicnrf52 10.12.0, as the masts and the bench) and exact library versions from platformio.lock, so a build no longer depends on the day it ran Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
77f4af1bbb
commit
03d17d8863
6 files changed
+794
-55
No files matched your search
@@ -36,10 +36,26 @@
|
||||
#
|
||||
# dry_run: the same build anywhere (the private repo too), no release -- the
|
||||
# result goes up as a workflow artifact. Delta bases always come from the
|
||||
# public repo's releases.
|
||||
# public repo's releases. A pull request that changes a dependency pin
|
||||
# (platformio.ini, platformio.lock -- Renovate's) runs as a dry run too, and is
|
||||
# what Renovate waits for before it merges.
|
||||
#
|
||||
# Libraries come from platformio.lock (tools/pio_lock.py): installed before
|
||||
# each env's first build, and the build fails when anything else resolved.
|
||||
# Platform and toolchain are pinned in platformio.ini. With every input
|
||||
# pinned, ~/.platformio and .pio/libdeps are cached under a key of the pin
|
||||
# files: the same pins, the same packages.
|
||||
name: pub-release
|
||||
|
||||
"on":
|
||||
pull_request:
|
||||
branches: [main]
|
||||
paths:
|
||||
- "platformio.ini"
|
||||
- "platformio.lock"
|
||||
- "variants/**/platformio.ini"
|
||||
- ".github/workflows/pub-release.yml"
|
||||
- ".github/fw-flags.sh"
|
||||
push:
|
||||
branches: [main]
|
||||
paths-ignore:
|
||||
@@ -99,8 +115,12 @@ env:
|
||||
|
||||
jobs:
|
||||
release:
|
||||
if: github.repository == 'tth-pub/meshcore-tth' || github.event.inputs.dry_run == 'true'
|
||||
if: >-
|
||||
github.repository == 'tth-pub/meshcore-tth' || github.event.inputs.dry_run == 'true'
|
||||
|| github.event_name == 'pull_request'
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
DRY: ${{ github.event.inputs.dry_run == 'true' || github.event_name == 'pull_request' }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
@@ -112,7 +132,6 @@ jobs:
|
||||
env:
|
||||
TOKEN: ${{ secrets.GITEA_TOKEN || github.token }}
|
||||
REPLACE: ${{ github.event.inputs.replace }}
|
||||
DRY: ${{ github.event.inputs.dry_run }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
git fetch -q --tags
|
||||
@@ -160,6 +179,16 @@ jobs:
|
||||
echo "title=$title"
|
||||
} >>"$GITHUB_OUTPUT"
|
||||
|
||||
# every input is pinned (see the header): the key is the pin files
|
||||
- name: PlatformIO packages and locked libraries
|
||||
uses: actions/cache@v5
|
||||
with:
|
||||
path: |
|
||||
~/.platformio/platforms
|
||||
~/.platformio/packages
|
||||
.pio/libdeps
|
||||
key: pub-pio-${{ hashFiles('platformio.ini', 'variants/**/platformio.ini', 'platformio.lock') }}
|
||||
|
||||
- name: Setup Build Environment
|
||||
uses: ./.github/actions/setup-build-environment
|
||||
|
||||
@@ -169,7 +198,6 @@ jobs:
|
||||
TAG: ${{ steps.src.outputs.tag }}
|
||||
OTA_SIGNING_KEY: ${{ secrets.OTA_SIGNING_KEY }}
|
||||
TOKEN: ${{ secrets.GITEA_TOKEN || github.token }}
|
||||
DRY: ${{ github.event.inputs.dry_run }}
|
||||
BASES_REPO: ${{ github.event.inputs.bases_repo }}
|
||||
ONLY: ${{ github.event.inputs.only }}
|
||||
run: |
|
||||
@@ -289,21 +317,29 @@ jobs:
|
||||
if name[4:] in want and name.startswith("env:") and key not in seen:
|
||||
seen.add(key)
|
||||
print(name[4:])' "$envs")
|
||||
install() { pio pkg install -e "${1#install-}"; }
|
||||
# deps <env>: the locked libraries first, then whatever lib_deps still
|
||||
# miss (platform, toolchain, git/file pins), then the lock check --
|
||||
# once per env: the flock keeps its other flag sets waiting
|
||||
locks="$RUNNER_TEMP/locks"
|
||||
mkdir -p "$locks"
|
||||
deps() {
|
||||
flock "$locks/$1" sh -c "python3 tools/pio_lock.py install -e '$1' && pio pkg install -e '$1' -s &&
|
||||
python3 tools/pio_lock.py check -e '$1'"
|
||||
}
|
||||
install() { deps "${1#install-}"; }
|
||||
t0=$SECONDS
|
||||
for env in "${first[@]}"; do par install "install-$env"; done
|
||||
report "install" "${first[@]/#/install-}"
|
||||
echo "installed ${#first[@]} platforms in $((SECONDS - t0)) s"
|
||||
# 2) compile, each artifact into its own build dir (one env comes in
|
||||
# up to four flag sets). An env's libraries come with its first
|
||||
# build, into its own .pio/libdeps/<env>, while other envs compile:
|
||||
# the lock keeps its other flag sets from installing them at once.
|
||||
locks="$RUNNER_TEMP/locks"
|
||||
mkdir -p "$locks"
|
||||
# build (deps), into its own .pio/libdeps/<env>, while other envs
|
||||
# compile; the check fails the build when anything is not exactly
|
||||
# platformio.lock.
|
||||
compile() {
|
||||
local env flags suffix variant
|
||||
IFS='|' read -r env flags suffix variant <<<"${spec[$1]}"
|
||||
flock "$locks/$env" pio pkg install -e "$env" || return 1
|
||||
deps "$env" || return 1
|
||||
export FW_OTA_VARIANT=$variant PLATFORMIO_BUILD_DIR="$bdir/$1" PLATFORMIO_BUILD_FLAGS="$PUB_FLAGS $flags"
|
||||
pio run -j "$PIO_JOBS" -e "$env" || return 1
|
||||
[ -f "$bdir/$1/$env/firmware.zip" ] || pio run -j "$PIO_JOBS" -t mergebin -e "$env" # ESP32
|
||||
@@ -351,14 +387,14 @@ jobs:
|
||||
echo "version=${version:-tth-$sha}" >>"$GITHUB_OUTPUT"
|
||||
|
||||
- name: Dry run artifact
|
||||
if: github.event.inputs.dry_run == 'true'
|
||||
if: env.DRY == 'true'
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: pub-release-dry-run
|
||||
path: dist/
|
||||
|
||||
- name: Release
|
||||
if: github.event.inputs.dry_run != 'true'
|
||||
if: env.DRY != 'true'
|
||||
env:
|
||||
TOKEN: ${{ secrets.GITEA_TOKEN || github.token }}
|
||||
SHA: ${{ steps.src.outputs.sha }}
|
||||
|
||||
Reference in new issue
Block a user