Skip to content

Commit 1399649

Browse files
committed
fixing ci and publishing in pypi
1 parent 61dec31 commit 1399649

4 files changed

Lines changed: 73 additions & 2 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@ jobs:
2020
- name: Sanity
2121
run: |
2222
python -c "from omniq.client import OmniqClient; print('import ok')"
23-
test -f scripts/enqueue.lua
23+
test -f scripts/scripts/enqueue.lua
2424
echo "OK"

.github/workflows/workflow.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Publish to PyPI
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
build-and-publish:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v4
18+
with:
19+
submodules: recursive
20+
21+
- name: Set up Python
22+
uses: actions/setup-python@v5
23+
with:
24+
python-version: "3.11"
25+
26+
- name: Upgrade pip
27+
run: |
28+
python -m pip install --upgrade pip
29+
30+
- name: Install build tools
31+
run: |
32+
pip install build twine
33+
34+
- name: Build package
35+
run: |
36+
python -m build
37+
38+
- name: Validate package
39+
run: |
40+
twine check dist/*
41+
42+
- name: Publish to PyPI
43+
env:
44+
TWINE_USERNAME: __token__
45+
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
46+
run: |
47+
twine upload --skip-existing dist/*

docker-compose.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
services:
2+
omniq-redis:
3+
image: redis:7.4-alpine
4+
container_name: omniq-redis
5+
ports:
6+
- "6379:6379"
7+
command: ["redis-server", "--appendonly", "yes"]
8+
volumes:
9+
- redis_data:/data
10+
11+
omniq-python:
12+
image: python:3.12-slim
13+
container_name: omniq-python
14+
working_dir: /app
15+
environment:
16+
PYTHONUNBUFFERED: "1"
17+
volumes:
18+
- ./:/app
19+
depends_on:
20+
- omniq-redis
21+
command: ["bash", "-lc", "tail -f /dev/null"]
22+
23+
volumes:
24+
redis_data:

src/omniq/scripts.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class OmniqScripts:
1919

2020
def default_scripts_dir(current_file: str) -> str:
2121
here = os.path.dirname(os.path.abspath(current_file))
22-
return os.path.abspath(os.path.join(here, "..", "..", "scripts"))
22+
return os.path.abspath(os.path.join(here, "..", "..", "scripts", "scripts"))
2323

2424
def load_scripts(r: ScriptLoader, scripts_dir: str) -> OmniqScripts:
2525
def load_one(name: str) -> str:

0 commit comments

Comments
 (0)