Testing Hacksmith releases
Testing releases prevents broken releases and gives you confidence before publishing Hacksmith to users.
Quick start
Section titled “Quick start”Test locally first before publishing releases. Local testing catches most issues quickly without affecting users.
# Build all binaries for your platformpnpm build:binaries
# Test the binary works./dist/binaries/hacksmith-darwin-arm64 --helpRelease process overview
Section titled “Release process overview”Hacksmith releases involve three main steps:
- Publish npm package - Makes
npx hacksmithwork for users - Build standalone binaries - Creates executables for direct download
- Upload to GitHub Releases - Provides download links for users
Why test first? Broken releases waste user time and damage trust. Testing catches issues before users encounter them.
Testing methods
Section titled “Testing methods”Choose the testing approach that matches your needs:
Method 1: Local binary testing (fastest)
Section titled “Method 1: Local binary testing (fastest)”Build and test binaries on your local machine. Use this method first - it catches 90% of issues quickly.
Build all platform binaries:
# Build binaries for all supported platformspnpm build:binaries
# See what was createdls -lh dist/binaries/Expected files:
hacksmith-darwin-arm64(Apple Silicon Macs)hacksmith-darwin-x64(Intel Macs)hacksmith-linux-x64(Linux computers)hacksmith-linux-arm64(Raspberry Pi, ARM Linux)hacksmith-windows-x64.exe(Windows computers)
Test your platform’s binary:
# macOS Apple Silicon./dist/binaries/hacksmith-darwin-arm64 --help
# macOS Intel./dist/binaries/hacksmith-darwin-x64 --help
# Linux./dist/binaries/hacksmith-linux-x64 --help
# Windows./dist/binaries/hacksmith-windows-x64.exe --helpWhat to check:
- Binary runs without errors
- Help text displays correctly
- Version number matches your expectations
Method 2: Individual platform testing (for development)
Section titled “Method 2: Individual platform testing (for development)”Test compilation for a single platform during development. Use this when iterating quickly on specific platforms.
Build for your current platform:
cd packages/hacksmith
# Compile a test binarybun build ./src/run.ts --compile --outfile hacksmith-test
# Test basic functionality./hacksmith-test --help
# Test with a real blueprint./hacksmith-test plan -b https://github.com/saif-shines/hacksmith-blueprints/blob/main/example.blueprint.tomlWhen to use this method:
- Quick development iteration - Faster than building all platforms
- Platform-specific debugging - Test one platform at a time
- Build troubleshooting - Isolate compilation issues
Method 3: Full workflow testing with act (comprehensive)
Section titled “Method 3: Full workflow testing with act (comprehensive)”Test the complete GitHub Actions workflow locally using act. Use this for complete testing before pushing to production.
Install act first:
# macOS - using Homebrewbrew install act
# Linux - using install scriptcurl https://raw.githubusercontent.com/nektos/act/master/install.sh | sudo bash
# Windows - using Chocolateychoco install act-cliSet up authentication:
Create a .secrets file in your repository root (add this file to .gitignore):
NPM_PUBLISH_KEY=your_npm_token_hereHACKSMITH_GITHUB_TOKEN=your_github_token_hereRun workflow tests:
# Test the complete release workflowact push --secret-file .secrets
# Test only binary buildingact push --secret-file .secrets -j build-binaries
# Test only npm publishingact push --secret-file .secrets -j publish-npmTrade-offs of using act:
- Requires Docker - Must have Docker installed and running
- Large storage - Downloads ~20GB Docker images for all platforms
- Slower - Takes longer than local testing
- Environment differences - May not exactly match GitHub’s setup
Method 4: Pre-release testing (production-like)
Section titled “Method 4: Pre-release testing (production-like)”Test releases in a production-like environment before making them public. Use this for final validation before releasing to all users.
Create a test release:
# Create a test version tag (use -test or -rc suffix)git tag v0.0.7-testgit push origin v0.0.7-testMonitor the release process:
Watch the GitHub Actions workflow run at:
https://github.com/saif-shines/hacksmith/actionsClean up after testing:
# Remove the test tag locallygit tag -d v0.0.7-test
# Remove the test tag from GitHubgit push origin :refs/tags/v0.0.7-testRemove the test release from GitHub:
- Visit
https://github.com/YOUR_USERNAME/hacksmith/releases - Find your test release
- Click “Delete” at the bottom of the page
Fix common problems
Section titled “Fix common problems”Build failures
Section titled “Build failures”Problem: bun: command not found when building binaries.
Solution: Install Bun runtime:
curl -fsSL https://bun.sh/install | bashProblem: Binary shows Permission denied when trying to run.
Solution: Make the binary executable:
chmod +x ./dist/binaries/hacksmith-darwin-arm64Problem: GitHub Actions workflow fails during release.
Common causes:
- Missing required secrets (
NPM_PUBLISH_KEY,HACKSMITH_GITHUB_TOKEN) - NPM token lacks publish permissions
- GitHub token needs
contents: writepermission
Fix secrets:
- Go to
https://github.com/YOUR_USERNAME/hacksmith/settings/secrets/actions - Verify both secrets exist and are correct
- Regenerate tokens if needed (ensure proper permissions)
Binary size concerns
Section titled “Binary size concerns”Problem: Binaries seem too large (~50MB per platform).
Why this happens: Bun binaries include:
- The Bun runtime (~40MB)
- Your compiled Hacksmith code
- All project dependencies
Size reduction options:
- Remove unused dependencies from
package.json - Use tree-shaking compatible imports
- Consider compression for distribution (binaries are already optimized)
Release best practices
Section titled “Release best practices”Before releasing
Section titled “Before releasing”Test locally first - Always build and test binaries before pushing tags:
- Build binaries: Run
pnpm build:binariesand verify all files created - Test functionality: Run binary with
--helpand sample blueprints - Check versions: Ensure
package.jsonversion matches your intended release - Review changes: Use
git diffto verify all intended changes included
During release
Section titled “During release”Monitor and document the release process:
- Use semantic versioning: Follow
vX.Y.Zformat (e.g.,v1.2.3) - Write release notes: Document changes in GitHub Release description
- Watch workflow: Monitor GitHub Actions progress in real-time
- Verify installation: Test the install script works after release
After releasing
Section titled “After releasing”Verify everything works for end users:
- Check npm package: Run
npm view hacksmith versionto confirm publication - Test install script: Run the curl command on a fresh machine
- Update documentation: Add new features to docs and help text
- Announce release: Update README, website, and social channels
Release checklist
Section titled “Release checklist”Use this checklist to ensure nothing gets missed:
Pre-release:
- Build binaries locally with
pnpm build:binaries - Test compiled binary with sample blueprints
- Verify version in
package.jsonmatches intended release - Review all changes with
git diff - Update CHANGELOG.md with new features
Release:
- Create and push git tag:
git tag vX.Y.Z && git push origin vX.Y.Z - Monitor GitHub Actions workflow progress
- Verify npm package published correctly
- Verify GitHub Release created with all binaries
- Test install script works:
curl -fsSL ... | bash
Post-release:
- Update documentation with new features
- Announce release in relevant channels
- Monitor for any immediate user issues