nyron release
Create GitHub releases with auto-generated changelogs
nyron release
Create GitHub releases with auto-generated changelogs based on commits between nyron-release tags.
Usage
npx @nyron/cli releasePreview changelog without creating release
npx @nyron/cli release --dry-runSkip tag creation (use existing tag)
npx @nyron/cli release -nOptions
-d, --dry-run
Optional. Preview the changelog without creating an actual GitHub release.
npx @nyron/cli release --dry-run-n, --no-tag
Optional. Skip creating a new nyron-release tag. Use this when:
- You already created a tag with
push-tagcommand - Running in CI/CD after tag was pushed locally
- You want to use a GPG-signed tag created manually
Important: When using -n, the command fetches commits BETWEEN the previous tag and the latest tag (the one you just pushed). Without -n, it fetches commits FROM the latest tag to HEAD.
npx @nyron/cli release -nExample: Using with push-tag
# Create GPG-signed tag locally
npx @nyron/cli push-tag
# Create release without creating another tag
# This will use commits BETWEEN the previous tag and the tag you just pushed
npx @nyron/cli release -nHow It Works
The release command works by:
- Determining which tags to use - Finds the latest nyron-release tag (and previous tag if using
-nflag) - Fetching commits - Gets commits between tags (with
-n) or from latest tag to HEAD (without-n) - Parsing conventional commits - Extracts features, fixes, and other changes
- Reading version information - Loads version data from the .nyron/ directory
- Generating a changelog - Creates markdown changelog from parsed commits
- Creating a GitHub release - Publishes the release with the changelog as the description
- Creating a new nyron-release tag - Only when running without
-nflag and not in dry-run mode. This tag marks the boundary for the NEXT release.
Prerequisites
- Required: A
GITHUB_TOKENenvironment variable must be set - Required: At least one nyron-release tag must exist (created by
push-tag) - Required: Commits must follow conventional commit format
What It Does
The release command:
- Creates a GitHub release on your repository
- Uses an auto-generated changelog as the release description
- Groups commits by type (Features, Bug Fixes, Chores, etc.)
- Includes author information and commit links
- Creates a new nyron-release tag (only without
-nflag) - This tag is created AFTER the release and marks the boundary for the NEXT release, not the current one
Tag Creation Behavior
- Without
-nflag: Creates a new nyron-release tag AFTER the release is published. This tag marks where the NEXT release will start from. - With
-nflag: Does NOT create a new tag. Uses the existing tag you pushed withpush-tagcommand. - Dry-run mode: Does NOT create a tag (or release), only previews what would be created.
Examples
Create a release
npx @nyron/cli releasePreview what will be released
npx @nyron/cli release --dry-runSample output:
📍 Step 1: Finding latest release tag...
✓ Found tag: nyron-release@2024-01-15@14-30-25.123
📍 Step 2: Fetching commits since last release...
✓ Found 5 commit(s)
📍 Step 3: Parsing commits...
✓ Parsed commits into groups (features, fixes, etc.)
📍 Step 4: Reading version information...
✓ Loaded version data for 2 package(s)
📍 Step 5: Generating changelog...
✓ Changelog generated (1,234 characters)
📍 Step 6: Preview (DRY RUN - no release created)
📍 Step 7: (Skipped in dry-run mode - would create new nyron-release tag)
================================================================================
## Features
- **api**: add OAuth2 login ([@username](https://github.com/username)) [[a1b2c3d](https://github.com/owner/repo/commit/a1b2c3d)]
## Bug Fixes
- **auth**: resolve token refresh issue ([@username](https://github.com/username)) [[e4f5g6h](https://github.com/owner/repo/commit/e4f5g6h)]
================================================================================
✅ Dry run completed - no release was createdTypical Workflow
Manual Workflow
The release command is typically used as the final step:
# 1. Bump version and generate changelog
npx @nyron/cli bump --type minor --prefix v
# 2. Commit changes
git add .
git commit -m "chore: bump version to 1.2.0"
# 3. Create and push nyron-release tag
npx @nyron/cli push-tag
# 4. Create GitHub release (use -n since tag already exists)
# This creates the release and does NOT create another tag
npx @nyron/cli release -nNote: If you run release without -n after pushing a tag, it will create a duplicate tag. Always use -n when you've already pushed a tag with push-tag.
Automated Workflow (Recommended)
Alternatively, set up a GitHub Actions workflow to automatically run the release command when you push a nyron-release tag:
# 1. Bump and commit
npx @nyron/cli bump --type minor --prefix v
git add . && git commit -m "chore: bump version to 1.2.0"
# 2. Push tag (triggers automated release)
npx @nyron/cli push-tag
# ✨ The GitHub release is created automatically by CI/CD!This workflow requires a .github/workflows/release.yml file in your repository. See the automated workflow guide for setup instructions.
Error Handling
No nyron-release tag found:
Error: No nyron release tag found
→ Make sure to push the tag with nyron toolRun npx @nyron/cli push-tag first.
No commits found:
⚠️ No commits found between tags - skipping releaseThis means there are no new commits since the last release.
Missing GitHub token:
Error: GITHUB_TOKEN environment variable is requiredSet your GitHub token in a .env file or environment variable.
Next Steps
- Learn about
nyron push-tagcommand - Understand the complete workflow
- Set up GitHub repository settings