[VAN-122988] Updated merging branch #7
Workflow file for this run
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
name: Publish Python SDK to PyPI | ||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
types: | ||
- opened | ||
branches: | ||
- main | ||
jobs: | ||
name: Publish Python SDK to PyPI | ||
publish_package: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
package-dir: | ||
- src/visier.sdk.api.data_version_export | ||
# TODO add all packages | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.event.pull_request.head.ref || github.ref_name }} | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install setuptools wheel twine | ||
- name: Build and publish packages | ||
env: | ||
TWINE_USERNAME: __token__ | ||
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} | ||
run: | | ||
cd ${{ matrix.package-dir }} | ||
python setup.py sdist bdist_wheel | ||
python -m twine upload dist/* | ||
merge_pr: | ||
name: Merge PR | ||
runs-on: ubuntu-latest | ||
if: github.event_name == 'pull_request' | ||
steps: | ||
- name: Merge PR | ||
env: | ||
GH_TOKEN: ${{ secrets.GH_TOKEN }} | ||
run: | | ||
gh pr merge ${{ github.event.pull_request.number }} --merge --delete-branch |