diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e9fc04a..9fd2860 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,22 +8,56 @@ on: branches: - master tags: '*' + release: + types: + - published jobs: build: - runs-on: ${{ matrix.os }} + runs-on: ubuntu-latest strategy: matrix: - os: ["ubuntu-latest"] python-version: ['3.8', '3.9', '3.10', '3.11'] name: Python ${{ matrix.python-version }} steps: - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} + - name: Install cbl-migrator shell: bash -l {0} - run: pip install -e . pytest + run: pip install -e . pytest twine build + - name: Run tests shell: bash -l {0} run: pytest + + - name: Build wheels + run: python3 -m build + + - name: Upload artifacts + uses: actions/upload-artifact@v3 + with: + path: dist/* + + upload_all: + name: Upload if release + runs-on: ubuntu-latest + needs: build + if: github.event_name == 'release' && github.event.action == 'published' + + steps: + - uses: actions/setup-python@v4 + with: + python-version: "3.x" + + - uses: actions/download-artifact@v3 + with: + name: artifact + path: dist + + - uses: pypa/gh-action-pypi-publish@v1.5.1 + with: + user: __token__ + password: ${{ secrets.pypi_password }} diff --git a/setup.py b/setup.py index 19d22e3..c6fcb46 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ if __name__ == "__main__": setup( name="cbl_migrator", - version="0.3.3", + version="0.3.4", author="Eloy FĂ©lix", author_email="eloyfelix@gmail.com", description="Migrates Oracle dbs to PostgreSQL, MySQL and SQLite",