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