fix: Updated to Python 3.14 and Pydantic V2 (kinda) #97
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: CI | |
| on: | |
| workflow_dispatch: | |
| pull_request: | |
| branches: [main] | |
| paths: | |
| - "smithed/**" | |
| - "requirements.lock" | |
| - "requirements-dev.lock" | |
| push: | |
| branches: [main] | |
| paths: | |
| - "smithed/**" | |
| - "pyproject.toml" | |
| - "requirements.lock" | |
| - "requirements-dev.lock" | |
| - ".github/workflows/main.yml" | |
| - "Dockerfile" | |
| jobs: | |
| ci: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ["3.11"] | |
| steps: | |
| # --------------------------------------------- | |
| # ----- gather repo ----- | |
| # --------------------------------------------- | |
| - uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 0 | |
| # --------------------------------------------- | |
| # ----- setup and install python ----- | |
| # --------------------------------------------- | |
| - name: Install the latest version of rye | |
| uses: eifinger/setup-rye@v2 | |
| with: | |
| enable-cache: true | |
| cache-prefix: "python-rye" | |
| - name: Enable uv in rye for speeeeed | |
| run: rye config --set-bool behavior.use-uv=true | |
| #---------------------------------------------- | |
| # ----- install & configure rye ----- | |
| #---------------------------------------------- | |
| - name: Cache venv | |
| id: cache-venv | |
| uses: actions/cache@v3 | |
| with: | |
| path: .venv | |
| key: venv-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('requirements.lock') }}-${{ hashFiles('requirements-dev.lock') }} | |
| restore-keys: | | |
| venv-${{ runner.os }}-${{ matrix.python-version }}- | |
| - name: Install dependencies | |
| if: steps.cache-venv.outputs.cache-hit != 'true' | |
| run: rye sync | |
| #---------------------------------------------- | |
| # ----- pass linting & tests ----- | |
| #---------------------------------------------- | |
| - name: Run linting and style checking | |
| run: rye format --check | |
| - name: Run unit tests | |
| run: rye test -v | |
| # --------------------------------------------- | |
| # ----- Release Package ----- | |
| # --------------------------------------------- | |
| - name: Release | |
| if: | | |
| github.repository == 'Smithed-MC/smithed-python' | |
| && github.event_name == 'push' | |
| && github.ref == 'refs/heads/main' | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| TWINE_USERNAME: __token__ | |
| TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} | |
| TWINE_NON_INTERACTIVE: true | |
| continue-on-error: true | |
| run: | | |
| . .venv/bin/activate | |
| git config --global user.name "github-actions" | |
| git config --global user.email "[email protected]" | |
| semantic-release version | |
| twine upload dist/* | |
| semantic-release publish | |
| # --------------------------------------------- | |
| # ----- Push to prod ----- | |
| # --------------------------------------------- | |
| - name: Deploy to DevOps | |
| if: | | |
| github.repository == 'Smithed-MC/smithed-python' | |
| && github.event_name == 'push' | |
| && github.ref == 'refs/heads/main' | |
| uses: peter-evans/repository-dispatch@v2 | |
| with: | |
| token: ${{ secrets.PAT }} | |
| repository: Smithed-MC/DevOps | |
| event-type: update | |
| client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}", "module": "weld", "branch": "main"}' |