|
8 | 8 | - [License](#license) |
9 | 9 | - [Bugs/Features](#bugsfeatures) |
10 | 10 | - [Contributing](#contributing) |
| 11 | +- [Release and Deployment](#release-and-deployment) |
11 | 12 | - [Changelog](#changelog) |
12 | 13 |
|
13 | 14 | ## Available Hooks |
@@ -128,5 +129,53 @@ To request features or alert about bugs, please do so [here](https://github.com/ |
128 | 129 | ## Contributing |
129 | 130 | We welcome contributions to this project! Please clone the repository and submit a pull request with your changes. Ensure that your code passes all pre-commit checks before submitting. |
130 | 131 |
|
| 132 | +## Release and Deployment |
| 133 | +
|
| 134 | +This project uses automated GitHub Actions workflows to manage releases. The package is distributed through GitHub Releases and the pre-commit framework (not PyPI). |
| 135 | +
|
| 136 | +### Release Process |
| 137 | +
|
| 138 | +1. **Update Version**: Modify `__version__` in `src/hooks/__init__.py` following semantic versioning (MAJOR.MINOR.PATCH) |
| 139 | +
|
| 140 | +2. **Create Tag**: Run the `tag-version.yml` workflow manually: |
| 141 | + - Go to Actions → "Tag Version" → "Run workflow" |
| 142 | + - The workflow compares the Python package version with the latest Git tag |
| 143 | + - If versions differ, it creates and pushes a new tag (e.g., `v0.3.0`) |
| 144 | +
|
| 145 | +3. **Automated Release**: The `release.yml` workflow triggers automatically when a tag is pushed: |
| 146 | + - Builds the package in a clean environment |
| 147 | + - Runs verification tests (binary check, `--help`, basic execution) |
| 148 | + - Creates a draft GitHub Release |
| 149 | +
|
| 150 | +4. **Publish Release**: A maintainer reviews and publishes the draft release manually |
| 151 | +
|
| 152 | +### Version Management |
| 153 | +
|
| 154 | +- **Current Version Source**: `src/hooks/__init__.py` |
| 155 | +- **Versioning Strategy**: Semantic Versioning (SemVer) |
| 156 | +- **Tag Format**: `v0.3.0` (with 'v' prefix) |
| 157 | +- **Major Version Tags**: The repository maintains `v0` and `v1` tags that point to the latest patch release, allowing users to pin to a major version and automatically receive updates |
| 158 | +
|
| 159 | +### Distribution |
| 160 | +
|
| 161 | +Users reference this package in their `.pre-commit-config.yaml`: |
| 162 | +
|
| 163 | +```yaml |
| 164 | +repos: |
| 165 | +- repo: https://github.com/scanoss/pre-commit-hooks |
| 166 | + rev: v0 # Pin to major version, or use v0.3.0 for specific version |
| 167 | + hooks: |
| 168 | + - id: scanoss-check-undeclared-code |
| 169 | +``` |
| 170 | +
|
| 171 | +The pre-commit framework installs directly from the Git repository—no PyPI publishing required. |
| 172 | +
|
| 173 | +### Key Workflows |
| 174 | +
|
| 175 | +- `.github/workflows/tag-version.yml` - Manual workflow for version tagging |
| 176 | +- `.github/workflows/release.yml` - Automated draft release creation |
| 177 | +- `.github/workflows/test.yml` - Continuous testing on main branch and PRs |
| 178 | +- `.github/workflows/update-main-version.yml` - Major version tag maintenance |
| 179 | +
|
131 | 180 | ## Changelog |
132 | 181 | Details of major changes to the library can be found in [CHANGELOG.md](CHANGELOG.md). |
0 commit comments