Skip to content

Commit 3319690

Browse files
feat: implement automated versioning with Release Please
Add Release Please workflow and configuration for automated version management, changelog generation, and release creation based on conventional commits. - Add .github/workflows/release-please.yml workflow - Add release-please-config.json configuration - Add .release-please-manifest.json for version tracking - Create initial CHANGELOG.md - Add CONTRIBUTING.md with release process documentation Co-authored-by: dlevy-msft-sql <[email protected]>
1 parent 41defd0 commit 3319690

5 files changed

Lines changed: 206 additions & 0 deletions

File tree

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Release Please
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: write
10+
pull-requests: write
11+
12+
jobs:
13+
release-please:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: google-github-actions/release-please-action@v4
17+
with:
18+
release-type: go
19+
package-name: sqlcmd

.release-please-manifest.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
".": "0.0.0"
3+
}

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6+
7+
## [Unreleased]
8+
9+
### Added
10+
- Implemented automated versioning with Release Please
11+
12+
This changelog will be automatically updated by Release Please based on conventional commits merged to the main branch.

CONTRIBUTING.md

Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
# Contributing to go-sqlcmd
2+
3+
Thank you for your interest in contributing to go-sqlcmd! This document provides guidelines for contributing to the project.
4+
5+
## Development Setup
6+
7+
### Prerequisites
8+
9+
- Go 1.24 or later
10+
- Git
11+
12+
### Building the Project
13+
14+
```bash
15+
# Clone the repository
16+
git clone https://github.com/microsoft/go-sqlcmd.git
17+
cd go-sqlcmd
18+
19+
# Build sqlcmd
20+
./build/build.sh # Linux/macOS
21+
.\build\build.cmd # Windows
22+
```
23+
24+
### Running Tests
25+
26+
```bash
27+
# Run all tests
28+
go test ./...
29+
30+
# Run tests with verbose output
31+
go test -v ./...
32+
33+
# Run tests for a specific package
34+
go test -v ./pkg/sqlcmd/...
35+
```
36+
37+
## Release Process
38+
39+
This project uses [Release Please](https://github.com/googleapis/release-please) for automated version management and releases. Release Please analyzes commits since the last release and automatically creates a Release PR that:
40+
41+
- Bumps the version based on [Conventional Commits](https://www.conventionalcommits.org/)
42+
- Updates the CHANGELOG.md with changes
43+
- Creates a GitHub release when the PR is merged
44+
45+
### Conventional Commits
46+
47+
All commits should follow the [Conventional Commits](https://www.conventionalcommits.org/) specification. This enables automated version bumping and changelog generation.
48+
49+
#### Commit Message Format
50+
51+
```
52+
<type>[optional scope]: <description>
53+
54+
[optional body]
55+
56+
[optional footer(s)]
57+
```
58+
59+
#### Types and Version Bumping
60+
61+
| Type | Version Bump | Description | Example |
62+
|------|--------------|-------------|---------|
63+
| `feat:` | Minor (0.X.0) | New feature | `feat: add query timeout option` |
64+
| `fix:` | Patch (0.0.X) | Bug fix | `fix: resolve connection timeout issue` |
65+
| `feat!:` or `BREAKING CHANGE:` | Major (X.0.0) | Breaking change | `feat!: change default port to 1433` |
66+
| `docs:` | No bump | Documentation only | `docs: update README with examples` |
67+
| `chore:` | No bump | Maintenance tasks | `chore: update dependencies` |
68+
| `ci:` | No bump | CI/CD changes | `ci: add workflow for linting` |
69+
| `test:` | No bump | Test changes | `test: add unit tests for parser` |
70+
| `refactor:` | No bump | Code refactoring | `refactor: simplify connection logic` |
71+
| `perf:` | No bump | Performance improvements | `perf: optimize query execution` |
72+
| `build:` | No bump | Build system changes | `build: update build script` |
73+
74+
#### Examples
75+
76+
**Feature (Minor bump):**
77+
```
78+
feat: add support for Azure AD authentication
79+
80+
Adds new authentication method for connecting to Azure SQL
81+
databases using Azure Active Directory credentials.
82+
```
83+
84+
**Bug fix (Patch bump):**
85+
```
86+
fix: correct handling of null values in output
87+
88+
Previously, null values were displayed as empty strings.
89+
Now they are properly displayed as "NULL".
90+
```
91+
92+
**Breaking change (Major bump):**
93+
```
94+
feat!: change default encryption to mandatory
95+
96+
BREAKING CHANGE: The default encryption setting has changed
97+
from optional to mandatory. Users must explicitly set
98+
encryption to optional if needed.
99+
```
100+
101+
**Non-version-bumping changes:**
102+
```
103+
docs: add examples for container commands
104+
chore: update go-mssqldb dependency
105+
ci: add codeql security scanning
106+
test: add integration tests for query command
107+
```
108+
109+
### How Releases Work
110+
111+
1. **Make changes** following conventional commit guidelines
112+
2. **Create PR** with your changes
113+
3. **Merge PR to main** - Release Please will analyze commits
114+
4. **Release Please creates/updates a Release PR** that:
115+
- Bumps version in relevant files
116+
- Updates CHANGELOG.md
117+
- Tags the release
118+
5. **Review and merge the Release PR** - This triggers:
119+
- Creation of a GitHub Release
120+
- Publishing of release artifacts
121+
122+
### Manual Release Process (if needed)
123+
124+
If you need to create a release manually:
125+
126+
1. Update the version in `.release-please-manifest.json`
127+
2. Update CHANGELOG.md manually
128+
3. Create and push a git tag:
129+
```bash
130+
git tag v1.0.0
131+
git push origin v1.0.0
132+
```
133+
4. Create a GitHub release from the tag
134+
135+
## Pull Request Guidelines
136+
137+
- Follow the conventional commit format in PR titles
138+
- Keep PRs focused on a single feature or fix
139+
- Add tests for new functionality
140+
- Ensure all tests pass locally before submitting
141+
- Update documentation if needed
142+
143+
## Code Style
144+
145+
- Follow standard Go conventions and idioms
146+
- Use `gofmt` for formatting
147+
- Run `golangci-lint` before submitting
148+
149+
## Questions?
150+
151+
If you have questions, feel free to:
152+
- Open an issue for discussion
153+
- Check existing issues and discussions
154+
- Review the [README](README.md) for more information
155+
156+
## License
157+
158+
By contributing, you agree that your contributions will be licensed under the MIT License.

release-please-config.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
3+
"packages": {
4+
".": {
5+
"release-type": "go",
6+
"package-name": "sqlcmd",
7+
"changelog-path": "CHANGELOG.md",
8+
"bump-minor-pre-major": true,
9+
"bump-patch-for-minor-pre-major": false,
10+
"draft": false,
11+
"prerelease": false
12+
}
13+
}
14+
}

0 commit comments

Comments
 (0)