Skip to content

updated dump_models_schema.py #117

updated dump_models_schema.py

updated dump_models_schema.py #117

name: On PR against Main Branch
on:
pull_request:
branches:
- main
jobs:
pytest:
permissions: write-all
strategy:
matrix:
python-versions:
- "3.9"
- "3.10"
- "3.11"
hosts:
- 'windows-latest'
- 'ubuntu-latest'
- 'macos-latest'
runs-on: ${{ matrix.hosts }}
steps:
- uses: actions/checkout@v3
- name: Run Pytest
id: run-pytest
uses: ./.github/actions/run-pytest
with:
python-version: ${{ matrix.python-versions }}
host: ${{ matrix.hosts }}
check-pypi:
permissions: write-all
needs:
- pytest
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Check if Package already exists on PyPI
id: check-pypi
uses: ./.github/actions/check-if-package-exists-on-pypi
with:
python-version: "3.10"
- name: Show Package Already Exists WARNING Message
if: steps.check-pypi.outputs.exists == 'True'
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: ' :warning: Package with version ***${{ steps.check-pypi.outputs.version }}*** already exists on PYPI!! Please bump your version!!! :warning: '
});
publish-to-ghrelease:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-python@v3
with:
python-version: ${{ inputs.python-version }}
- name: Dump release version
id: set-version
run: |
make output_file_path=version.txt dump_release_version
cat ./version.txt >> $GITHUB_OUTPUT
- name: Publish to Github Release
uses: ./.github/actions/publish-to-ghrelease
with:
gh-release-tag-name: ${{ steps.set-version.outputs.version }}
gh-release-release-name: Release ${{ steps.set.outputs.version }}
gh-token: ${{ secrets.GITHUB_TOKEN }}