Skip to content

Commit 9c2e956

Browse files
committed
feat: enhance CI/CD workflow and improve packaging script for better release management
1 parent 440afe7 commit 9c2e956

File tree

3 files changed

+18
-5
lines changed

3 files changed

+18
-5
lines changed

.github/workflows/CICD.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -404,11 +404,13 @@ jobs:
404404
run: pip install -r ./tests/requirements.txt
405405

406406
- name: Package nightly build
407-
run: python ./scripts/dist-pack.py
407+
run: python ./scripts/dist-pack.py --branch dev --mode release
408408

409-
- name: Get current date
409+
- name: Get git commit date
410410
id: date
411-
run: echo "date=$(date +'%Y%m%d')" >> $GITHUB_OUTPUT
411+
run: |
412+
git fetch --unshallow || true
413+
echo "date=$(git log -1 --format=%cd --date=format:%Y%m%d%H%M)" >> $GITHUB_OUTPUT
412414
shell: bash
413415

414416
- name: Create GitHub Release

crates/web/src/handlers/nodes.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ use axum::{
77
http::{HeaderMap, StatusCode},
88
response::{Html, IntoResponse, Json},
99
};
10+
use edgelink_core::runtime::paths;
1011
use serde_json::Value;
1112
use std::collections::HashMap;
1213

@@ -81,7 +82,7 @@ pub async fn get_nodes(
8182
/// Generate HTML config for all nodes
8283
async fn generate_nodes_html() -> String {
8384
// Dynamically generate node HTML at runtime - read and merge all HTML files under Node-RED node directory
84-
let node_red_nodes_dir = std::path::PathBuf::from("3rd-party/node-red/packages/node_modules/@node-red/nodes");
85+
let node_red_nodes_dir = paths::ui_static_dir().join("nodes");
8586

8687
if !node_red_nodes_dir.exists() {
8788
return get_fallback_nodes_html();

scripts/dist-pack.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,16 @@
77
import tempfile
88
from datetime import datetime
99
from pathlib import Path
10+
1011
import zipfile
1112

13+
EXCLUDE_PREFIXES = [
14+
"libedgelink_pymod.so",
15+
"libedgelink_macro.so",
16+
"edgelink_pymod.dll",
17+
"edgelink_macro.dll"
18+
]
19+
1220
try:
1321
import tomlkit
1422
except ImportError:
@@ -117,6 +125,8 @@ def main():
117125
for f in target_dir.glob("edgelinkd.exe"):
118126
shutil.copy(f, bin_dir / f.name)
119127
for dll in target_dir.glob("*.dll"):
128+
if any(dll.name.startswith(prefix) for prefix in EXCLUDE_PREFIXES):
129+
continue
120130
shutil.copy(dll, bin_dir / dll.name)
121131

122132
# 5. bin/ui_static
@@ -138,7 +148,7 @@ def main():
138148
outdir.mkdir(parents=True, exist_ok=True)
139149
archive_path = outdir / out_name
140150
if out_name.endswith(".zip"):
141-
with zipfile.ZipFile(archive_path, "w", zipfile.ZIP_DEFLATED) as zf:
151+
with zipfile.ZipFile(archive_path, "w", zipfile.ZIP_DEFLATED, compresslevel=9) as zf:
142152
for path in tmp.rglob("*"):
143153
print(f"Adding to archive: {path.relative_to(tmp)}", file=sys.stderr)
144154
zf.write(path, path.relative_to(tmp))

0 commit comments

Comments
 (0)