fix: improve OpenGauss detection to correctly disable UNLISTEN #51
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: Release | |
| on: | |
| push: | |
| tags: | |
| - "*" | |
| jobs: | |
| build-sdist: | |
| runs-on: ubuntu-latest | |
| env: | |
| PIP_DISABLE_PIP_VERSION_CHECK: 1 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 50 | |
| submodules: true | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.x" | |
| - name: Build source distribution | |
| run: | | |
| pip install -U setuptools wheel pip | |
| python setup.py sdist | |
| - name: Upload sdist artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: dist-sdist | |
| path: dist/*.tar.* | |
| build-wheels-matrix: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| include: ${{ steps.set-matrix.outputs.include }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.x" | |
| - run: pip install cibuildwheel==2.21.3 | |
| - id: set-matrix | |
| run: | | |
| MATRIX_INCLUDE=$( | |
| { | |
| cibuildwheel --print-build-identifiers --platform linux --arch x86_64,aarch64 | grep cp | jq -nRc '{"only": inputs, "os": "ubuntu-latest"}' \ | |
| && cibuildwheel --print-build-identifiers --platform macos --arch x86_64,arm64 | grep cp | jq -nRc '{"only": inputs, "os": "macos-latest"}' \ | |
| && cibuildwheel --print-build-identifiers --platform windows --arch x86,AMD64 | grep cp | jq -nRc '{"only": inputs, "os": "windows-latest"}' | |
| } | jq -sc | |
| ) | |
| echo "include=$MATRIX_INCLUDE" >> $GITHUB_OUTPUT | |
| build-wheels: | |
| needs: build-wheels-matrix | |
| runs-on: ${{ matrix.os }} | |
| name: Build ${{ matrix.only }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: ${{ fromJson(needs.build-wheels-matrix.outputs.include) }} | |
| defaults: | |
| run: | |
| shell: bash | |
| env: | |
| PIP_DISABLE_PIP_VERSION_CHECK: 1 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 50 | |
| submodules: true | |
| - name: Set up QEMU | |
| if: runner.os == 'Linux' | |
| uses: docker/setup-qemu-action@v2 | |
| - uses: pypa/cibuildwheel@7940a4c0e76eb2030e473a5f864f291f63ee879b | |
| with: | |
| only: ${{ matrix.only }} | |
| env: | |
| CIBW_BUILD_VERBOSITY: 1 | |
| - name: Upload wheel artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: dist-wheels-${{ matrix.only }} | |
| path: wheelhouse/*.whl | |
| publish: | |
| needs: [build-sdist, build-wheels] | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: pypi | |
| url: https://pypi.org/p/async_gaussdb | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 5 | |
| submodules: false | |
| - name: Download sdist artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: dist-sdist | |
| path: dist/ | |
| - name: Download all wheel artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| pattern: dist-wheels-* | |
| path: dist/ | |
| - name: Extract Release Version | |
| id: relver | |
| run: | | |
| set -e | |
| echo "version=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT | |
| - name: Prepare all_dist directory | |
| run: mkdir all_dist | |
| - name: Move artifacts to all_dist | |
| run: | | |
| ls dist/dist-wheels-cp310-macosx_arm64/ | |
| mv dist/**/*.whl all_dist/ | |
| mv dist/*.tar.gz all_dist/ | |
| ls -l all_dist/ | |
| - name: Upload all dist/* to GitHub Release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| files: all_dist/* | |
| - name: Upload to PyPI | |
| if: startsWith(github.ref, 'refs/tags/') | |
| run: | | |
| pip install --upgrade twine setuptools wheel twine packaging | |
| twine upload all_dist/* | |
| env: | |
| TWINE_USERNAME: __token__ | |
| TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} |