@@ -26,31 +26,43 @@ jobs:
2626 const owner = context.repo.owner;
2727 const repo = context.repo.repo;
2828
29- // Find default branch and its HEAD
29+ // Get default branch info
3030 const repoInfo = await github.rest.repos.get({ owner, repo });
3131 const defaultBranch = repoInfo.data.default_branch;
32- const head = await github.rest.repos.getBranch({ owner, repo, branch: defaultBranch });
32+
33+ const head = await github.rest.repos.getBranch({
34+ owner,
35+ repo,
36+ branch: defaultBranch
37+ });
38+
3339 const headSha = head.data.commit.sha;
34- const shortSha = headSha.slice(0,7);
40+ const shortSha = headSha.slice(0, 7);
3541
36- // Try get the existing nightly release (single static tag)
37- let nightlyRelease = null;
38- try {
39- nightlyRelease = await github.rest.repos.getReleaseByTag({
40- owner, repo, tag: 'nightly'
41- });
42- } catch (e) {
43- if (e.status !== 404) throw e;
42+ // List releases and find the most recent "<sha>_nightly"
43+ const releases = await github.rest.repos.listReleases({
44+ owner,
45+ repo,
46+ per_page: 50
47+ });
48+
49+ let latestNightlySha = null;
50+
51+ for (const rel of releases.data) {
52+ const name = rel.name || "";
53+
54+ const match = name.match(/^([0-9a-f]{7})_nightly$/i);
55+ if (match) {
56+ latestNightlySha = match[1];
57+ break; // releases are returned newest-first
58+ }
4459 }
4560
46- // Decide if we need to rebuild: compare short SHA in the release name
47- // Name format we set: "<shortsha>_nightly"
4861 let shouldBuild = true;
49- if (nightlyRelease) {
50- const name = nightlyRelease.data.name || '';
51- const m = name.match(/^([0-9a-f]{7})_nightly$/i);
52- if (m && m[1] === shortSha) {
53- shouldBuild = false; // no new commits since last nightly
62+
63+ if (latestNightlySha) {
64+ if (latestNightlySha === shortSha) {
65+ shouldBuild = false;
5466 }
5567 }
5668
6274 compile_sketch :
6375 name : build ${{ matrix.board.name }}
6476 runs-on : ubuntu-latest
77+ needs : decide
78+ if : ${{ needs.decide.outputs.should_build == 'true' }}
6579 strategy :
6680 fail-fast : false
6781 matrix :
8195 - { name: "Marauder v7", flag: "MARAUDER_V7", fbqn: "esp32:esp32:d32:PartitionScheme=min_spiffs", file_name: "marauder_v7", tft: true, tft_file: "User_Setup_dual_nrf24.h", build_dir: "d32", addr: "0x1000", idf_ver: "3.3.4", nimble_ver: "master", esp_async: "bigbrodude6119/ESPAsyncWebServer", esp_async_ver: "master" }
8296 - { name: "Marauder CYD 2432S028", flag: "MARAUDER_CYD_MICRO", fbqn: "esp32:esp32:d32:PartitionScheme=min_spiffs", file_name: "cyd_2432S028", tft: true, tft_file: "User_Setup_cyd_micro.h", build_dir: "d32", addr: "0x1000", idf_ver: "2.0.11", nimble_ver: "1.3.8", esp_async: "bigbrodude6119/ESPAsyncWebServer", esp_async_ver: "master" }
8397 - { name: "Marauder CYD 2432S024 GUITION", flag: "MARAUDER_CYD_GUITION", fbqn: "esp32:esp32:d32:PartitionScheme=min_spiffs", file_name: "cyd_2432S024_guition", tft: true, tft_file: "User_Setup_cyd_guition.h", build_dir: "d32", addr: "0x1000", idf_ver: "2.0.11", nimble_ver: "1.3.8", esp_async: "bigbrodude6119/ESPAsyncWebServer", esp_async_ver: "master" }
84- - { name: "Marauder CYD 2432S028 2 USB", flag: "MARAUDER_CYD_2USB", fbqn: "esp32:esp32:d32:PartitionScheme=min_spiffs", file_name: "cyd_2432S028_2usb", tft: true, tft_file: "User_Setup_cyd_2usb.h", build_dir: "d32", addr: "0x1000", idf_ver: "2.0.11 ", nimble_ver: "1.3.8", esp_async: "bigbrodude6119/ESPAsyncWebServer", esp_async_ver: "master" }
98+ - { name: "Marauder CYD 2432S028 2 USB", flag: "MARAUDER_CYD_2USB", fbqn: "esp32:esp32:d32:PartitionScheme=min_spiffs", file_name: "cyd_2432S028_2usb", tft: true, tft_file: "User_Setup_cyd_2usb.h", build_dir: "d32", addr: "0x1000", idf_ver: "3.3.4 ", nimble_ver: "master", esp_async: "bigbrodude6119/ESPAsyncWebServer", esp_async_ver: "master" }
8599 - { name: "Marauder CYD 3.5inch", flag: "MARAUDER_CYD_3_5_INCH", fbqn: "esp32:esp32:d32:PartitionScheme=min_spiffs", file_name: "cyd_3_5_inch", tft: true, tft_file: "User_Setup_cyd_3_5_inch.h", build_dir: "d32", addr: "0x1000", idf_ver: "2.0.11", nimble_ver: "1.3.8", esp_async: "bigbrodude6119/ESPAsyncWebServer", esp_async_ver: "master" }
86100 - { name: "M5Cardputer", flag: "MARAUDER_CARDPUTER", fbqn: "esp32:esp32:esp32s3:PartitionScheme=min_spiffs,FlashSize=8M,PSRAM=disabled", file_name: "m5cardputer", tft: true, tft_file: "User_Setup_marauder_m5cardputer.h", build_dir: "esp32s3", addr: "0x1000", idf_ver: "2.0.11", nimble_ver: "1.3.8", esp_async: "bigbrodude6119/ESPAsyncWebServer", esp_async_ver: "master" }
87101 - { name: "ESP32-C5-DevKitC-1", flag: "MARAUDER_C5", fbqn: "esp32:esp32:esp32c5:FlashSize=8M,PartitionScheme=min_spiffs,PSRAM=enabled", file_name: "esp32c5devkitc1", tft: false, tft_file: "", build_dir: "esp32c5", addr: "0x2000", idf_ver: "3.3.4", nimble_ver: "master", esp_async: "bigbrodude6119/ESPAsyncWebServer", esp_async_ver: "master" }
0 commit comments