release: bygg pkg med --no-bytecode (cross-arch utan QEMU) + idempotent asset-upload
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -39,8 +39,10 @@ jobs:
|
||||
cp deploy/client-build/package.json "$B/package.json"
|
||||
cd "$B"
|
||||
npm install --ignore-scripts --no-audit --no-fund @homebridge/node-pty-prebuilt-multiarch@0.13.1 @yao-pkg/pkg@6.20.0
|
||||
./node_modules/.bin/pkg daemon.cjs --targets node22-linux-x64 --output out/agent-helm-linux-x64
|
||||
./node_modules/.bin/pkg daemon.cjs --targets node22-linux-arm64 --output out/agent-helm-linux-arm64
|
||||
# --no-bytecode: skeppa JS-källa i st.f. arch-specifik V8-bytecode, så att
|
||||
# BÅDA arkitekturerna kan cross-byggas på samma (arm64) runner utan QEMU.
|
||||
./node_modules/.bin/pkg daemon.cjs --no-bytecode --public --public-packages '*' --targets node22-linux-x64 --output out/agent-helm-linux-x64
|
||||
./node_modules/.bin/pkg daemon.cjs --no-bytecode --public --public-packages '*' --targets node22-linux-arm64 --output out/agent-helm-linux-arm64
|
||||
cp "$GITHUB_WORKSPACE/install.sh" out/install.sh
|
||||
cd out && sha256sum agent-helm-linux-* install.sh > checksums.txt && ls -la
|
||||
|
||||
@@ -53,10 +55,15 @@ jobs:
|
||||
run: |
|
||||
B=/tmp/clientbuild/out
|
||||
BODY="agent-helm klient $TAG — sjalvstandiga binarer (linux x64/arm64). Installera: curl -fsSL https://gitea.brasse-pc.eu/brasse/agent-helm/raw/branch/main/install.sh | sh"
|
||||
rid=$(curl -s -X POST "$API/repos/$REPO/releases" -H "Authorization: token $TOKEN" -H 'Content-Type: application/json' -d "{\"tag_name\":\"$TAG\",\"name\":\"$TAG\",\"body\":\"$BODY\"}" | grep -o '"id":[0-9]*' | head -1 | cut -d: -f2)
|
||||
if [ -z "$rid" ]; then rid=$(curl -s "$API/repos/$REPO/releases/tags/$TAG" -H "Authorization: token $TOKEN" | grep -o '"id":[0-9]*' | head -1 | cut -d: -f2); fi
|
||||
rid=$(curl -s -X POST "$API/repos/$REPO/releases" -H "Authorization: token $TOKEN" -H 'Content-Type: application/json' -d "{\"tag_name\":\"$TAG\",\"name\":\"$TAG\",\"body\":\"$BODY\"}" | jq -r '.id // empty')
|
||||
[ -z "$rid" ] && rid=$(curl -s "$API/repos/$REPO/releases/tags/$TAG" -H "Authorization: token $TOKEN" | jq -r '.id')
|
||||
echo "release id: $rid"
|
||||
for f in agent-helm-linux-x64 agent-helm-linux-arm64 install.sh checksums.txt; do
|
||||
aid=$(curl -s "$API/repos/$REPO/releases/$rid/assets" -H "Authorization: token $TOKEN" | jq -r ".[] | select(.name==\"$f\") | .id")
|
||||
if [ -n "$aid" ] && [ "$aid" != "null" ]; then
|
||||
echo "ersätter befintlig $f (id $aid)"
|
||||
curl -s -X DELETE "$API/repos/$REPO/releases/$rid/assets/$aid" -H "Authorization: token $TOKEN" -o /dev/null
|
||||
fi
|
||||
echo "laddar upp $f ..."
|
||||
curl -s -X POST "$API/repos/$REPO/releases/$rid/assets?name=$f" -H "Authorization: token $TOKEN" -F "attachment=@$B/$f" -o /dev/null -w " -> HTTP %{http_code}\n"
|
||||
done
|
||||
|
||||
Reference in New Issue
Block a user