| 1 |
# Requirements Document |
| 2 |
|
| 3 |
## Introduction |
| 4 |
|
| 5 |
This feature automates the creation and distribution of binary packages for the crc-fast library when a tagged version release is created on GitHub. The system will build platform-specific packages containing both library files (dynamic and static) and command-line utilities, following industry-standard packaging conventions for each target platform and architecture combination. |
| 6 |
|
| 7 |
## Glossary |
| 8 |
|
| 9 |
- **Release Workflow**: A GitHub Actions workflow that triggers on git tag creation and produces binary artifacts |
| 10 |
- **Binary Package**: A compressed archive containing compiled library files, headers, and executables for a specific platform-architecture combination |
| 11 |
- **Dynamic Library**: A shared library file (.so, .dylib, or .dll) that can be linked at runtime |
| 12 |
- **Static Library**: A library archive (.a or .lib) that is linked at compile time |
| 13 |
- **CLI Binary**: Command-line executable programs (checksum, arch-check, get-custom-params) |
| 14 |
- **Target Triple**: A Rust platform identifier (e.g., x86_64-unknown-linux-gnu) |
| 15 |
- **Package Layout**: The directory structure and file organization within a binary package |
| 16 |
- **Release Asset**: A file attached to a GitHub release that users can download |
| 17 |
|
| 18 |
## Requirements |
| 19 |
|
| 20 |
### Requirement 1 |
| 21 |
|
| 22 |
**User Story:** As a library consumer, I want to download pre-built binaries for my platform, so that I can use crc-fast without compiling from source |
| 23 |
|
| 24 |
#### Acceptance Criteria |
| 25 |
|
| 26 |
1. WHEN a git tag matching the pattern {MAJOR}.{MINOR}.{PATCH} is pushed, THE Release Workflow SHALL trigger automatically |
| 27 |
2. THE Release Workflow SHALL build binaries for x86_64-unknown-linux-gnu, aarch64-unknown-linux-gnu, aarch64-apple-darwin, x86_64-pc-windows-msvc, and aarch64-pc-windows-msvc targets |
| 28 |
3. THE Release Workflow SHALL execute all tests successfully before building release binaries |
| 29 |
4. THE Release Workflow SHALL produce release-optimized builds using the existing Cargo.toml release profile (LTO, strip, opt-level 3) |
| 30 |
5. THE Release Workflow SHALL upload all binary packages as GitHub release assets |
| 31 |
|
| 32 |
### Requirement 2 |
| 33 |
|
| 34 |
**User Story:** As a C/C++ developer, I want library packages with both dynamic and static libraries, so that I can choose the linking strategy that fits my project |
| 35 |
|
| 36 |
#### Acceptance Criteria |
| 37 |
|
| 38 |
1. THE Release Workflow SHALL include both dynamic library files and static library files in library packages |
| 39 |
2. WHERE the target is Linux, THE Release Workflow SHALL include libcrc_fast.so and libcrc_fast.a files |
| 40 |
3. WHERE the target is macOS, THE Release Workflow SHALL include libcrc_fast.dylib and libcrc_fast.a files |
| 41 |
4. WHERE the target is Windows, THE Release Workflow SHALL include crc_fast.dll, crc_fast.dll.lib (import library), and crc_fast.lib (static library) files |
| 42 |
5. THE Release Workflow SHALL include the libcrc_fast.h header file in all library packages |
| 43 |
|
| 44 |
### Requirement 3 |
| 45 |
|
| 46 |
**User Story:** As a command-line user, I want executable binaries for the checksum utilities, so that I can use crc-fast tools directly from my terminal |
| 47 |
|
| 48 |
#### Acceptance Criteria |
| 49 |
|
| 50 |
1. THE Release Workflow SHALL build checksum, arch-check, and get-custom-params executable binaries |
| 51 |
2. THE Release Workflow SHALL include CLI binaries in library packages |
| 52 |
3. WHERE the target is Windows, THE Release Workflow SHALL include .exe extensions on executable files |
| 53 |
4. WHERE the target is Linux or macOS, THE Release Workflow SHALL set executable permissions on binary files |
| 54 |
|
| 55 |
### Requirement 4 |
| 56 |
|
| 57 |
**User Story:** As a package consumer, I want packages organized according to platform conventions, so that I can easily integrate them into my build system |
| 58 |
|
| 59 |
#### Acceptance Criteria |
| 60 |
|
| 61 |
1. WHERE the target is Linux, THE Release Workflow SHALL organize files in lib/ and include/ directories |
| 62 |
2. WHERE the target is macOS, THE Release Workflow SHALL organize files in lib/ and include/ directories |
| 63 |
3. WHERE the target is Windows, THE Release Workflow SHALL organize files in bin/ and include/ directories |
| 64 |
4. THE Release Workflow SHALL place CLI executables in bin/ subdirectory for Linux and macOS targets |
| 65 |
5. THE Release Workflow SHALL place CLI executables in bin/ subdirectory for Windows targets alongside the DLL |
| 66 |
|
| 67 |
### Requirement 5 |
| 68 |
|
| 69 |
**User Story:** As a release maintainer, I want descriptive package names, so that users can easily identify the correct package for their platform |
| 70 |
|
| 71 |
#### Acceptance Criteria |
| 72 |
|
| 73 |
1. THE Release Workflow SHALL name packages using the format crc-fast-{version}-{os}-{arch}.{extension} |
| 74 |
2. WHERE the target is Linux, THE Release Workflow SHALL use .tar.gz extension |
| 75 |
3. WHERE the target is macOS, THE Release Workflow SHALL use .tar.gz extension |
| 76 |
4. WHERE the target is Windows, THE Release Workflow SHALL use .zip extension |
| 77 |
5. THE Release Workflow SHALL include the git tag version in the package filename |
| 78 |
|
| 79 |
### Requirement 6 |
| 80 |
|
| 81 |
**User Story:** As a quality-conscious maintainer, I want the release workflow to reuse existing test infrastructure, so that releases are only created when all tests pass |
| 82 |
|
| 83 |
#### Acceptance Criteria |
| 84 |
|
| 85 |
1. THE Release Workflow SHALL depend on successful completion of the existing test workflow |
| 86 |
2. THE Release Workflow SHALL use the same Rust toolchain version as the test workflow |
| 87 |
3. THE Release Workflow SHALL fail and prevent release creation if any test fails |
| 88 |
4. THE Release Workflow SHALL run cargo fmt and cargo clippy checks before building |
| 89 |
5. THE Release Workflow SHALL only trigger on tags matching [0-9]+.[0-9]+.[0-9]+ pattern |
| 90 |
|
| 91 |
### Requirement 7 |
| 92 |
|
| 93 |
**User Story:** As a downstream consumer, I want packages to include version information, so that I can verify I'm using the correct release |
| 94 |
|
| 95 |
#### Acceptance Criteria |
| 96 |
|
| 97 |
1. THE Release Workflow SHALL include a VERSION or version.txt file in each package |
| 98 |
2. THE Release Workflow SHALL include a README or INSTALL file with basic usage instructions |
| 99 |
3. THE Release Workflow SHALL include LICENSE files in each package |
| 100 |
4. THE Release Workflow SHALL generate a checksum file (SHA256) for each package |
| 101 |
5. THE Release Workflow SHALL upload checksum files as separate release assets |