Add make sync-version to keep changelog and main.go Version the same. Update docs. Cut 1.1.2-1
This commit is contained in:
@ -244,6 +244,62 @@ snmpwalk -v2c -c public localhost 1.3.6.1.2.1.1
|
||||
snmpwalk -v2c -c public localhost 1.3.6.1.2.1.31.1.1.1
|
||||
```
|
||||
|
||||
## Building and Releasing
|
||||
|
||||
### Build Targets
|
||||
|
||||
The project uses a Makefile with the following targets:
|
||||
|
||||
```bash
|
||||
# Build the binary
|
||||
make build
|
||||
|
||||
# Run tests
|
||||
make test
|
||||
|
||||
# Clean build artifacts
|
||||
make clean
|
||||
|
||||
# Sync version from debian/changelog to main.go
|
||||
make sync-version
|
||||
|
||||
# Build Debian package (includes automatic version sync)
|
||||
make pkg-deb
|
||||
```
|
||||
|
||||
### Release Process
|
||||
|
||||
To cut a new release, follow these steps in order:
|
||||
|
||||
1. **Update debian/changelog** with the new version and changelog entries:
|
||||
```bash
|
||||
# Edit debian/changelog manually
|
||||
vim debian/changelog
|
||||
```
|
||||
|
||||
2. **Sync version to main.go**:
|
||||
```bash
|
||||
make sync-version
|
||||
```
|
||||
|
||||
3. **Build the package**:
|
||||
```bash
|
||||
make pkg-deb
|
||||
```
|
||||
|
||||
4. **Commit all changes together**:
|
||||
```bash
|
||||
git add debian/changelog src/main.go
|
||||
git commit -m "Cut release X.Y.Z-A"
|
||||
git tag vX.Y.Z-A
|
||||
```
|
||||
|
||||
### Version Synchronization
|
||||
|
||||
The build system automatically ensures that the version in `debian/changelog` matches the version constant in `src/main.go`. The `make pkg-deb` target automatically calls `make sync-version` before building to maintain consistency.
|
||||
|
||||
**Important**: Always update `debian/changelog` first, as this is the authoritative source for the version number. The `make sync-version` target extracts the version from the first line of the changelog and updates the `Version` constant in `src/main.go`.
|
||||
|
||||
## License
|
||||
|
||||
This project uses the LGPL 3.0 licensed go-agentx library. It has been modified due to a bug,
|
||||
|
Reference in New Issue
Block a user