aboutsummaryrefslogtreecommitdiff
path: root/scripts/README.md
diff options
context:
space:
mode:
authordiogo464 <[email protected]>2025-07-10 22:20:34 +0100
committerdiogo464 <[email protected]>2025-07-10 22:20:34 +0100
commit0ead2c37efe34278a859edbce40e8bba7bf021fd (patch)
treeaaf17c0a8bd10b596962ae52f25e8bcb0e62dea8 /scripts/README.md
parent3b0721341c46922b5c1c94bdbbf37099424ee5bc (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.md56
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
3This directory contains scripts for building and releasing the oar-p2p binary.
4
5## Scripts
6
7### build-static.sh
8
9Builds 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
29Prepares 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
39The script will:
401. Build static binaries for the current platform
412. Create tarballs with the binary and README
423. Generate SHA256 and SHA512 checksums
434. Create a release notes template
44
45## GitHub Actions
46
47The `.github/workflows/release.yml` workflow automatically:
481. Triggers on version tags (e.g., `v1.0.0`)
492. Builds binaries on Linux and macOS runners
503. Creates a GitHub release with all artifacts
51
52To create a release:
53```bash
54git tag -a v1.0.0 -m "Release v1.0.0"
55git push origin v1.0.0
56``` \ No newline at end of file