Skip to content

Commit 4b6e0e0

Browse files
author
github-actions
committed
[BUILD]: 955bbca3df9f427c5b81e5f63285b97e62552fe3
1 parent fd62067 commit 4b6e0e0

File tree

3 files changed

+22
-5
lines changed

3 files changed

+22
-5
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ GITHUB_SHA=$3
77

88
# Clone and push to the repo
99
TEMP_DIR=$(mktemp -d)
10-
TEMP_DIR_GIT="$TEMP_DIR/python-$EXCHANGE_NAME"
11-
git clone https://x-access-token:$API_TOKEN@github.com/ccxt/python-$EXCHANGE_NAME.git $TEMP_DIR_GIT
10+
TEMP_DIR_GIT="$TEMP_DIR/$EXCHANGE_NAME-python"
11+
git clone https://x-access-token:$API_TOKEN@github.com/ccxt/$EXCHANGE_NAME-python.git $TEMP_DIR_GIT
1212
rsync -av --exclude='.git' ./ $TEMP_DIR_GIT
1313
# remove all yml files except remote
1414
dir $TEMP_DIR_GIT/.github/workflows/
@@ -17,4 +17,6 @@ cd $TEMP_DIR_GIT
1717
git config user.name github-actions
1818
git config user.email [email protected]
1919
git add .
20+
rm -f README.md
21+
echo $EXCHANGE_NAME > name
2022
(git commit -m "[BUILD]: $GITHUB_SHA" && git push origin main --force) || echo "No changes to commit"

.github/workflows/remote-build.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,13 @@ jobs:
1919
# with:
2020
# node-version: '22'
2121
# cache: 'npm'
22+
# - name: Cache npm dependencies
23+
# uses: actions/cache@v3
24+
# with:
25+
# path: ~/.npm
26+
# key: ${{ runner.os }}-npm-${{ hashFiles('**/package.json') }}
27+
# restore-keys: |
28+
# ${{ runner.os }}-npm-
2229
# - name: Install dependencies
2330
# run: |
2431
# cd build
@@ -30,4 +37,12 @@ jobs:
3037
# get repository name and it's first word before hypher and pass that as argument
3138
REPO_NAME=$(echo ${{ github.repository }} | cut -d'/' -f2 | cut -d'-' -f1)
3239
echo "REPO_NAME: $REPO_NAME"
33-
# npm run build -- $REPO_NAME
40+
npm run build -- $REPO_NAME
41+
42+
- name: Commit and push changes
43+
run: |
44+
git config --local user.email "[email protected]"
45+
git config --local user.name "GitHub Action"
46+
git add README.md
47+
git commit -m "Update README with exchange repository links" || echo "No changes to commit"
48+
git push

build/build.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,13 +254,13 @@ class build {
254254
const argvs = process.argv.slice(2);
255255
let exchange = argvs[0];
256256
if (!exchange || exchange.includes('--')) {
257-
const nameFile = __dirname + '/../name';
257+
const nameFile = __dirname + '/../exchange_name';
258258
if (fs.existsSync(nameFile)) {
259259
exchange = fs.readFileSync(nameFile, 'utf8').trim();
260260
}
261261
}
262262
if (!exchange) {
263-
console.error('Please input exchange name in a "name" file in the root of the project');
263+
console.error('Please pass exchange name to build script or set it in a "exchange_name" file in the root of the project');
264264
process.exit(1);
265265
}
266266
const donwloadAndDelete = !argvs.includes('--nodownload');

0 commit comments

Comments
 (0)