Skip to content

Commit af2725d

Browse files
ci: add GitHub Release workflow for automated package distribution
- Add release.yml workflow triggered by version tags - Automatically builds tar.gz and wheel packages - Creates GitHub Releases with installation instructions - Generates SHA256 checksums for security - Add comprehensive INSTALL.md guide
1 parent 20d7a38 commit af2725d

File tree

2 files changed

+381
-0
lines changed

2 files changed

+381
-0
lines changed

.github/workflows/release.yml

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*' # Trigger on version tags like v0.1.0, v1.0.0, etc.
7+
8+
permissions:
9+
contents: write # Required for creating releases
10+
11+
jobs:
12+
build-and-release:
13+
name: Build and Release
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v4
19+
20+
- name: Set up Python
21+
uses: actions/setup-python@v5
22+
with:
23+
python-version: '3.11'
24+
25+
- name: Install build dependencies
26+
run: |
27+
python -m pip install --upgrade pip
28+
pip install build twine wheel setuptools
29+
30+
- name: Build packages
31+
run: |
32+
python -m build
33+
ls -lh dist/
34+
35+
- name: Verify packages
36+
run: |
37+
twine check dist/*
38+
39+
- name: Extract version from tag
40+
id: get_version
41+
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
42+
43+
- name: Create Release
44+
uses: softprops/action-gh-release@v1
45+
with:
46+
name: Easysearch Python Client v${{ steps.get_version.outputs.VERSION }}
47+
body: |
48+
## Easysearch Python Client v${{ steps.get_version.outputs.VERSION }}
49+
50+
Official Python client for Easysearch - the open-source search and analytics engine.
51+
52+
### 📦 Installation from GitHub Release
53+
54+
Download the package files below and install locally:
55+
56+
**Option 1: Install wheel (recommended)**
57+
```bash
58+
pip install easysearch-${{ steps.get_version.outputs.VERSION }}-py2.py3-none-any.whl
59+
```
60+
61+
**Option 2: Install from source**
62+
```bash
63+
pip install easysearch-${{ steps.get_version.outputs.VERSION }}.tar.gz
64+
```
65+
66+
### 🚀 Quick Start
67+
68+
```python
69+
from easysearch import Easysearch
70+
71+
# Connect to Easysearch
72+
es = Easysearch(['http://localhost:9200'])
73+
74+
# Get cluster info
75+
info = es.info()
76+
print(info)
77+
```
78+
79+
### 📚 Documentation
80+
81+
- [GitHub Repository](https://github.com/infinilabs/easysearch-py)
82+
- [Easysearch Official Site](https://easysearch.cn)
83+
84+
### 🐛 Reporting Issues
85+
86+
Please report any issues on our [GitHub Issues](https://github.com/infinilabs/easysearch-py/issues) page.
87+
88+
---
89+
90+
**Checksums:**
91+
See assets below for SHA256 checksums.
92+
files: |
93+
dist/*.tar.gz
94+
dist/*.whl
95+
draft: false
96+
prerelease: ${{ contains(steps.get_version.outputs.VERSION, 'alpha') || contains(steps.get_version.outputs.VERSION, 'beta') || contains(steps.get_version.outputs.VERSION, 'rc') }}
97+
generate_release_notes: true
98+
env:
99+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
100+
101+
- name: Generate checksums
102+
run: |
103+
cd dist
104+
sha256sum * > SHA256SUMS
105+
cat SHA256SUMS
106+
107+
- name: Upload checksums to release
108+
uses: softprops/action-gh-release@v1
109+
with:
110+
files: dist/SHA256SUMS
111+
env:
112+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

INSTALL.md

Lines changed: 269 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,269 @@
1+
# Installation Guide
2+
3+
This guide explains how to install the Easysearch Python Client.
4+
5+
## Table of Contents
6+
7+
- [Install Directly from GitHub (Easiest)](#install-directly-from-github-easiest)
8+
- [Install from GitHub Releases](#install-from-github-releases)
9+
- [Install from Source](#install-from-source)
10+
- [Install from PyPI](#install-from-pypi)
11+
- [Verify Installation](#verify-installation)
12+
13+
---
14+
15+
## Install Directly from GitHub (Easiest)
16+
17+
You can install directly from GitHub using pip, no need to download files manually!
18+
19+
### Install from Latest Code (main branch)
20+
21+
```bash
22+
pip install git+https://github.com/infinilabs/easysearch-py.git
23+
```
24+
25+
### Install from Specific Version Tag
26+
27+
```bash
28+
# Install version 0.1.0
29+
pip install git+https://github.com/infinilabs/[email protected]
30+
31+
# Install version 0.2.0
32+
pip install git+https://github.com/infinilabs/[email protected]
33+
```
34+
35+
### Install from Specific Branch
36+
37+
```bash
38+
# Install from develop branch
39+
pip install git+https://github.com/infinilabs/easysearch-py.git@develop
40+
```
41+
42+
### Install from Specific Commit
43+
44+
```bash
45+
pip install git+https://github.com/infinilabs/easysearch-py.git@abc1234
46+
```
47+
48+
### Using requirements.txt
49+
50+
Add to your `requirements.txt`:
51+
52+
```txt
53+
# Latest from main branch
54+
git+https://github.com/infinilabs/easysearch-py.git
55+
56+
# Or specific version
57+
git+https://github.com/infinilabs/[email protected]
58+
59+
# Or with egg name for reference
60+
git+https://github.com/infinilabs/[email protected]#egg=easysearch
61+
```
62+
63+
Then install:
64+
```bash
65+
pip install -r requirements.txt
66+
```
67+
68+
### Advantages
69+
70+
**No manual download needed** - pip handles everything
71+
**Always up-to-date** - install latest or pin specific versions
72+
**Works in CI/CD** - perfect for automated deployments
73+
**No PyPI dependency** - works even if PyPI has issues
74+
**Easy to upgrade** - just change the version tag
75+
76+
---
77+
78+
## Install from GitHub Releases
79+
80+
You can download pre-built packages from [GitHub Releases](https://github.com/infinilabs/easysearch-py/releases), or install directly from release URLs.
81+
82+
### Option A: Install Directly from Release URL (No Download Needed)
83+
84+
```bash
85+
# Install wheel from GitHub Release (recommended)
86+
pip install https://github.com/infinilabs/easysearch-py/releases/download/v0.1.0/easysearch-0.1.0-py2.py3-none-any.whl
87+
88+
# Or install source package
89+
pip install https://github.com/infinilabs/easysearch-py/releases/download/v0.1.0/easysearch-0.1.0.tar.gz
90+
```
91+
92+
Replace `v0.1.0` and `0.1.0` with the version you want.
93+
94+
### Option B: Download and Install Locally
95+
96+
#### Step 1: Download the Package
97+
98+
Visit the [releases page](https://github.com/infinilabs/easysearch-py/releases) and download either:
99+
- `easysearch-X.Y.Z-py2.py3-none-any.whl` (wheel package, recommended)
100+
- `easysearch-X.Y.Z.tar.gz` (source package)
101+
102+
Replace `X.Y.Z` with the version number (e.g., `0.1.0`).
103+
104+
#### Step 2: Install the Downloaded Package
105+
106+
**Option 1: Install wheel package (faster)**
107+
```bash
108+
pip install easysearch-0.1.0-py2.py3-none-any.whl
109+
```
110+
111+
**Option 2: Install source package**
112+
```bash
113+
pip install easysearch-0.1.0.tar.gz
114+
```
115+
116+
#### Step 3: Verify Checksums (Optional but Recommended)
117+
118+
Download the `SHA256SUMS` file from the same release page:
119+
120+
```bash
121+
# Verify the checksum
122+
sha256sum -c SHA256SUMS
123+
```
124+
125+
---
126+
127+
## Install from Source
128+
129+
Clone the repository and install:
130+
131+
```bash
132+
# Clone the repository
133+
git clone https://github.com/infinilabs/easysearch-py.git
134+
cd easysearch-py
135+
136+
# Install in development mode
137+
pip install -e .
138+
139+
# Or build and install
140+
python -m build
141+
pip install dist/easysearch-*.whl
142+
```
143+
144+
---
145+
146+
## Install from PyPI
147+
148+
> **Note:** PyPI package name may differ due to naming conflicts. Check the latest instructions in the README.
149+
150+
```bash
151+
# When available on PyPI
152+
pip install easysearch-py
153+
```
154+
155+
---
156+
157+
## Verify Installation
158+
159+
After installation, verify that the package is installed correctly:
160+
161+
```bash
162+
python -c "from easysearch import Easysearch; print('Easysearch client installed successfully!')"
163+
```
164+
165+
### Quick Test
166+
167+
```python
168+
from easysearch import Easysearch
169+
170+
# Connect to your Easysearch instance
171+
es = Easysearch(['http://localhost:9200'])
172+
173+
# Get cluster information
174+
info = es.info()
175+
print(info)
176+
```
177+
178+
---
179+
180+
## Requirements
181+
182+
- **Python:** 3.6 or higher (Python 2.7 and 3.4+ are supported, but 3.6+ recommended)
183+
- **Dependencies:**
184+
- `urllib3>=1.21.1,<2`
185+
- `certifi`
186+
- `aiohttp>=3` (for async support, Python 3.6+ only)
187+
188+
Dependencies are automatically installed by pip.
189+
190+
---
191+
192+
## Offline Installation
193+
194+
For environments without internet access:
195+
196+
### Step 1: Download packages on a machine with internet
197+
198+
```bash
199+
# Download the package and all dependencies
200+
pip download easysearch -d /path/to/packages/
201+
```
202+
203+
Or download from GitHub Releases manually.
204+
205+
### Step 2: Transfer to offline machine
206+
207+
Copy the packages directory to your offline machine.
208+
209+
### Step 3: Install offline
210+
211+
```bash
212+
pip install --no-index --find-links=/path/to/packages/ easysearch
213+
```
214+
215+
---
216+
217+
## Troubleshooting
218+
219+
### SSL Certificate Verification Errors
220+
221+
If you encounter SSL certificate errors:
222+
223+
```python
224+
from easysearch import Easysearch
225+
226+
es = Easysearch(
227+
['https://localhost:9200'],
228+
use_ssl=True,
229+
verify_certs=False, # Disable certificate verification (development only)
230+
ssl_show_warn=False
231+
)
232+
```
233+
234+
**Warning:** Only disable certificate verification in development environments.
235+
236+
### ImportError
237+
238+
If you get `ImportError: No module named 'easysearch'`:
239+
240+
1. Verify installation: `pip list | grep easysearch`
241+
2. Check Python version: `python --version`
242+
3. Ensure you're using the correct Python environment
243+
244+
### Connection Refused
245+
246+
If you cannot connect to Easysearch:
247+
248+
1. Verify Easysearch is running: `curl http://localhost:9200`
249+
2. Check the host and port in your connection string
250+
3. Verify firewall settings
251+
252+
---
253+
254+
## Uninstallation
255+
256+
To remove the Easysearch Python client:
257+
258+
```bash
259+
pip uninstall easysearch
260+
```
261+
262+
---
263+
264+
## Next Steps
265+
266+
- Read the [Quick Start Guide](README.rst)
267+
- Check [API Documentation](docs/index.asciidoc)
268+
- View [Examples](examples/)
269+
- Report issues on [GitHub](https://github.com/infinilabs/easysearch-py/issues)

0 commit comments

Comments
 (0)