Skip to content

Commit b7d11e5

Browse files
committed
Add prebuilt binaries via GitHub Releases
- Setup GitHub Actions to build binaries for Linux/macOS/Windows on tags - Add cargo-binstall support for auto-detection of prebuilt binaries - Integrate Docker build into release workflow (builds on tags only) - Remove separate docker.yml workflow (release now pushes latest + version tag) - Update README with prebuilt installation instructions Users can now: cargo binstall openworkers-cli # auto-downloads prebuilt curl -L <release-url> | tar xz # manual download No more waiting for `cargo install --git` compilation. Bumps to v0.2.2 will auto-publish all artifacts.
1 parent bc4ac87 commit b7d11e5

4 files changed

Lines changed: 202 additions & 54 deletions

File tree

.cargo-binstall.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[binstall]
2+
pkg-url = "{ repo }/releases/download/v{ version }/{ name }-{ target }{ archive-suffix }"
3+
bin-dir = "{ bin }{ binary-ext }"
4+
pkg-fmt = "tgz"
5+
6+
[binstall.overrides.x86_64-pc-windows-msvc]
7+
pkg-fmt = "zip"

.github/workflows/docker.yml

Lines changed: 0 additions & 51 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 161 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,161 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*.*.*'
7+
8+
permissions:
9+
contents: write
10+
packages: write
11+
12+
jobs:
13+
docker:
14+
name: Build Docker Image
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Check Out Repo
18+
uses: actions/checkout@v4
19+
20+
- name: Docker metadata
21+
id: metadata
22+
uses: docker/metadata-action@v5
23+
with:
24+
images: |
25+
ghcr.io/${{ github.repository }}
26+
tags: |
27+
type=raw,value=latest
28+
type=ref,event=tag
29+
30+
- name: Set up Docker Buildx
31+
uses: docker/setup-buildx-action@v3
32+
33+
- name: Login to GitHub Container Registry
34+
uses: docker/login-action@v3
35+
with:
36+
registry: ghcr.io
37+
username: ${{ github.repository_owner }}
38+
password: ${{ secrets.GITHUB_TOKEN }}
39+
40+
- name: Build and Push
41+
uses: docker/build-push-action@v5
42+
with:
43+
file: Dockerfile.multi
44+
push: true
45+
tags: ${{ steps.metadata.outputs.tags }}
46+
cache-from: type=gha
47+
cache-to: type=gha,mode=max
48+
platforms: linux/amd64,linux/arm64
49+
50+
build:
51+
name: Build ${{ matrix.target }}
52+
runs-on: ${{ matrix.os }}
53+
strategy:
54+
fail-fast: false
55+
matrix:
56+
include:
57+
# Linux x86_64
58+
- target: x86_64-unknown-linux-gnu
59+
os: ubuntu-latest
60+
name: ow-linux-x86_64
61+
62+
# Linux aarch64
63+
- target: aarch64-unknown-linux-gnu
64+
os: ubuntu-latest
65+
name: ow-linux-aarch64
66+
67+
# macOS Intel
68+
- target: x86_64-apple-darwin
69+
os: macos-latest
70+
name: ow-macos-x86_64
71+
72+
# macOS Apple Silicon
73+
- target: aarch64-apple-darwin
74+
os: macos-latest
75+
name: ow-macos-aarch64
76+
77+
# Windows
78+
- target: x86_64-pc-windows-msvc
79+
os: windows-latest
80+
name: ow-windows-x86_64.exe
81+
82+
steps:
83+
- uses: actions/checkout@v4
84+
85+
- name: Install Rust
86+
uses: dtolnay/rust-toolchain@stable
87+
with:
88+
targets: ${{ matrix.target }}
89+
90+
- name: Install cross-compilation tools (Linux aarch64)
91+
if: matrix.target == 'aarch64-unknown-linux-gnu'
92+
run: |
93+
sudo apt-get update
94+
sudo apt-get install -y gcc-aarch64-linux-gnu
95+
96+
- name: Build
97+
run: cargo build --release --target ${{ matrix.target }}
98+
99+
- name: Prepare binary (Unix)
100+
if: runner.os != 'Windows'
101+
run: |
102+
cp target/${{ matrix.target }}/release/ow ${{ matrix.name }}
103+
chmod +x ${{ matrix.name }}
104+
tar czf ${{ matrix.name }}.tar.gz ${{ matrix.name }}
105+
106+
- name: Prepare binary (Windows)
107+
if: runner.os == 'Windows'
108+
run: |
109+
copy target\${{ matrix.target }}\release\ow.exe ${{ matrix.name }}
110+
7z a ${{ matrix.name }}.zip ${{ matrix.name }}
111+
112+
- name: Upload artifact
113+
uses: actions/upload-artifact@v4
114+
with:
115+
name: ${{ matrix.name }}
116+
path: |
117+
${{ matrix.name }}.tar.gz
118+
${{ matrix.name }}.zip
119+
if-no-files-found: ignore
120+
121+
release:
122+
name: Create Release
123+
needs: build
124+
runs-on: ubuntu-latest
125+
steps:
126+
- uses: actions/checkout@v4
127+
128+
- name: Download artifacts
129+
uses: actions/download-artifact@v4
130+
with:
131+
path: artifacts
132+
133+
- name: Display structure
134+
run: ls -R artifacts
135+
136+
- name: Create checksums
137+
run: |
138+
cd artifacts
139+
for dir in */; do
140+
cd "$dir"
141+
for file in *; do
142+
if [ -f "$file" ]; then
143+
sha256sum "$file" >> ../checksums.txt
144+
fi
145+
done
146+
cd ..
147+
done
148+
cat checksums.txt
149+
150+
- name: Create Release
151+
uses: softprops/action-gh-release@v1
152+
with:
153+
draft: false
154+
prerelease: false
155+
generate_release_notes: true
156+
files: |
157+
artifacts/*/*.tar.gz
158+
artifacts/*/*.zip
159+
artifacts/checksums.txt
160+
env:
161+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

README.md

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,43 @@
22

33
Command-line interface for managing OpenWorkers deployments.
44

5-
## Quick Start
5+
## Installation
6+
7+
**Prebuilt binaries (recommended):**
68

79
```bash
8-
# Install
9-
cargo install --path .
10+
# Using cargo-binstall (auto-detects prebuilt binaries)
11+
cargo install cargo-binstall
12+
cargo binstall openworkers-cli
13+
14+
# Or download manually from GitHub Releases
15+
curl -L https://github.com/openworkers/openworkers-cli/releases/latest/download/ow-linux-x86_64.tar.gz | tar xz
16+
sudo mv ow /usr/local/bin/
1017

18+
# macOS (Intel)
19+
curl -L https://github.com/openworkers/openworkers-cli/releases/latest/download/ow-macos-x86_64.tar.gz | tar xz
20+
sudo mv ow /usr/local/bin/
21+
22+
# macOS (Apple Silicon)
23+
curl -L https://github.com/openworkers/openworkers-cli/releases/latest/download/ow-macos-aarch64.tar.gz | tar xz
24+
sudo mv ow /usr/local/bin/
25+
```
26+
27+
**Docker:**
28+
29+
```bash
30+
docker run --rm ghcr.io/openworkers/openworkers-cli --help
31+
```
32+
33+
**Build from source:**
34+
35+
```bash
36+
cargo install --git https://github.com/openworkers/openworkers-cli
37+
```
38+
39+
## Quick Start
40+
41+
```bash
1142
# Login (opens browser)
1243
ow login
1344

0 commit comments

Comments
 (0)