-
-
Notifications
You must be signed in to change notification settings - Fork 0
Add tests and typecheck step #116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
a6d00a8
057721c
a192932
db61662
2ea1dd3
3a800da
74ceca1
25a0da5
97d38f3
92bcae2
2c27f6c
81c1e43
5b7289e
2f1d53b
00a4ff5
4c1af00
9855bc8
2b8b3a5
2f04c2d
6b324b4
e99ae5c
69f52c5
f5f62f5
1f9e423
438d71f
301abe5
d93dded
235b4bc
0bcab79
272b33f
3c54903
9f385bf
f30ae20
70e4c4a
d159065
56adf31
00cae7e
7781e91
97aca40
72daad1
62d4fb9
eb90396
7f472c0
7024fc4
a492c4e
ecd2610
3a1e4f8
da2be3f
726e0f1
dc6986a
f99dc56
d1c5e26
84ed9c4
0d0a5e2
121c6ed
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| FILES=$(find . -type d \( -name "target" -o -name "node_modules" -o -name "dist" -o -name "generated" \) -prune -o -type f \( -name "*.ts" -o -name "*.rs" \) -print) | ||
|
|
||
| if [ -z "$FILES" ]; then | ||
| echo "There are no files to check." | ||
| exit 0 | ||
| fi | ||
|
|
||
| MISSING_COPYRIGHT=$(echo "$FILES" | xargs grep -L "Copyright") | ||
| if [ -n "$MISSING_COPYRIGHT" ]; then | ||
| echo "This file needs a Copyright header:" | ||
| echo "$MISSING_COPYRIGHT" | ||
| exit 1 | ||
| fi | ||
|
|
||
| JUNK_CHECK=$(echo "$FILES" | xargs awk 'FNR==1 && /^\/\/ [A-Za-z0-9_-]+\.(ts|rs)$/ {print FILENAME}') | ||
| if [ -n "$JUNK_CHECK" ]; then | ||
| echo "The first line is just the file name (Junk):" | ||
| echo "$JUNK_CHECK" | ||
| exit 1 | ||
| fi |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| git config user.name "github-actions[bot]" | ||
| git config user.email "github-actions[bot]@users.noreply.github.com" | ||
|
|
||
| git add Cargo.toml | ||
| [ -f "package.json" ] && git add package.json | ||
|
|
||
| if ! git diff --cached --quiet; then | ||
| git commit -m "chore: nightly release ${{ steps.versioning.outputs.version_clean }}" | ||
| git tag ${{ steps.versioning.outputs.version_tag }} | ||
| git push origin main --tags | ||
| else | ||
| echo "No file changes, skip push." | ||
| fi |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| PREV_TAG=$(git describe --tags --abbrev=0 --exclude="${{ steps.versioning.outputs.version_tag }}" 2>/dev/null || echo "") | ||
|
|
||
| LOGS=$(git log $PREV_TAG..HEAD --pretty=format:"%s") | ||
|
|
||
| FEAT=$(echo "$LOGS" | grep -E "^feat(\(.*\))?: " | sed -E 's/^feat(\(.*\))?: /- /' || echo "") | ||
| FIX=$(echo "$LOGS" | grep -E "^fix(\(.*\))?: " | sed -E 's/^fix(\(.*\))?: /- /' || echo "") | ||
|
|
||
| COMPARE_LINK="https://github.com/${{ github.repository }}/compare/${PREV_TAG}...${{ steps.versioning.outputs.version_tag }}" | ||
|
|
||
| { | ||
| echo "## What's Changed" | ||
| echo "Compare: $COMPARE_LINK" | ||
| echo "" | ||
|
|
||
| if [ -n "$FEAT" ]; then | ||
| echo "### Features" | ||
| echo "$FEAT" | ||
| echo "" | ||
| fi | ||
|
|
||
| if [ -n "$FIX" ]; then | ||
| echo "### Fixes" | ||
| echo "$FIX" | ||
| echo "" | ||
| fi | ||
|
|
||
| if [ -z "$FEAT" ] && [ -z "$FIX" ]; then | ||
| echo "_No significant changes in this build._" | ||
| echo "" | ||
| fi | ||
|
|
||
| echo "***Nightly Owl has fallen out of bed tonight!***" | ||
| } > release_notes.md | ||
|
|
||
| gh release create "${{ steps.versioning.outputs.version_tag }}" \ | ||
| --title "Nightly Build ${{ steps.versioning.outputs.version_tag }}" \ | ||
| --notes-file release_notes.md \ | ||
| --prerelease |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| PREV_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "") | ||
|
|
||
| if [ -n "$PREV_TAG" ]; then | ||
| LOGS=$(git log $PREV_TAG..HEAD --pretty=format:"%s") | ||
| else | ||
| LOGS=$(git log --pretty=format:"%s") | ||
| fi | ||
|
|
||
| HAS_SIGNIFICANT=$(echo "$LOGS" | grep -E "^(feat|fix)(\(.*\))?:" || echo "") | ||
|
|
||
| if [ -n "$HAS_SIGNIFICANT" ]; then | ||
| echo "significant=true" >> $GITHUB_OUTPUT | ||
| echo "There are significant changes, continue!" | ||
| else | ||
| echo "significant=false" >> $GITHUB_OUTPUT | ||
| echo "No feat/fix, skip build." | ||
| fi |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| RAW_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "0.0.0") | ||
|
|
||
| CLEAN_VERSION=${RAW_TAG#v} | ||
|
|
||
| BASE_VERSION=${CLEAN_VERSION%-nightly.*} | ||
|
|
||
| COMMIT_HASH=$(git rev-parse --short HEAD) | ||
| DATE=$(date +'%Y%m%d') # Format: 20260625 | ||
|
|
||
| VERSION_CLEAN="${BASE_VERSION}-nightly.${DATE}.${COMMIT_HASH}" | ||
| VERSION_TAG="v${VERSION_CLEAN}" | ||
|
|
||
| echo "version_clean=$VERSION_CLEAN" >> $GITHUB_OUTPUT | ||
| echo "version_tag=$VERSION_TAG" >> $GITHUB_OUTPUT | ||
| echo "Generated version: $VERSION_CLEAN (Tag: $VERSION_TAG)" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| TODAY=$(date -u +'%Y-%m-%d') | ||
|
|
||
| RUNS=$(gh run list --workflow production.yml --limit 1 --json createdAt --jq '.[0].createdAt') | ||
|
|
||
| if [[ "$RUNS" == "$TODAY"* ]]; then | ||
| echo "Production is underway today: $RUNS" | ||
| echo "should_skip=true" >> $GITHUB_OUTPUT | ||
| else | ||
| echo "Production has not started today." | ||
| echo "should_skip=false" >> $GITHUB_OUTPUT | ||
| fi |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| VERSION="${{ steps.versioning.outputs.version_clean }}" | ||
|
|
||
| sed -i "s/^version = \".*\"/version = \"$VERSION\"/" Cargo.toml | ||
|
|
||
| if [ -f "package.json" ]; then | ||
| jq --arg ver "$VERSION" '.version = $ver' package.json > temp.json && mv temp.json package.json | ||
| fi | ||
|
|
||
| rustup toolchain install stable --profile minimal | ||
| cargo update |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| VERSION="${{ github.event.inputs.version }}" | ||
| git config user.name "github-actions[bot]" | ||
| git config user.email "github-actions[bot]@users.noreply.github.com" | ||
|
|
||
| git tag "v$VERSION" | ||
| git push origin "v$VERSION" | ||
|
|
||
| gh release create "v$VERSION" \ | ||
| --title "Release $VERSION" \ | ||
| --notes-file release_notes.md |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| VERSION="${{ github.event.inputs.version }}" | ||
|
|
||
| LAST_STABLE=$(git tag --sort=-creatordate | grep -v "nightly" | head -n 1 || echo "") | ||
|
|
||
| NIGHTLIES=$(git tag | grep "nightly" | sort -V) | ||
|
|
||
| if [ -n "$LAST_STABLE" ]; then | ||
| FINAL_NIGHTLIES=$(echo -e "$NIGHTLIES\n$LAST_STABLE" | sort -V | sed -n "/$LAST_STABLE/,\$p" | grep -v "$LAST_STABLE") | ||
| else | ||
| FINAL_NIGHTLIES="$NIGHTLIES" | ||
| fi | ||
|
|
||
| { | ||
| echo "Release based on Changelogs:" | ||
| if [ -n "$FINAL_NIGHTLIES" ]; then | ||
| echo "$FINAL_NIGHTLIES" | sed 's/^/* /' | ||
| else | ||
| echo "* No previous nightly builds." | ||
| fi | ||
| echo "" | ||
| echo "***Lion Owl caught in apple net!***" | ||
| } > release_notes.md | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| VERSION="$1" | ||
|
claycuy marked this conversation as resolved.
|
||
| if [ -z "$VERSION" ]; then | ||
| echo "Error: Version argument is required." | ||
| exit 1 | ||
| fi | ||
| if git rev-parse "refs/tags/v$VERSION" >/dev/null 2>&1; then | ||
| echo "Error: Versi $VERSION sudah ada tag-nya! Ganti versi dulu." | ||
| exit 1 | ||
| fi | ||
|
|
||
| FILE_VERSION=$(jq -r .version package.json) | ||
| if [ "$FILE_VERSION" != "$VERSION" ]; then | ||
| echo "Error: Versi di package.json ($FILE_VERSION) tidak sama dengan input ($VERSION)." | ||
| exit 1 | ||
| fi | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| if [[ "$PLATFORM" == *"android"* ]]; then | ||
| cargo build --release --target $TARGET | ||
| elif [[ "$PLATFORM" == *"musl"* ]]; then | ||
| if [ ! -f "./cross" ]; then | ||
| curl -L https://github.com/cross-rs/cross/releases/latest/download/cross-x86_64-unknown-linux-musl.tar.gz | tar xz | ||
| chmod +x cross | ||
| fi | ||
| RUSTFLAGS="-C target-feature=-crt-static" ./cross build --release --target $TARGET | ||
| else | ||
| if [ ! -f "./cross" ]; then | ||
| curl -L https://github.com/cross-rs/cross/releases/latest/download/cross-x86_64-unknown-linux-musl.tar.gz | tar xz | ||
| chmod +x cross | ||
| fi | ||
| ./cross build --release --target $TARGET | ||
| fi |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| if [[ "${{ github.event.inputs.version_override }}" == *"nightly"* ]]; then | ||
| cargo publish --token ${{ secrets.CRATES_IO_TOKEN }} --allow-dirty --no-verify | ||
| else | ||
| cargo publish --token ${{ secrets.CRATES_IO_TOKEN }} --allow-dirty | ||
| fi | ||
|
Comment on lines
+1
to
+5
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🔴 Critical | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
printf '\n== files ==\n'
git ls-files '.github/scripts/publish/publish_crates.sh' '.github/workflows/*' | sed 's#^`#-` #'
printf '\n== publish_crates.sh ==\n'
cat -n .github/scripts/publish/publish_crates.sh
printf '\n== workflow references ==\n'
rg -n '\.github/scripts/publish/publish_crates\.sh|version_override|CRATES_IO_TOKEN|cargo publish' .github/workflows .github/scripts -SRepository: soteenstudio/lightvm Length of output: 1899 🏁 Script executed: #!/bin/bash
set -euo pipefail
# Map the script and any calling workflow files more precisely.
for f in $(git ls-files '.github/scripts/publish/publish_crates.sh' '.github/workflows/*'); do
echo "== $f =="
wc -l "$f"
done
echo
ast-grep outline .github/scripts/publish/publish_crates.sh --view expanded || trueRepository: soteenstudio/lightvm Length of output: 1002 🏁 Script executed: #!/bin/bash
set -euo pipefail
printf '== .github/workflows/publish.yml (around the publish step) ==\n'
sed -n '180,220p' .github/workflows/publish.yml | cat -n
printf '\n== neighboring publish helper scripts ==\n'
for f in .github/scripts/publish/publish_npm.sh .github/scripts/publish/sync_assets_version.sh; do
echo "--- $f ---"
cat -n "$f"
doneRepository: soteenstudio/lightvm Length of output: 7276 Pass the override and token through 🧰 Tools🪛 Shellcheck (0.11.0)[error] 1-1: Parameter expansions can't start with {. Double check syntax. (SC2296) [info] 2-2: Double quote to prevent globbing and word splitting. (SC2086) [error] 2-2: Parameter expansions can't start with {. Double check syntax. (SC2296) [warning] 2-2: This } is literal. Check expression (missing ;/\n?) or quote it. (SC1083) [info] 4-4: Double quote to prevent globbing and word splitting. (SC2086) [error] 4-4: Parameter expansions can't start with {. Double check syntax. (SC2296) [warning] 4-4: This } is literal. Check expression (missing ;/\n?) or quote it. (SC1083) 🤖 Prompt for AI AgentsSource: Linters/SAST tools |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,132 @@ | ||
| VERSION="${{ github.event.inputs.version_override }}" | ||
| if [ -z "$VERSION" ]; then | ||
| RAW_VERSION="${{ github.event.release.tag_name }}" | ||
| VERSION=${RAW_VERSION#v} | ||
|
Comment on lines
+1
to
+4
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🔴 Critical | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
printf '--- .github/scripts/publish/publish_npm.sh (first 160 lines) ---\n'
nl -ba .github/scripts/publish/publish_npm.sh | sed -n '1,160p'
printf '\n--- workflow references to publish_npm.sh ---\n'
rg -n "publish_npm\.sh|version_override|github\.event_name|github\.event\.release\.tag_name|github\.event\.inputs\.version_override" .github -SRepository: soteenstudio/lightvm Length of output: 249 🏁 Script executed: #!/bin/bash
set -euo pipefail
printf -- '--- .github/scripts/publish/publish_npm.sh (first 160 lines) ---\n'
nl -ba .github/scripts/publish/publish_npm.sh | sed -n '1,160p'
printf -- '\n--- workflow references to publish_npm.sh ---\n'
rg -n "publish_npm\.sh|version_override|github\.event_name|github\.event\.release\.tag_name|github\.event\.inputs\.version_override" .github -SRepository: soteenstudio/lightvm Length of output: 263 🏁 Script executed: #!/bin/bash
set -euo pipefail
printf -- '--- .github/scripts/publish/publish_npm.sh (first 160 lines) ---\n'
sed -n '1,160p' .github/scripts/publish/publish_npm.sh
printf -- '\n--- workflow references to publish_npm.sh ---\n'
rg -n "publish_npm\.sh|version_override|github\.event_name|github\.event\.release\.tag_name|github\.event\.inputs\.version_override" .github -S
printf -- '\n--- workflow files mentioning publish or npm ---\n'
rg -n "npm|publish" .github/workflows -SRepository: soteenstudio/lightvm Length of output: 9391 Move GitHub Actions expressions out of the shell script
🧰 Tools🪛 Shellcheck (0.11.0)[error] 1-1: Parameter expansions can't start with {. Double check syntax. (SC2296) [error] 3-3: Parameter expansions can't start with {. Double check syntax. (SC2296) 🤖 Prompt for AI AgentsSource: Linters/SAST tools |
||
| fi | ||
|
|
||
| if [ -z "$VERSION" ]; then | ||
| echo "Fetch latest release tag from GitHub API..." | ||
| LATEST_TAG=$(gh release view --json tagName --template '{{.tagName}}' 2>/dev/null || echo "") | ||
| if [ -n "$LATEST_TAG" ]; then | ||
| VERSION=${LATEST_TAG#v} | ||
| echo "Successfully resolved latest release version: $VERSION" | ||
| else | ||
| echo "No release found via API. Falling back to Cargo.toml..." | ||
| VERSION=$(grep '^version =' Cargo.toml | head -n1 | cut -d '"' -f2) | ||
| fi | ||
| fi | ||
|
|
||
| echo "Final Publishing Version: $VERSION" | ||
|
|
||
| TAG="latest" | ||
| if [[ "$VERSION" =~ -(proto|alpha|beta|rc) ]]; then TAG="next"; fi | ||
| echo "Using NPM Tag: $TAG" | ||
|
Comment on lines
+21
to
+23
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
file=".github/scripts/publish/publish_npm.sh"
echo "== file outline =="
wc -l "$file"
echo
echo "== relevant lines =="
nl -ba "$file" | sed -n '1,140p'
echo
echo "== search for prerelease/tag handling =="
rg -n "proto|alpha|beta|rc|nightly|npm publish|TAG=" "$file"Repository: soteenstudio/lightvm Length of output: 283 🏁 Script executed: #!/bin/bash
set -euo pipefail
file=".github/scripts/publish/publish_npm.sh"
echo "== lines 1-40 =="
sed -n '1,40p' "$file" | cat -n
echo
echo "== lines 40-120 =="
sed -n '40,120p' "$file" | cat -n
echo
echo "== lines 120-131 =="
sed -n '120,131p' "$file" | cat -n
echo
echo "== prerelease-related matches =="
rg -n "proto|alpha|beta|rc|nightly|npm publish|TAG=" "$file"Repository: soteenstudio/lightvm Length of output: 6311 Treat 🤖 Prompt for AI Agents |
||
|
|
||
| PLATFORMS=( | ||
| "binary-linux-x64|linux-x64|index.linux.node|x64" | ||
| "binary-linux-arm64|linux-arm64|index.linux-arm64.node|arm64" | ||
| "binary-linux-ia32|linux-ia32|index.linux32.node|ia32" | ||
| "binary-win32-x64|win32-x64|index.win.node|x64" | ||
| "binary-win32-ia32|win32-ia32|index.win32.node|ia32" | ||
| "binary-darwin-x64|darwin-x64|index.darwin.node|x64" | ||
| "binary-android-arm64|android-arm64|index.android.node|arm64" | ||
| "binary-android-arm|android-arm|index.android32.node|arm" | ||
| "binary-linux-musl-x64|linux-musl-x64|index.musl-x64.node|x64" | ||
| "binary-linux-musl-arm64|linux-musl-arm64|index.musl-arm64.node|arm64" | ||
| "binary-linux-musl-ia32|linux-musl-ia32|index.musl-ia32.node|ia32" | ||
| "binary-freebsd-x64|freebsd-x64|index.freebsd.node|x64" | ||
| "binary-browser-wasm|browser-wasm|index.wasm|wasm" | ||
| ) | ||
|
|
||
| sudo apt-get install -y jq | ||
|
|
||
| for item in "${PLATFORMS[@]}"; do | ||
| IFS="|" read -r ARTIFACT PLATFORM BIN_NAME CPU <<< "$item" | ||
| PKG_NAME="@lightvm/core-$PLATFORM" | ||
| OS_VAL="${PLATFORM%-*}" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
# Map the relevant script and surrounding package metadata.
git ls-files .github/scripts/publish .github/scripts/publish/publish_npm.sh package.json .npmrc .github/workflows || true
echo '--- publish_npm.sh (outline if available) ---'
if command -v ast-grep >/dev/null 2>&1; then
ast-grep outline .github/scripts/publish/publish_npm.sh --view expanded || true
fi
echo '--- publish_npm.sh lines 1-220 ---'
nl -ba .github/scripts/publish/publish_npm.sh | sed -n '1,220p'
echo '--- search for PLATFORM / OS_VAL / libc / musl / wasm ---'
rg -n 'PLATFORM|OS_VAL|libc|musl|wasm|process\.platform|os:' .github/scripts/publish .github/workflows package.json .npmrc || trueRepository: soteenstudio/lightvm Length of output: 854 🏁 Script executed: #!/bin/bash
set -euo pipefail
# Inspect package manifest conventions for optional dependencies and platform tags.
rg -n '"os"|\"libc\"|optionalDependencies|cpu|os|libc' --glob 'package*.json' --glob '*.json' .Repository: soteenstudio/lightvm Length of output: 276 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo '--- publish_npm.sh ---'
sed -n '1,220p' .github/scripts/publish/publish_npm.sh | cat -n
echo '--- relevant search ---'
rg -n 'PLATFORM|OS_VAL|LIBC|libc|musl|wasm|os:|cpu:|optionalDependencies|process\.platform' .github/scripts/publish .github/workflows package.json .
echo '--- package manifests ---'
git ls-files '**/package.json' '**/package-lock.json' '**/npm-shrinkwrap.json' '**/pnpm-lock.yaml' '**/yarn.lock' | sed -n '1,200p'Repository: soteenstudio/lightvm Length of output: 21551 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo '--- publish_npm.sh (focused) ---'
sed -n '1,140p' .github/scripts/publish/publish_npm.sh | cat -n
echo '--- search platform tag names in repo ---'
rg -n 'linux-musl|browser-wasm|darwin|linux|win32|process\.platform|libc' .github/scripts .github/workflows package.json .Repository: soteenstudio/lightvm Length of output: 17569 🏁 Script executed: #!/bin/bash
set -euo pipefail
# Read the publish script with line numbers and find platform/package naming conventions.
sed -n '1,220p' .github/scripts/publish/publish_npm.sh | cat -n
echo '--- platform-specific package metadata ---'
rg -n --fixed-strings 'linux-musl' .
rg -n --fixed-strings 'browser-wasm' .
rg -n --fixed-strings '"os"' .
rg -n --fixed-strings '"libc"' .
rg -n --fixed-strings '"cpu"' .Repository: soteenstudio/lightvm Length of output: 8521 🏁 Script executed: #!/bin/bash
set -euo pipefail
# Focus on the publish script and any package manifests that declare os/libc/cpu.
sed -n '1,180p' .github/scripts/publish/publish_npm.sh | cat -n
echo '--- package.json ---'
sed -n '1,240p' package.json | cat -n
echo '--- files mentioning os/libc/cpu in package manifests ---'
find . -name package.json -o -name package-lock.json -o -name npm-shrinkwrap.json | while read -r f; do
if rg -n --fixed-strings '"os"' "$f" >/dev/null || rg -n --fixed-strings '"libc"' "$f" >/dev/null || rg -n --fixed-strings '"cpu"' "$f" >/dev/null; then
echo "### $f"
rg -n --fixed-strings '"os"' "$f" || true
rg -n --fixed-strings '"libc"' "$f" || true
rg -n --fixed-strings '"cpu"' "$f" || true
fi
doneRepository: soteenstudio/lightvm Length of output: 10467 🏁 Script executed: #!/bin/bash
set -euo pipefail
# Show the exact publish_npm.sh content and any JSON package fields relevant to optional dependency filtering.
sed -n '1,220p' .github/scripts/publish/publish_npm.sh | cat -n
echo '--- manifest field search ---'
python3 - <<'PY'
from pathlib import Path
import json
for path in Path('.').rglob('package.json'):
try:
data = json.loads(path.read_text())
except Exception:
continue
fields = {k: data.get(k) for k in ('name', 'version', 'os', 'cpu', 'libc', 'optionalDependencies') if k in data}
if fields:
print(f'### {path}')
for k, v in fields.items():
print(k, '=>', v)
PYRepository: soteenstudio/lightvm Length of output: 32259 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo '--- publish_npm.sh around line 46 ---'
sed -n '1,90p' .github/scripts/publish/publish_npm.sh | cat -n
echo '--- package manifests with os/libc/cpu fields ---'
python3 - <<'PY'
from pathlib import Path
import json
for path in Path('.').rglob('package.json'):
try:
data = json.loads(path.read_text())
except Exception:
continue
keys = [k for k in ('os', 'cpu', 'libc', 'optionalDependencies', 'name') if k in data]
if keys:
print(f'### {path}')
for k in keys:
print(f'{k}: {data[k]}')
PYRepository: soteenstudio/lightvm Length of output: 24933 Use valid platform filters for these packages 🤖 Prompt for AI Agents |
||
| mkdir -p "publish/$PLATFORM" | ||
|
|
||
| if [[ "$PLATFORM" == "browser-wasm" ]]; then | ||
| echo "=== Isi dari binaries/$ARTIFACT ===" | ||
| ls -la "binaries/$ARTIFACT" | ||
|
|
||
| cp -r "binaries/$ARTIFACT"/. "publish/$PLATFORM/" | ||
|
|
||
| cd "publish/$PLATFORM" | ||
|
|
||
| WASM_JS_FILE=$(find . -maxdepth 1 -name "*.js" ! -name "index.js" | head -n 1) | ||
| if [ -n "$WASM_JS_FILE" ]; then | ||
| mv "$WASM_JS_FILE" "index.js" | ||
| fi | ||
|
|
||
| WASM_BG_FILE=$(find . -maxdepth 1 -name "*_bg.wasm" | head -n 1) | ||
| if [ -n "$WASM_BG_FILE" ]; then | ||
| mv "$WASM_BG_FILE" "index.wasm" | ||
| fi | ||
|
|
||
| cd ../.. | ||
|
|
||
| MAIN_FIELD="index.js" | ||
| FILES_FIELD=$(jq -nc '["index.wasm", "index.js", "*.d.ts", "README.md", "LICENSE"]') | ||
| else | ||
| find "binaries/$ARTIFACT" -type f \( -name "*.node" -o -name "*.dll" -o -name "*.so" -o -name "*.dylib" \) -exec cp {} "publish/$PLATFORM/$BIN_NAME" \; | ||
| MAIN_FIELD="$BIN_NAME" | ||
| FILES_FIELD=$(jq -nc --arg bin "$BIN_NAME" '[$bin, "README.md", "LICENSE"]') | ||
| fi | ||
|
|
||
| cp -f README.md "publish/$PLATFORM/" || true | ||
| cp -f LICENSE "publish/$PLATFORM/" || true | ||
|
|
||
| jq -n \ | ||
| --arg name "$PKG_NAME" \ | ||
| --arg ver "$VERSION" \ | ||
| --arg os "$OS_VAL" \ | ||
| --arg cpu "$CPU" \ | ||
| --arg main "$MAIN_FIELD" \ | ||
| --argjson files "$FILES_FIELD" \ | ||
| '{ | ||
| name: $name, | ||
| version: $ver, | ||
| os: [$os], | ||
| cpu: [$cpu], | ||
| main: $main, | ||
| files: $files, | ||
| publishConfig: { access: "public" }, | ||
| license: "Apache-2.0" | ||
| }' > "publish/$PLATFORM/package.json" | ||
|
|
||
| cd "publish/$PLATFORM" | ||
|
|
||
| if [[ "${{ github.event_name }}" == "release" ]] || [[ "${{ github.event_name }}" == "workflow_dispatch" && "$VERSION" == *"nightly"* ]]; then | ||
| echo "Event Rilisan/Nightly Terdeteksi: Menjalankan Real Publish ke NPM..." | ||
| npm publish --tag $TAG --access public || echo "Skip existing" | ||
| else | ||
| echo "Event Manual (Non-Nightly) Terdeteksi: Menjalankan Dry-Run (NPM Pack)..." | ||
| npm pack | ||
| mkdir -p ../../dist-test | ||
| mv *.tgz ../../dist-test/ | ||
| fi | ||
|
|
||
| cd ../.. | ||
| done | ||
|
|
||
| if [[ "${{ github.event_name }}" == "release" || "${{ github.event_name }}" == "workflow_dispatch" ]]; then | ||
| jq --arg ver "$VERSION" \ | ||
| '.version = $ver | .optionalDependencies = { | ||
| "@lightvm/core-linux-x64": $ver, | ||
| "@lightvm/core-linux-arm64": $ver, | ||
| "@lightvm/core-linux-ia32": $ver, | ||
| "@lightvm/core-win32-x64": $ver, | ||
| "@lightvm/core-win32-ia32": $ver, | ||
| "@lightvm/core-darwin-x64": $ver, | ||
| "@lightvm/core-android-arm64": $ver, | ||
| "@lightvm/core-android-arm": $ver, | ||
| "@lightvm/core-linux-musl-x64": $ver, | ||
| "@lightvm/core-linux-musl-arm64": $ver, | ||
| "@lightvm/core-linux-musl-ia32": $ver, | ||
| "@lightvm/core-freebsd-x64": $ver, | ||
| "@lightvm/core-browser-wasm": $ver | ||
| }' package.json > temp.json && mv temp.json package.json | ||
|
|
||
| npm publish --access public --tag $TAG | ||
| fi | ||
Uh oh!
There was an error while loading. Please reload this page.