diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fac8c25..138761b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -122,9 +122,10 @@ jobs: name: opencv-${{ matrix.os }} path: ./opencv - - uses: actions/setup-python@main + - uses: pdm-project/setup-pdm@main with: python-version: ${{ matrix.python }} + cache: true - uses: ilammy/msvc-dev-cmd@v1 id: msvc-env @@ -143,12 +144,11 @@ jobs: echo "OpenCV_DIR=$(pwd)/opencv/lib/cmake/opencv4" >> $GITHUB_ENV echo "OpenCV_STATIC=ON" >> $GITHUB_ENV + - name: Install dependencies + run: pdm install -G :all + - name: Build wheel - env: - VERBOSE: 1 - run: | - pip install poetry - poetry build --format wheel + run: pdm build -v - uses: actions/upload-artifact@main with: @@ -195,26 +195,18 @@ jobs: name: wheel-${{matrix.os}}-${{matrix.python}} path: ./dist - - uses: actions/setup-python@main + - uses: pdm-project/setup-pdm@main with: python-version: ${{ matrix.python }} - - - uses: ilammy/msvc-dev-cmd@v1 - id: msvc-env - if: startsWith(matrix.os, 'windows') - - - name: Install Poetry - run: | - pip install poetry + cache: true - name: Install dependencies run: | - poetry install --no-root --only=test - poetry run pip install dist/*.whl + pdm install -G :all - name: Run tests run: | - poetry run pytest + pdm run pytest cleanup: name: Cleanup artifacts @@ -244,6 +236,12 @@ jobs: if: startsWith(github.ref, 'refs/tags/v') && github.head_ref == '' runs-on: ubuntu-latest + permissions: + # This permission is needed for private repositories. + contents: read + # IMPORTANT: this permission is mandatory for trusted publishing + id-token: write + steps: - uses: actions/checkout@main @@ -252,13 +250,15 @@ jobs: name: wheel-all path: ./dist - - name: Install Poetry - run: | - pipx install poetry + - uses: pdm-project/setup-pdm@main + with: + python-version: "3" + cache: true - name: Publish to PyPI env: - POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }} + PDM_PUBLISH_USERNAME: __token__ + PDM_PUBLISH_PASSWORD: ${{ secrets.PYPI_TOKEN }} run: | - poetry build --format sdist - poetry publish --skip-existing + pdm build --no-wheel + pdm publish --skip-existing --no-build