Skip to content

Update main.yml

Update main.yml #4

Workflow file for this run

name: Build Acode Plugin
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: "npm"
- name: Install dependencies
run: npm install
- name: Run build script
run: npm run build
# ---------- Debug / Verify artifacts ----------
- name: Show workspace and find any zip files (debug)
run: |
echo "PWD: $(pwd)"
echo "List top-level files:"
ls -la
echo "Find any zip files (full list):"
find . -type f -name "*.zip" -print || true
# ---------- Collect zip into single predictable folder ----------
- name: Collect ZIP artifact(s)
run: |
mkdir -p .artifacts
# find first zip and copy it (copy all zips if you prefer)
FOUND=0
while IFS= read -r file; do
echo "Copying zip: $file"
cp "$file" .artifacts/ || true
FOUND=1
done < <(find . -type f -name "*.zip" -print)
if [ "$FOUND" -eq 0 ]; then
echo "No zip files found to copy."
fi
echo "Contents of .artifacts:"
ls -la .artifacts || true
- name: Upload plugin artifact
uses: actions/upload-artifact@v4
with:
name: acode-plugin
path: .artifacts/*.zip