Skip to content

Commit c197593

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 c197593

4 files changed

Lines changed: 211 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: 170 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,170 @@
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+
use_cross: false
62+
63+
# Linux aarch64 (ARM64)
64+
- target: aarch64-unknown-linux-gnu
65+
os: ubuntu-latest
66+
name: ow-linux-aarch64
67+
use_cross: true
68+
69+
# macOS Intel
70+
- target: x86_64-apple-darwin
71+
os: macos-latest
72+
name: ow-macos-x86_64
73+
use_cross: false
74+
75+
# macOS Apple Silicon
76+
- target: aarch64-apple-darwin
77+
os: macos-latest
78+
name: ow-macos-aarch64
79+
use_cross: false
80+
81+
# Windows
82+
- target: x86_64-pc-windows-msvc
83+
os: windows-latest
84+
name: ow-windows-x86_64.exe
85+
use_cross: false
86+
87+
steps:
88+
- uses: actions/checkout@v4
89+
90+
- name: Install Rust
91+
uses: dtolnay/rust-toolchain@stable
92+
with:
93+
targets: ${{ matrix.target }}
94+
95+
- name: Install cross
96+
if: matrix.use_cross == true
97+
run: |
98+
cargo install cross --git https://github.com/cross-rs/cross
99+
100+
- name: Build (cross)
101+
if: matrix.use_cross == true
102+
run: cross build --release --target ${{ matrix.target }}
103+
104+
- name: Build (cargo)
105+
if: matrix.use_cross == false
106+
run: cargo build --release --target ${{ matrix.target }}
107+
108+
- name: Prepare binary (Unix)
109+
if: runner.os != 'Windows'
110+
run: |
111+
cp target/${{ matrix.target }}/release/ow ${{ matrix.name }}
112+
chmod +x ${{ matrix.name }}
113+
tar czf ${{ matrix.name }}.tar.gz ${{ matrix.name }}
114+
115+
- name: Prepare binary (Windows)
116+
if: runner.os == 'Windows'
117+
run: |
118+
copy target\${{ matrix.target }}\release\ow.exe ${{ matrix.name }}
119+
7z a ${{ matrix.name }}.zip ${{ matrix.name }}
120+
121+
- name: Upload artifact
122+
uses: actions/upload-artifact@v4
123+
with:
124+
name: ${{ matrix.name }}
125+
path: |
126+
${{ matrix.name }}.tar.gz
127+
${{ matrix.name }}.zip
128+
if-no-files-found: ignore
129+
130+
release:
131+
name: Create Release
132+
needs: build
133+
runs-on: ubuntu-latest
134+
steps:
135+
- uses: actions/checkout@v4
136+
137+
- name: Download artifacts
138+
uses: actions/download-artifact@v4
139+
with:
140+
path: artifacts
141+
142+
- name: Display structure
143+
run: ls -R artifacts
144+
145+
- name: Create checksums
146+
run: |
147+
cd artifacts
148+
for dir in */; do
149+
cd "$dir"
150+
for file in *; do
151+
if [ -f "$file" ]; then
152+
sha256sum "$file" >> ../checksums.txt
153+
fi
154+
done
155+
cd ..
156+
done
157+
cat checksums.txt
158+
159+
- name: Create Release
160+
uses: softprops/action-gh-release@v1
161+
with:
162+
draft: false
163+
prerelease: false
164+
generate_release_notes: true
165+
files: |
166+
artifacts/*/*.tar.gz
167+
artifacts/*/*.zip
168+
artifacts/checksums.txt
169+
env:
170+
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)