fix(ci): import build_packages via path in tests and enhance release workflow
Build and Publish Release / Build Packages and Publish (push) Successful in 16s
Build and Publish Release / Build Packages and Publish (push) Successful in 16s
This commit is contained in:
1 parent
8921c2da13
commit
0bc914ac8a
2 files changed
+10
-3
No files matched your search
@@ -82,7 +82,7 @@ jobs:
|
|||||||
# 1. Fetch release ID or create release if missing
|
# 1. Fetch release ID or create release if missing
|
||||||
REL_JSON=$(curl -k -s -H "Authorization: token ${GITHUB_TOKEN}" \
|
REL_JSON=$(curl -k -s -H "Authorization: token ${GITHUB_TOKEN}" \
|
||||||
"${SERVER_URL}/api/v1/repos/${REPO}/releases/tags/${TAG}")
|
"${SERVER_URL}/api/v1/repos/${REPO}/releases/tags/${TAG}")
|
||||||
REL_ID=$(python3 -c "import sys, json; data=json.loads(sys.argv[1]); print(data.get('id', ''))" "$REL_JSON")
|
REL_ID=$(python3 -c "import sys, json; data=json.loads(sys.argv[1]); print(data.get('id', ''))" "$REL_JSON" 2>/dev/null || true)
|
||||||
|
|
||||||
if [ -z "$REL_ID" ]; then
|
if [ -z "$REL_ID" ]; then
|
||||||
echo "Release $TAG does not exist yet. Creating release..."
|
echo "Release $TAG does not exist yet. Creating release..."
|
||||||
@@ -92,7 +92,8 @@ jobs:
|
|||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
-d "$CREATE_DATA" \
|
-d "$CREATE_DATA" \
|
||||||
"${SERVER_URL}/api/v1/repos/${REPO}/releases")
|
"${SERVER_URL}/api/v1/repos/${REPO}/releases")
|
||||||
REL_ID=$(python3 -c "import sys, json; data=json.loads(sys.argv[1]); print(data.get('id', ''))" "$CREATE_RESP")
|
REL_ID=$(python3 -c "import sys, json; data=json.loads(sys.argv[1]); print(data.get('id', ''))" "$CREATE_RESP" 2>/dev/null || true)
|
||||||
|
echo "Create release response: $CREATE_RESP"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Release ID: $REL_ID"
|
echo "Release ID: $REL_ID"
|
||||||
|
|||||||
@@ -4,8 +4,14 @@ import tempfile
|
|||||||
import unittest
|
import unittest
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
from packaging.build_packages import PackageBuilder
|
import importlib.util
|
||||||
|
|
||||||
|
_root_dir = Path(__file__).resolve().parent.parent
|
||||||
|
_pkg_script = _root_dir / "packaging" / "build_packages.py"
|
||||||
|
_spec = importlib.util.spec_from_file_location("build_packages", str(_pkg_script))
|
||||||
|
_module = importlib.util.module_from_spec(_spec)
|
||||||
|
_spec.loader.exec_module(_module)
|
||||||
|
PackageBuilder = _module.PackageBuilder
|
||||||
|
|
||||||
class TestPackaging(unittest.TestCase):
|
class TestPackaging(unittest.TestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
|
|||||||
Reference in new issue
Block a user