diff options
| author | diogo464 <[email protected]> | 2025-07-10 22:20:34 +0100 |
|---|---|---|
| committer | diogo464 <[email protected]> | 2025-07-10 22:20:34 +0100 |
| commit | 0ead2c37efe34278a859edbce40e8bba7bf021fd (patch) | |
| tree | aaf17c0a8bd10b596962ae52f25e8bcb0e62dea8 /scripts/README.md | |
| parent | 3b0721341c46922b5c1c94bdbbf37099424ee5bc (diff) | |
Add GitHub Actions release workflow and build scripts
- Add .github/workflows/release.yml for automated releases on version tags
- Add scripts/build-static.sh for building statically linked binaries
- Add scripts/prepare-release.sh for preparing release artifacts
- Optimize Cargo.toml for smaller binary size (reduced from 4.5MB to 2.9MB)
- Add scripts/README.md with usage documentation
The workflow automatically builds binaries for Linux (musl) and macOS (Intel/ARM)
when a version tag is pushed.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
Diffstat (limited to 'scripts/README.md')
| -rw-r--r-- | scripts/README.md | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/scripts/README.md b/scripts/README.md new file mode 100644 index 0000000..65b69ee --- /dev/null +++ b/scripts/README.md | |||
| @@ -0,0 +1,56 @@ | |||
| 1 | # Build Scripts | ||
| 2 | |||
| 3 | This directory contains scripts for building and releasing the oar-p2p binary. | ||
| 4 | |||
| 5 | ## Scripts | ||
| 6 | |||
| 7 | ### build-static.sh | ||
| 8 | |||
| 9 | Builds statically linked binaries for Linux and macOS. | ||
| 10 | |||
| 11 | ```bash | ||
| 12 | # Build for all platforms (macOS only) | ||
| 13 | ./scripts/build-static.sh all | ||
| 14 | |||
| 15 | # Build for Linux only | ||
| 16 | ./scripts/build-static.sh linux | ||
| 17 | |||
| 18 | # Build for macOS only (macOS only) | ||
| 19 | ./scripts/build-static.sh macos | ||
| 20 | |||
| 21 | # Specify custom output directory | ||
| 22 | ./scripts/build-static.sh linux /path/to/output | ||
| 23 | ``` | ||
| 24 | |||
| 25 | **Note**: Cross-compilation is not supported. Linux binaries must be built on Linux, and macOS binaries must be built on macOS. The GitHub Actions workflow handles this by using different runners. | ||
| 26 | |||
| 27 | ### prepare-release.sh | ||
| 28 | |||
| 29 | Prepares a release by building binaries, creating tarballs, and generating checksums. | ||
| 30 | |||
| 31 | ```bash | ||
| 32 | # Prepare release for version v1.0.0 | ||
| 33 | ./scripts/prepare-release.sh v1.0.0 | ||
| 34 | |||
| 35 | # Specify custom output directory | ||
| 36 | ./scripts/prepare-release.sh v1.0.0 /path/to/dist | ||
| 37 | ``` | ||
| 38 | |||
| 39 | The script will: | ||
| 40 | 1. Build static binaries for the current platform | ||
| 41 | 2. Create tarballs with the binary and README | ||
| 42 | 3. Generate SHA256 and SHA512 checksums | ||
| 43 | 4. Create a release notes template | ||
| 44 | |||
| 45 | ## GitHub Actions | ||
| 46 | |||
| 47 | The `.github/workflows/release.yml` workflow automatically: | ||
| 48 | 1. Triggers on version tags (e.g., `v1.0.0`) | ||
| 49 | 2. Builds binaries on Linux and macOS runners | ||
| 50 | 3. Creates a GitHub release with all artifacts | ||
| 51 | |||
| 52 | To create a release: | ||
| 53 | ```bash | ||
| 54 | git tag -a v1.0.0 -m "Release v1.0.0" | ||
| 55 | git push origin v1.0.0 | ||
| 56 | ``` \ No newline at end of file | ||
