Problem: Workflow used Node.js 18, but dependencies require Node.js 20+
semantic-releaserequires Node >= 20.8.1@octokit/*packages require Node >= 20
Fix:
- Updated
.github/workflows/release.ymlto use Node 20 - Updated
package.jsonengines to require Node >= 20 - Updated
core/package.jsonengines to require Node >= 20
Problem: @rollup/rollup-linux-x64-gnu was being installed on macOS/Windows causing platform mismatch errors
Fix:
- Added
--omit=optionalflag when installing main package dependencies - This prevents platform-specific optional dependencies from causing issues
Problem: Docker containers didn't have the napi command available
Fix:
- Changed build commands to install dependencies first:
npm install - Use
npx napiinstead of justnapito use the local installation - Moved
@napi-rs/clifrom devDependencies to dependencies incore/package.json
Problem: Build commands referenced --package-json-path ../package.json incorrectly
Fix:
- Removed the
--package-json-pathflag - NAPI-RS now uses the
package.jsonin thecore/directory directly
Fix:
- Added
set -eto docker build scripts to fail fast on errors - Added
npm installstep before building in each platform - Fixed path navigation in publish step
-
.github/workflows/release.yml- Updated Node version: 18 → 20
- Fixed build commands to install dependencies
- Changed
napitonpx napi - Removed incorrect
--package-json-pathflag - Added
--omit=optionalto main package install - Fixed publish loop path navigation
-
package.json- Updated engines:
node: ">=20.0.0"
- Updated engines:
-
core/package.json- Updated engines:
node: ">= 20" - Moved
@napi-rs/clifrom devDependencies to dependencies - Added
prepublish:artifactsscript
- Updated engines:
git add .github/workflows/release.yml package.json core/package.json
git commit -m "fix: update release workflow for cross-platform builds"
git push origin master# Delete local tag
git tag -d v0.10.0
# Delete remote tag
git push origin :refs/tags/v0.10.0# Ensure versions are updated
npm version patch # or minor/major
# Update core version to match
cd core
npm version patch
cd ..
# Update optionalDependencies versions in package.json manually
# Commit version bumps
git add package.json core/package.json package-lock.json
git commit -m "chore: bump version to 0.10.1"
git push origin master
# Create and push new tag
git tag v0.10.1
git push origin v0.10.1- Go to: https://github.com/dali-benothmen/cronflow/actions
- Watch the "Release" workflow
- All 7 platform builds should now succeed
- Platform packages will be published to
@cronflow/* - Main package will be published as
cronflow
-
✅ Build Stages (parallel, ~10-15 min each):
- Build x86_64-apple-darwin
- Build aarch64-apple-darwin
- Build x86_64-pc-windows-msvc
- Build aarch64-pc-windows-msvc
- Build x86_64-unknown-linux-gnu
- Build x86_64-unknown-linux-musl
- Build aarch64-unknown-linux-gnu
-
✅ Publish Stage (~5 min):
- Download all artifacts
- Generate platform packages
- Publish 7 platform packages to
@cronflow/* - Build main package
- Publish main package to
cronflow
# Test on Windows
npm install cronflow
npm list @cronflow/win32-x64-msvc
# Test workflow execution
node -e "const {cronflow} = require('cronflow'); cronflow.start().then(r => console.log('Success:', r))"Should no longer return undefined! ✅
If builds still fail:
- Check Node version in logs: Should show v20.x.x
- Check napi installation: Should show
npm installrunning in core/ - Check artifact upload: Should find
*.nodefiles - Check npm token: Verify
NPM_TOKENsecret is set correctly
- ✅ Uses correct Node.js version (20)
- ✅ Installs dependencies in Docker containers
- ✅ Uses npx to run locally-installed napi
- ✅ Avoids platform-specific dependency conflicts
- ✅ Properly navigates paths during publishing
- ✅ Fails fast with
set -ein bash scripts