From 0ead2c37efe34278a859edbce40e8bba7bf021fd Mon Sep 17 00:00:00 2001 From: diogo464 Date: Thu, 10 Jul 2025 22:20:34 +0100 Subject: Add GitHub Actions release workflow and build scripts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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 --- scripts/README.md | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 scripts/README.md (limited to 'scripts/README.md') 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 @@ +# Build Scripts + +This directory contains scripts for building and releasing the oar-p2p binary. + +## Scripts + +### build-static.sh + +Builds statically linked binaries for Linux and macOS. + +```bash +# Build for all platforms (macOS only) +./scripts/build-static.sh all + +# Build for Linux only +./scripts/build-static.sh linux + +# Build for macOS only (macOS only) +./scripts/build-static.sh macos + +# Specify custom output directory +./scripts/build-static.sh linux /path/to/output +``` + +**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. + +### prepare-release.sh + +Prepares a release by building binaries, creating tarballs, and generating checksums. + +```bash +# Prepare release for version v1.0.0 +./scripts/prepare-release.sh v1.0.0 + +# Specify custom output directory +./scripts/prepare-release.sh v1.0.0 /path/to/dist +``` + +The script will: +1. Build static binaries for the current platform +2. Create tarballs with the binary and README +3. Generate SHA256 and SHA512 checksums +4. Create a release notes template + +## GitHub Actions + +The `.github/workflows/release.yml` workflow automatically: +1. Triggers on version tags (e.g., `v1.0.0`) +2. Builds binaries on Linux and macOS runners +3. Creates a GitHub release with all artifacts + +To create a release: +```bash +git tag -a v1.0.0 -m "Release v1.0.0" +git push origin v1.0.0 +``` \ No newline at end of file -- cgit