github.com/jasoet/gopki@v1.15.0/.github/workflows/README.md (about) 1 # GitHub Actions Workflows 2 3 ## Semantic Release Workflow 4 5 The `semantic.yml` workflow automatically creates version tags and GitHub releases based on conventional commits. 6 7 ### How it works 8 9 1. **Triggers on**: 10 - Push to `main` branch 11 - Manual workflow dispatch 12 13 2. **What it does**: 14 - Analyzes commit messages following [Conventional Commits](https://www.conventionalcommits.org/) 15 - Determines the next version number (major.minor.patch) 16 - Creates a git tag with the new version 17 - Generates release notes from commit messages 18 - Creates a GitHub release 19 - Updates CHANGELOG.md 20 21 3. **Version bumping rules**: 22 - `feat:` commits trigger a minor version bump (e.g., 1.0.0 → 1.1.0) 23 - `fix:` commits trigger a patch version bump (e.g., 1.0.0 → 1.0.1) 24 - `BREAKING CHANGE:` in commit body triggers a major version bump (e.g., 1.0.0 → 2.0.0) 25 - Other commit types (`docs:`, `style:`, `refactor:`, `test:`, `chore:`) don't trigger releases 26 27 ### Commit message examples 28 29 ```bash 30 # Minor version bump (new feature) 31 git commit -m "feat: add support for RSA-PSS signatures" 32 33 # Patch version bump (bug fix) 34 git commit -m "fix: correct key validation logic" 35 36 # Major version bump (breaking change) 37 git commit -m "feat!: change API signature for GenerateKeyPair 38 39 BREAKING CHANGE: The GenerateKeyPair function now requires an additional parameter" 40 41 # No version bump (documentation) 42 git commit -m "docs: update installation instructions" 43 ``` 44 45 ### Local testing 46 47 To test semantic-release locally: 48 49 ```bash 50 # Install dependencies 51 npm install 52 53 # Dry run (shows what would happen without making changes) 54 npm run release:dry 55 ``` 56 57 ### Manual trigger 58 59 You can manually trigger the workflow from GitHub Actions tab: 60 1. Go to Actions tab 61 2. Select "Semantic Release" workflow 62 3. Click "Run workflow" 63 4. Select branch and run 64 65 ### Configuration 66 67 - `.releaserc.json` - Semantic release configuration 68 - `package.json` - Node dependencies for semantic-release 69 70 ### Requirements 71 72 - Commits must follow Conventional Commits format 73 - The workflow needs write permissions for contents, issues, and pull requests 74 - Uses the built-in `GITHUB_TOKEN` for authentication