Skip to content

Commit 94c0aee

Browse files
author
github-actions
committed
[TRANSFER]
0 parents  commit 94c0aee

18 files changed

+1066
-0
lines changed

.github/scripts/generate-exchange.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/bash
2+
3+
# for easy testing, we can make this script separate
4+
TEMP_DIR_GIT=$1
5+
EXCHANGE_NAME=$2
6+
7+
echo "Generating exchange repository for $EXCHANGE_NAME in $TEMP_DIR_GIT"
8+
9+
# just for caution (to avoid accidental mistake) TEMP_DIR_GIT should contain either `tmp` or `temp` in its name
10+
if [[ $TEMP_DIR_GIT != *"tmp"* ]] && [[ $TEMP_DIR_GIT != *"temp"* ]]; then
11+
echo "Error: TEMP_DIR_GIT should contain either 'tmp' or 'temp' in its name"
12+
exit 1
13+
fi
14+
15+
rm -rf $TEMP_DIR_GIT/*
16+
rsync -av --info=progress2 --info=name0 --exclude='.git/' --exclude='build/ccxt/' ./ $TEMP_DIR_GIT
17+
rm -f $TEMP_DIR_GIT/.github/workflows/transfer-all.yml
18+
rm -f $TEMP_DIR_GIT/.github/workflows/transfer-exchange.yml
19+
rm -r $TEMP_DIR_GIT/.vscode/
20+
rm -f $TEMP_DIR_GIT/vsc-workspace.code-workspace
21+
rm -f $TEMP_DIR_GIT/README.md
22+
echo $EXCHANGE_NAME > $TEMP_DIR_GIT/exchange_name

.github/scripts/push-to-repo.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/bash
2+
3+
# Get arguments
4+
EXCHANGE_NAME=$1
5+
COMMIT_MSG=$2
6+
7+
# Clone and push to the repo
8+
TEMP_DIR=$(mktemp -d)
9+
TEMP_DIR_GIT="$TEMP_DIR/$EXCHANGE_NAME-python"
10+
echo "Cloning $EXCHANGE_NAME-python repository into $TEMP_DIR_GIT"
11+
git clone https://x-access-token:$GITHUB_API_TOKEN@github.com/ccxt/$EXCHANGE_NAME-python.git $TEMP_DIR_GIT
12+
# at first, clean th directory (except .git directory) and copy all files
13+
echo "Clone finished"
14+
chmod +x .github/scripts/generate-exchange.sh
15+
.github/scripts/generate-exchange.sh $TEMP_DIR_GIT $EXCHANGE_NAME
16+
cd $TEMP_DIR_GIT
17+
git config user.name github-actions
18+
git config user.email github-actions@github.com
19+
git add .
20+
(git commit -m "$COMMIT_MSG" && git push origin main --force) || echo "No changes to commit"

.github/scripts/pushback.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
3+
git config --local user.email "action@github.com"
4+
git config --local user.name "GitHub Action"
5+
git add README.md
6+
git commit -m "Update README with exchange repository links" || echo "No changes to commit"
7+
git push
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: build
2+
on:
3+
push:
4+
branches:
5+
- main
6+
7+
jobs:
8+
build_for_pypi:
9+
if: ${{ github.event.repository.name != 'ccxt-python-single-exchange' && contains(github.event.head_commit.message, '[BUILD]') }}
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v4
14+
with:
15+
ref: ${{ github.ref }}
16+
- name: Install npm
17+
uses: actions/setup-node@v4
18+
with:
19+
node-version: '22'
20+
- name: Install dependencies
21+
run: |
22+
cd build
23+
npm install
24+
npm install typescript
25+
26+
- name: Build
27+
run: |
28+
cd build
29+
# get repository name and it's first word before hyphen and pass that as argument
30+
REPO_NAME=$(echo ${{ github.repository }} | cut -d'/' -f2 | cut -d'-' -f1)
31+
npm run build -- $REPO_NAME
32+
33+
- name: Commit and push back changes
34+
run: |
35+
chmod +x .github/scripts/pushback.sh
36+
.github/scripts/pushback.sh
37+
38+
- name: Set up Python
39+
if: contains(github.event.head_commit.message, '[PUBLISH]')
40+
uses: actions/setup-python@v4
41+
with:
42+
python-version: '3.x'
43+
44+
- name: Install dependencies
45+
if: contains(github.event.head_commit.message, '[PUBLISH]')
46+
run: |
47+
python -m pip install --upgrade pip
48+
pip install build twine
49+
50+
- name: PyPi packager
51+
if: contains(github.event.head_commit.message, '[PUBLISH]')
52+
env:
53+
PYPI_API_SECRET_SP: ${{ secrets.PYPI_API_SECRET_SP }}
54+
run: |
55+
cd build
56+
npm run pypi-packager
57+
58+
- name: PyPi upload
59+
run: |
60+
cd ./temp_pypi
61+
python -m twine upload dist/*
62+
env:
63+
TWINE_USERNAME: __token__
64+
TWINE_PASSWORD: ${{ secrets.PYPI_API_SECRET_SP }}

.gitignore

Lines changed: 177 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,177 @@
1+
node_modules/
2+
3+
# Byte-compiled / optimized / DLL files
4+
__pycache__/
5+
*.py[cod]
6+
*$py.class
7+
8+
# C extensions
9+
*.so
10+
11+
# Distribution / packaging
12+
.Python
13+
# build/
14+
develop-eggs/
15+
dist/
16+
downloads/
17+
eggs/
18+
.eggs/
19+
lib/
20+
lib64/
21+
parts/
22+
sdist/
23+
var/
24+
wheels/
25+
share/python-wheels/
26+
*.egg-info/
27+
.installed.cfg
28+
*.egg
29+
MANIFEST
30+
31+
# PyInstaller
32+
# Usually these files are written by a python script from a template
33+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
34+
*.manifest
35+
*.spec
36+
37+
# Installer logs
38+
pip-log.txt
39+
pip-delete-this-directory.txt
40+
41+
# Unit test / coverage reports
42+
htmlcov/
43+
.tox/
44+
.nox/
45+
.coverage
46+
.coverage.*
47+
.cache
48+
nosetests.xml
49+
coverage.xml
50+
*.cover
51+
*.py,cover
52+
.hypothesis/
53+
.pytest_cache/
54+
cover/
55+
56+
# Translations
57+
*.mo
58+
*.pot
59+
60+
# Django stuff:
61+
*.log
62+
local_settings.py
63+
db.sqlite3
64+
db.sqlite3-journal
65+
66+
# Flask stuff:
67+
instance/
68+
.webassets-cache
69+
70+
# Scrapy stuff:
71+
.scrapy
72+
73+
# Sphinx documentation
74+
docs/_build/
75+
76+
# PyBuilder
77+
.pybuilder/
78+
target/
79+
80+
# Jupyter Notebook
81+
.ipynb_checkpoints
82+
83+
# IPython
84+
profile_default/
85+
ipython_config.py
86+
87+
# pyenv
88+
# For a library or package, you might want to ignore these files since the code is
89+
# intended to run in multiple environments; otherwise, check them in:
90+
# .python-version
91+
92+
# pipenv
93+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
94+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
95+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
96+
# install all needed dependencies.
97+
#Pipfile.lock
98+
99+
# UV
100+
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
101+
# This is especially recommended for binary packages to ensure reproducibility, and is more
102+
# commonly ignored for libraries.
103+
#uv.lock
104+
105+
# poetry
106+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
107+
# This is especially recommended for binary packages to ensure reproducibility, and is more
108+
# commonly ignored for libraries.
109+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
110+
#poetry.lock
111+
112+
# pdm
113+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
114+
#pdm.lock
115+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
116+
# in version control.
117+
# https://pdm.fming.dev/latest/usage/project/#working-with-version-control
118+
.pdm.toml
119+
.pdm-python
120+
.pdm-build/
121+
122+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
123+
__pypackages__/
124+
125+
# Celery stuff
126+
celerybeat-schedule
127+
celerybeat.pid
128+
129+
# SageMath parsed files
130+
*.sage.py
131+
132+
# Environments
133+
.env
134+
.venv
135+
env/
136+
venv/
137+
ENV/
138+
env.bak/
139+
venv.bak/
140+
141+
# Spyder project settings
142+
.spyderproject
143+
.spyproject
144+
145+
# Rope project settings
146+
.ropeproject
147+
148+
# mkdocs documentation
149+
/site
150+
151+
# mypy
152+
.mypy_cache/
153+
.dmypy.json
154+
dmypy.json
155+
156+
# Pyre type checker
157+
.pyre/
158+
159+
# pytype static type analyzer
160+
.pytype/
161+
162+
# Cython debug symbols
163+
cython_debug/
164+
165+
# PyCharm
166+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
167+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
168+
# and can be added to the global gitignore or merged into this file. For a more nuclear
169+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
170+
#.idea/
171+
172+
# PyPI configuration file
173+
.pypirc
174+
175+
build/ccxt
176+
/meta.json
177+
/build/package-lock.json

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 ccxt
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)