Skip to content

Commit 71ba25e

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 71ba25e

File tree

4 files changed

+191
-54
lines changed

4 files changed

+191
-54
lines changed

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