feat: add Docs.GPT.Search to scopes (#1416) #1086
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: CD | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - 'packages/*/pyproject.toml' | |
| - '!packages/*/samples/**/pyproject.toml' | |
| - '!packages/*/testcases/**/pyproject.toml' | |
| permissions: | |
| contents: read | |
| pull-requests: read | |
| jobs: | |
| detect-publishable-packages: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| packages: ${{ steps.detect.outputs.packages }} | |
| count: ${{ steps.detect.outputs.count }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Detect publishable packages | |
| id: detect | |
| run: python .github/scripts/detect_publishable_packages.py | |
| build: | |
| name: Build ${{ matrix.package }} | |
| needs: detect-publishable-packages | |
| if: needs.detect-publishable-packages.outputs.count > 0 && github.repository == 'UiPath/uipath-python' | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: packages/${{ matrix.package }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| package: ${{ fromJson(needs.detect-publishable-packages.outputs.packages) }} | |
| permissions: | |
| contents: read | |
| actions: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup uv | |
| uses: astral-sh/setup-uv@v5 | |
| with: | |
| enable-cache: true | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version-file: "packages/${{ matrix.package }}/.python-version" | |
| - name: Install dependencies | |
| run: uv sync --all-extras | |
| - name: Update AGENTS.md | |
| if: matrix.package == 'uipath' | |
| run: uv run python scripts/update_agents_md.py | |
| - name: Replace connection string placeholder | |
| if: matrix.package == 'uipath' | |
| run: | | |
| originalfile="src/uipath/telemetry/_constants.py" | |
| tmpfile=$(mktemp) | |
| trap 'rm -f "$tmpfile"' EXIT | |
| rsync -a --no-whole-file --ignore-existing "$originalfile" "$tmpfile" | |
| envsubst '$CONNECTION_STRING' < "$originalfile" > "$tmpfile" && mv "$tmpfile" "$originalfile" | |
| env: | |
| CONNECTION_STRING: ${{ secrets.APPLICATIONINSIGHTS_CONNECTION_STRING }} | |
| - name: Build | |
| run: uv build --no-sources --package ${{ matrix.package }} | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: release-dists-${{ matrix.package }} | |
| path: packages/${{ matrix.package }}/dist/ | |
| pypi-publish: | |
| name: Upload ${{ matrix.package }} to PyPI | |
| needs: [detect-publishable-packages, build] | |
| runs-on: ubuntu-latest | |
| environment: pypi | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| package: ${{ fromJson(needs.detect-publishable-packages.outputs.packages) }} | |
| permissions: | |
| contents: read | |
| id-token: write | |
| steps: | |
| - name: Retrieve release distributions | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: release-dists-${{ matrix.package }} | |
| path: dist/ | |
| - name: Publish package distributions to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 |