Skip to content

Commit ecb4f04

Browse files
committed
Add release workflow and install script
GitHub Actions cross-compiles on tag push (darwin/linux, amd64/arm64). Install script downloads the right binary for the user's platform.
1 parent d29e123 commit ecb4f04

File tree

3 files changed

+97
-0
lines changed

3 files changed

+97
-0
lines changed

.github/workflows/release.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
release:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- uses: actions/setup-go@v5
18+
with:
19+
go-version: '1.25'
20+
21+
- name: Build binaries
22+
run: |
23+
platforms=(
24+
"darwin/arm64"
25+
"darwin/amd64"
26+
"linux/amd64"
27+
"linux/arm64"
28+
)
29+
mkdir -p dist
30+
for platform in "${platforms[@]}"; do
31+
GOOS="${platform%/*}"
32+
GOARCH="${platform#*/}"
33+
output="dist/reflex-${GOOS}-${GOARCH}"
34+
echo "Building ${output}..."
35+
GOOS=$GOOS GOARCH=$GOARCH go build -ldflags="-s -w" -o "$output" .
36+
done
37+
38+
- name: Generate checksums
39+
run: |
40+
cd dist
41+
sha256sum reflex-* > checksums.txt
42+
43+
- name: Create release
44+
uses: softprops/action-gh-release@v2
45+
with:
46+
generate_release_notes: true
47+
files: |
48+
dist/reflex-*
49+
dist/checksums.txt

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ Your agent sees the injection as part of the current message — not buried in a
2525

2626
**1. Install the `reflex` binary**
2727

28+
```bash
29+
curl -sL https://raw.githubusercontent.com/markmdev/reflex/master/install.sh | sh
30+
```
31+
32+
Or with Go:
2833
```bash
2934
go install github.com/markmdev/reflex@latest
3035
```

install.sh

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#!/bin/sh
2+
set -e
3+
4+
REPO="markmdev/reflex"
5+
INSTALL_DIR="$HOME/.local/bin"
6+
7+
# Detect platform
8+
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
9+
ARCH=$(uname -m)
10+
11+
case "$ARCH" in
12+
x86_64) ARCH="amd64" ;;
13+
aarch64) ARCH="arm64" ;;
14+
arm64) ARCH="arm64" ;;
15+
*) echo "Unsupported architecture: $ARCH" && exit 1 ;;
16+
esac
17+
18+
case "$OS" in
19+
darwin|linux) ;;
20+
*) echo "Unsupported OS: $OS" && exit 1 ;;
21+
esac
22+
23+
BINARY="reflex-${OS}-${ARCH}"
24+
25+
# Get latest release tag
26+
TAG=$(curl -sL "https://api.github.com/repos/${REPO}/releases/latest" | grep '"tag_name"' | head -1 | cut -d'"' -f4)
27+
28+
if [ -z "$TAG" ]; then
29+
echo "Failed to fetch latest release"
30+
exit 1
31+
fi
32+
33+
URL="https://github.com/${REPO}/releases/download/${TAG}/${BINARY}"
34+
35+
echo "Downloading reflex ${TAG} (${OS}/${ARCH})..."
36+
mkdir -p "$INSTALL_DIR"
37+
curl -sL "$URL" -o "${INSTALL_DIR}/reflex"
38+
chmod +x "${INSTALL_DIR}/reflex"
39+
40+
echo "Installed reflex ${TAG} to ${INSTALL_DIR}/reflex"
41+
echo ""
42+
echo "Make sure ${INSTALL_DIR} is in your PATH:"
43+
echo " export PATH=\"\$HOME/.local/bin:\$PATH\""

0 commit comments

Comments
 (0)