Repository navigation
changed ci #50
Workflow file for this run
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: Build and Deploy Packages | ||
| on: | ||
| push: | ||
| tags: | ||
| - 'v[0-9]*' | ||
| - feature/ci_test | ||
| workflow_dispatch: | ||
| # Define matrix configurations as YAML anchors for reuse | ||
| # Note: These are defined at the top level for easy maintenance | ||
| x-python-versions: &python-versions ["3.10", "3.11", "3.12", "3.13", "3.14"] | ||
| x-windows-matrix: &windows-matrix | ||
| - python-version: "3.10" | ||
| python-tag: "310" | ||
| architecture: "AMD64" | ||
| - python-version: "3.11" | ||
| python-tag: "311" | ||
| architecture: "AMD64" | ||
| - python-version: "3.12" | ||
| python-tag: "312" | ||
| architecture: "AMD64" | ||
| - python-version: "3.13" | ||
| python-tag: "313" | ||
| architecture: "AMD64" | ||
| - python-version: "3.14" | ||
| python-tag: "314" | ||
| architecture: "AMD64" | ||
| jobs: | ||
| wheels-windows: | ||
| runs-on: windows-latest | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| include: *windows-matrix | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Set up Python ${{ matrix.python-version }} | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
| - uses: bus1/cabuild/action/msdevshell@v1 | ||
| with: | ||
| architecture: x64 | ||
| if: matrix.architecture == 'AMD64' | ||
| - uses: bus1/cabuild/action/msdevshell@v1 | ||
| with: | ||
| architecture: x86 | ||
| if: matrix.architecture == 'x86' | ||
| - name: Generate meson files | ||
| run: | | ||
| python scripts/generate_meson.py ./src/dbzero/ core | ||
| python scripts/generate_meson_tests.py tests/ | ||
| - name: Configure git | ||
| run: | | ||
| git config --global user.email "ci@example.com" | ||
| git config --global user.name "CI Builder" | ||
| rm .gitignore | ||
| git add . && git commit -m "Update meson files for build" | ||
| - run: pip3 install pipx | ||
| - run: pipx run cibuildwheel | ||
| env: | ||
| CIBW_BUILD: cp${{ matrix.python-tag }}-* | ||
| CIBW_ARCHS_WINDOWS: ${{ matrix.architecture }} | ||
| - uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: wheels-windows-${{ matrix.python-version }} | ||
| path: wheelhouse/*.whl | ||
| wheels-linux: | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| python-version: *python-versions | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Set up Python ${{ matrix.python-version }} | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
| - uses: actions/checkout@v3 | ||
| - run: python3 scripts/generate_meson.py ./src/dbzero/ core | ||
| - run: python3 scripts/generate_meson_tests.py tests/ | ||
| - run: git config --global user.email "you@example.com" | ||
| - run: git config --global user.name "Your Name" | ||
| - run: rm .gitignore | ||
| - run: git add . && git commit -m "Update meson files" | ||
| - run: pip install build | ||
| - run: python3 -m build | ||
| env: | ||
| CIBW_SKIP: pp* cp36-* *-musllinux* | ||
| CIBW_ARCHS_MACOS: x86_64 arm64 | ||
| CIBW_ARCHS_LINUX: x86_64 aarch64 | ||
| CIBW_ARCHS_WINDOWS: ${{ matrix.architecture }} | ||
| - uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: wheels-linux-${{ matrix.python-version }} | ||
| path: dist/*.whl | ||
| test-wheels-windows: | ||
| runs-on: windows-latest | ||
| needs: wheels-windows | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| include: *windows-matrix | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Set up Python ${{ matrix.python-version }} | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
| - name: Download wheel artifact | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| name: wheels-windows-${{ matrix.python-version }} | ||
| path: ./wheels/ | ||
| - name: Install wheel and dependencies | ||
| run: | | ||
| pip install pytest | ||
| pip install requirements.txt | ||
| pip install ./wheels/*.whl | ||
| - name: Run tests | ||
| run: | | ||
| python -m pytest -m 'not integration_test' -m 'not stress_test' -c pytest.ini --capture=no -vv | ||
| test-wheels-linux: | ||
| runs-on: ubuntu-latest | ||
| needs: wheels-linux | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| python-version: *python-versions | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Set up Python ${{ matrix.python-version }} | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
| - name: Download wheel artifact | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| name: wheels-linux-${{ matrix.python-version }} | ||
| path: ./wheels/ | ||
| - name: Install wheel and dependencies | ||
| run: | | ||
| pip install pytest | ||
| pip install -r requirements.txt | ||
| pip install ./wheels/*.whl | ||
| - name: Run tests | ||
| run: | | ||
| python -m pytest -m 'not integration_test' -m 'not stress_test' -c pytest.ini --capture=no -vv | ||
| sdist: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Generate meson files | ||
| run: | | ||
| python scripts/generate_meson.py ./src/dbzero/ core | ||
| python scripts/generate_meson_tests.py tests/ | ||
| - name: Configure git | ||
| run: | | ||
| git config --global user.email "ci@example.com" | ||
| git config --global user.name "CI Builder" | ||
| rm -f .gitignore | ||
| git add . && git commit -m "Update meson files for build" | ||
| - run: python -m pip install build meson | ||
| - run: python -m build --sdist | ||
| - uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: sdist | ||
| path: dist/*.tar.gz | ||
| deploy-to-pypi: | ||
| name: Deploy to PyPI (Manual) | ||
| runs-on: ubuntu-latest | ||
| needs: [sdist, wheels-linux, wheels-windows, test-wheels-linux, test-wheels-windows] | ||
| if: github.event_name == 'workflow_dispatch' | ||
| environment: pypi-deployment | ||
| permissions: | ||
| id-token: write | ||
| contents: read | ||
| steps: | ||
| - name: Download all artifacts | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| path: ./dist/ | ||
| - name: Flatten artifact structure | ||
| run: | | ||
| mkdir -p ./upload/ | ||
| find ./dist/ -name "*.whl" -exec cp {} ./upload/ \; | ||
| find ./dist/ -name "*.tar.gz" -exec cp {} ./upload/ \; | ||
| ls -la ./upload/ | ||
| - name: Publish to PyPI | ||
| uses: pypa/gh-action-pypi-publish@release/v1 | ||
| with: | ||
| repository-url: http://ec2-35-178-225-110.eu-west-2.compute.amazonaws.com:8081/repository/dbzero/ | ||
| user: admin | ||
| password: P@ssword123 | ||
| packages-dir: ./upload/ | ||
| verbose: true | ||
| skip-existing: true | ||
| attestations: false | ||