Upgrade pydantic to 2.x #34
This file contains hidden or 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 to test pypi | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| release: | |
| types: [published] | |
| workflow_dispatch: | |
| inputs: | |
| test_deploy: | |
| description: 'test deploy to https://test.pypi.org' | |
| required: false | |
| default: 'false' | |
| jobs: | |
| unittest: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.10", "3.11"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| cache: pip | |
| - name: Install dependency | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -e .[dev] | |
| - name: Run Test | |
| run: | | |
| python -m pytest -ra | |
| deploy: | |
| needs: unittest | |
| if: github.event.inputs.test_deploy == 'true' | |
| runs-on: ubuntu-latest | |
| environment: testpypi | |
| permissions: | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.10" | |
| cache: pip | |
| - name: Install dependency | |
| run: | | |
| python -m pip install --upgrade pip build | |
| echo "::notice:: pip list" | |
| pip list | |
| - name: Build package | |
| id: build_package | |
| run: | | |
| python -m build | |
| echo "::notice:: ls -al dist" | |
| ls -al dist | |
| - name: Publish package | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| verbose: true | |
| repository-url: https://test.pypi.org/legacy/ |