[BUILD]: 5a4a16d4147d561f5dff900b964f77a17146a211 #2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: build | |
| on: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| build_for_pypi: | |
| if: ${{ github.event.repository.name != 'ccxt-python-single-exchange' && contains(github.event.head_commit.message, '[BUILD]') }} | |
| 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 typescript | |
| npm install tsx | |
| - name: Build | |
| run: | | |
| cd build | |
| # get repository name and it's first word before hyphen and pass that as argument | |
| REPO_NAME=$(echo ${{ github.repository }} | cut -d'/' -f2 | cut -d'-' -f1) | |
| npm run build -- $REPO_NAME | |
| - name: Commit and push changes | |
| run: | | |
| chmod +x .github/scripts/pushback.sh | |
| .github/scripts/pushback.sh | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.x' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install build twine | |
| - name: Build | |
| env: | |
| PYPI_API_SECRET: ${{ secrets.PYPI_API_SECRET }} | |
| run: | | |
| cd build | |
| npm run pypi-publish | |
| - name: Upload to PyPI | |
| run: | | |
| cd ./temp_pypi | |
| python -m twine upload dist/* | |
| env: | |
| TWINE_USERNAME: __token__ | |
| TWINE_PASSWORD: ${{ secrets.PYPI_API_SECRET }} |