This document describes how to create a new release of swift-ejson.
The version is managed via the VERSION file at the project root. This file is the single source of truth for the version number and is read at build time by the BuildVersionPlugin to inject the version into the CLI binary.
- Write access to the repository
- All tests passing on main branch
Edit the VERSION file to contain the new version number:
echo "1.2.3" > VERSIONFollow Semantic Versioning:
- MAJOR version: Incompatible API changes
- MINOR version: New functionality (backwards compatible)
- PATCH version: Bug fixes (backwards compatible)
git add VERSION
git commit -m "Bump version to 1.2.3"
git push origin main- Go to the Actions tab
- Select the "Release" workflow from the left sidebar
- Click "Run workflow" button
- Select the
mainbranch - Click "Run workflow"
The Release workflow will automatically:
- Validate version - Ensure VERSION > latest tag and tag doesn't exist
- Run tests - Ensure all tests pass
- Build macOS binary - Create a universal binary (x86_64 + ARM64)
- Create archive - Package the binary as
.tar.gz - Calculate checksums - Generate SHA256 checksums
- Create GitHub Release - Publish release with tag
v{VERSION} - Upload assets - Attach binaries and checksums
After the workflow completes:
- Go to https://github.com/diogot/swift-ejson/releases
- Verify the release was created with:
- Correct version tag (e.g.,
v1.2.3) - Release notes
- Binary archive (
.tar.gz) - Checksum file (
.sha256)
- Correct version tag (e.g.,
Download and test the binary:
VERSION="1.2.3"
curl -L "https://github.com/diogot/swift-ejson/releases/download/v${VERSION}/ejson-${VERSION}-macos-universal.tar.gz" | tar xz
./ejson --version
./ejson keygenVerify the checksum:
curl -L "https://github.com/diogot/swift-ejson/releases/download/v${VERSION}/ejson-${VERSION}-macos-universal.tar.gz.sha256" -o ejson.sha256
shasum -a 256 -c ejson.sha256If the release workflow fails with version validation errors:
- "Tag already exists" - The VERSION matches an existing release. Bump the version.
- "Version must be greater than latest tag" - Ensure VERSION > latest tag (e.g., 1.2.3 > 1.2.2)
If the GitHub Actions workflow fails:
- Check the Actions tab for error details
- Fix issues in a new commit/PR
- Merge to main
- Re-run the Release workflow
If automated builds fail, you can create a release manually:
# Clean previous builds
rm -rf .build release
# Run build script
./scripts/build-release.sh 1.2.3
# Verify the binary
./release/ejson --version- Create and push a tag:
git tag v1.2.3 && git push origin v1.2.3 - Go to https://github.com/diogot/swift-ejson/releases/new
- Choose the tag (v1.2.3)
- Fill in the release title and description
- Upload the files from
release/directory - Click "Publish release"