summaryrefslogtreecommitdiffstats
path: root/.github/workflows/deploy-pypi-nightly.yml
blob: 3a3f653df003568740b94166456bd15fd05f2576 (plain)
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
name: Deploy to PyPI - Nightly

on: workflow_dispatch

concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

jobs:
  deploy-nightly-pypi:
    name: Build and publish nightly distributions 📦 to PyPI
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v3
      - name: Setup Python 3.9
        uses: actions/setup-python@v4
        with:
          python-version: "3.9"

      - name: Install pypa/build
        run: >-
          python -m
          pip install
          build

      - name: OpenBB Platform - Update version in pyproject.toml and Edit docs
        run: |
          sed -i 's/name = ".*"/name = "openbb-nightly"/' openbb_platform/pyproject.toml
          sed -i "3s/version = \"\(.*\)\"/version = \"\1.dev$(date +%Y%m%d%H%M)\"/" openbb_platform/pyproject.toml

      - name: OpenBB Platform - Create the dinamically generated wheel
        run: |
          python -m pip install poetry toml
          python build/pypi/openbb_platform/nightly.py

      - name: OpenBB Platform - Publish distribution 📦 to PyPI
        uses: pypa/gh-action-pypi-publish@release/v1
        with:
          packages-dir: openbb_platform/dist/
          password: ${{ secrets.NIGHTLY_PYPI_API_TOKEN }}