Skip to content

Commit 2aadcd3

Browse files
LukaswndLukaswnd
Lukaswnd
authored and
Lukaswnd
committed
fix github workflow number
1 parent 0a1223c commit 2aadcd3

File tree

3 files changed

+23
-7
lines changed

3 files changed

+23
-7
lines changed

build.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ fi
308308

309309
# Generate PlatformIO manifest file
310310
if [ "$BUILD_TYPE" = "all" ]; then
311-
python3 ./tools/gen_platformio_manifest.py -o "$TOOLS_JSON_OUT/" -s "$IDF_BRANCH" -c "$IDF_COMMIT"
311+
python3 ./tools/gen_platformio_manifest.py -o "$TOOLS_JSON_OUT/" -s "$IDF_BRANCH" -c "$IDF_COMMIT" -n "$GITHUB_RUN_NUMBER"
312312
if [ $? -ne 0 ]; then exit 1; fi
313313
fi
314314

@@ -318,7 +318,7 @@ AR_VERSION_UNDERSCORE=`echo "$AR_VERSION" | tr . _`
318318
# Generate PlatformIO framework manifest file
319319
rm -rf "$AR_ROOT/package.json"
320320
if [ "$BUILD_TYPE" = "all" ]; then
321-
python3 ./tools/gen_pio_frmwk_manifest.py -o "$AR_ROOT/" -s "v$AR_VERSION" -c "$IDF_COMMIT"
321+
python3 ./tools/gen_pio_frmwk_manifest.py -o "$AR_ROOT/" -s "v$AR_VERSION" -c "$IDF_COMMIT" -n "$GITHUB_RUN_NUMBER"
322322
if [ $? -ne 0 ]; then exit 1; fi
323323
fi
324324

tools/gen_pio_frmwk_manifest.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"repository": {
1313
"type": "git",
1414
"url": "https://github.com/lukaswnd/esp32-arduino-libs",
15-
"build-id": $GITHUB_RUN_NUMBER
15+
"build-id": "0"
1616
},
1717
}
1818

@@ -41,7 +41,7 @@ def convert_version(version_string):
4141
return ".".join((major, minor, patch))
4242

4343

44-
def main(dst_dir, version_string, commit_hash):
44+
def main(dst_dir, version_string, commit_hash, build_number):
4545

4646
converted_version = convert_version(version_string)
4747
if not converted_version:
@@ -51,6 +51,7 @@ def main(dst_dir, version_string, commit_hash):
5151
manifest_file_path = os.path.join(dst_dir, "package.json")
5252
with open(manifest_file_path, "w", encoding="utf8") as fp:
5353
MANIFEST_DATA["version"] = f"{converted_version}+sha.{commit_hash}"
54+
MANIFEST_DATA["repository"]["build-id"] = build_number
5455
json.dump(MANIFEST_DATA, fp, indent=2)
5556

5657
print(
@@ -82,6 +83,13 @@ def main(dst_dir, version_string, commit_hash):
8283
required=True,
8384
help="ESP-IDF revision in form of a commit hash",
8485
)
86+
parser.add_argument(
87+
"-n",
88+
"--build-number",
89+
dest="build_number",
90+
required=True,
91+
help="Number of Github workflow build",
92+
)
8593
args = parser.parse_args()
8694

87-
sys.exit(main(args.dst_dir, args.version_string, args.commit_hash))
95+
sys.exit(main(args.dst_dir, args.version_string, args.commit_hash, args.build_number))

tools/gen_platformio_manifest.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"repository": {
1313
"type": "git",
1414
"url": "https://github.com/lukaswnd/esp32-arduino-libs",
15-
"build-id": $GITHUB_RUN_NUMBER
15+
"build-id": "0"
1616
},
1717
}
1818

@@ -51,6 +51,7 @@ def main(dst_dir, version_string, commit_hash):
5151
manifest_file_path = os.path.join(dst_dir, "package.json")
5252
with open(manifest_file_path, "w", encoding="utf8") as fp:
5353
MANIFEST_DATA["version"] = f"{converted_version}+sha.{commit_hash}"
54+
MANIFEST_DATA["repository"]["build-id"] = build_number
5455
json.dump(MANIFEST_DATA, fp, indent=2)
5556

5657
print(
@@ -82,6 +83,13 @@ def main(dst_dir, version_string, commit_hash):
8283
required=True,
8384
help="ESP-IDF revision in form of a commit hash",
8485
)
86+
parser.add_argument(
87+
"-n",
88+
"--build-number",
89+
dest="build_number",
90+
required=True,
91+
help="Number of Github workflow build",
92+
)
8593
args = parser.parse_args()
8694

87-
sys.exit(main(args.dst_dir, args.version_string, args.commit_hash))
95+
sys.exit(main(args.dst_dir, args.version_string, args.commit_hash, args.build_number))

0 commit comments

Comments
 (0)