Skip to content

fix: v0.0.1-beta.8 — move Windows binaries to vendor/win32/ #9

fix: v0.0.1-beta.8 — move Windows binaries to vendor/win32/

fix: v0.0.1-beta.8 — move Windows binaries to vendor/win32/ #9

Workflow file for this run

name: Publish to npm
on:
push:
tags:
- 'v*'
workflow_dispatch:
# Lets maintainers iterate on the smoke test without bumping the version.
# The publish job is gated to skip on manual runs (see `if:` below).
jobs:
smoke-windows:
name: Windows bundle smoke test
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- run: npm ci
- run: npm run build
- name: List bundle in workspace (sanity)
shell: pwsh
run: |
Write-Host "--- contents of vendor/win32 in workspace ---"
Get-ChildItem -Force "vendor/win32" | Format-Table Name, Length -AutoSize
- name: Run bundled binaries directly from workspace (no npm install needed)
shell: pwsh
run: |
$rsync = "$env:GITHUB_WORKSPACE\vendor\win32\rsync.exe"
$busybox = "$env:GITHUB_WORKSPACE\vendor\win32\busybox.exe"
if (-not (Test-Path $rsync)) { throw "rsync.exe not in workspace bundle" }
if (-not (Test-Path $busybox)) { throw "busybox.exe not in workspace bundle" }
Write-Host "--- rsync --version ---"
& $rsync --version
if ($LASTEXITCODE -ne 0) { throw "rsync.exe failed to execute (exit $LASTEXITCODE). DLL chain is broken." }
Write-Host "--- busybox awk version ---"
& $busybox awk 'BEGIN { print "awk works" }'
if ($LASTEXITCODE -ne 0) { throw "busybox awk failed (exit $LASTEXITCODE)" }
- name: Pack
run: npm pack
shell: bash
- name: Disable Defender real-time monitoring + exclude paths
shell: pwsh
run: |
Set-MpPreference -DisableRealtimeMonitoring $true -ErrorAction SilentlyContinue
Add-MpPreference -ExclusionPath "$env:APPDATA\npm" -ErrorAction SilentlyContinue
Add-MpPreference -ExclusionPath "$env:GITHUB_WORKSPACE" -ErrorAction SilentlyContinue
Write-Host "Defender adjustments applied."
- name: Install packed tarball globally + verify
shell: pwsh
run: |
$tgz = Get-ChildItem -Path "$env:GITHUB_WORKSPACE" -Filter "instawp-cli-*.tgz" | Select-Object -First 1
if (-not $tgz) { throw "No tarball found in workspace" }
npm i -g $tgz.FullName
if ($LASTEXITCODE -ne 0) { throw "npm i -g failed" }
$cliRoot = "$env:APPDATA\npm\node_modules\@instawp\cli"
$rsync = Join-Path $cliRoot "vendor\win32\rsync.exe"
$busybox = Join-Path $cliRoot "vendor\win32\busybox.exe"
Write-Host "--- installed bundle dir listing ---"
if (Test-Path "$cliRoot\vendor\win32") {
Get-ChildItem -Force "$cliRoot\vendor\win32" | Format-Table Name, Length -AutoSize
} else {
Write-Host "WARNING: $cliRoot\vendor\win32 not present"
}
if (-not (Test-Path $rsync)) { throw "rsync.exe missing from installed package — likely AV quarantine. See listing above." }
Write-Host "--- rsync --version (from installed location) ---"
& $rsync --version
if ($LASTEXITCODE -ne 0) { throw "Installed rsync.exe failed (exit $LASTEXITCODE)" }
Write-Host "--- instawp --version ---"
instawp --version
publish:
name: Publish to npm
needs: smoke-windows
if: github.event_name == 'push'
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
registry-url: https://registry.npmjs.org
- run: npm ci
- run: npm test
- run: npm run build
- name: Publish to npm
run: npm publish --access public --tag beta
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}