Merge pull request #380 from datayoga-io/379-relationalwrite-handle-m… #125
This file contains 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
# This workflows will upload a Python Packages upon merge | |
name: upload python packages | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
publish-pypi: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repository code | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.8" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install setuptools wheel poetry twine bump2version | |
# bump version type based on branch | |
- if: github.ref == 'refs/heads/main' | |
run: | | |
echo "BUMP_TYPE=minor" >> $GITHUB_ENV | |
- if: github.ref != 'refs/heads/main' | |
run: | | |
echo "BUMP_TYPE=patch" >> $GITHUB_ENV | |
- id: bump_version | |
uses: anothrNick/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
WITH_V: true | |
DEFAULT_BUMP: ${{ env.BUMP_TYPE }} | |
- name: Update version of datayoga-core | |
run: | | |
cd core | |
bump2version --current-version 0.0.0 --allow-dirty --new-version "${{ steps.bump_version.outputs.new_tag }}" patch pyproject.toml | |
- name: Update version of datayoga (CLI) | |
run: | | |
cd cli | |
bump2version --current-version 0.0.0 --allow-dirty --new-version "${{ steps.bump_version.outputs.new_tag }}" patch pyproject.toml | |
# | |
# build | |
# | |
- name: Build datayoga-core | |
run: | | |
cd core | |
poetry build | |
- name: Publish datayoga-core package | |
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_TOKEN }} | |
packages_dir: core/dist/ | |
- name: "Build CLI" | |
run: | | |
cd cli | |
poetry build | |
- name: Publish datayoga (CLI) package | |
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_TOKEN }} | |
packages_dir: cli/dist/ |