feat: update logic for deterministic rules for nested fields (#1524) #1136
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 | |
| id-token: write | |
| actions: write | |
| 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 | |
| # --- Tier 0: uipath-core (no internal dependencies) --- | |
| build-uipath-core: | |
| needs: detect-publishable-packages | |
| if: contains(fromJson(needs.detect-publishable-packages.outputs.packages), 'uipath-core') | |
| uses: ./.github/workflows/build-package.yml | |
| with: | |
| package: uipath-core | |
| needs-relock: false | |
| publish-uipath-core: | |
| name: Publish uipath-core | |
| needs: [detect-publishable-packages, build-uipath-core] | |
| if: contains(fromJson(needs.detect-publishable-packages.outputs.packages), 'uipath-core') | |
| runs-on: ubuntu-latest | |
| environment: pypi | |
| permissions: | |
| contents: read | |
| id-token: write | |
| steps: | |
| - name: Retrieve release distributions | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: release-dists-uipath-core | |
| path: dist/ | |
| - name: Publish package distributions to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| verbose: true | |
| skip-existing: true | |
| wait-for-uipath-core: | |
| name: Wait for uipath-core on PyPI | |
| needs: [detect-publishable-packages, publish-uipath-core] | |
| if: | | |
| always() && | |
| (contains(fromJson(needs.detect-publishable-packages.outputs.packages), 'uipath-platform') || | |
| contains(fromJson(needs.detect-publishable-packages.outputs.packages), 'uipath')) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| if: contains(fromJson(needs.detect-publishable-packages.outputs.packages), 'uipath-core') | |
| uses: actions/checkout@v4 | |
| - name: Setup Python | |
| if: contains(fromJson(needs.detect-publishable-packages.outputs.packages), 'uipath-core') | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Wait for uipath-core | |
| if: contains(fromJson(needs.detect-publishable-packages.outputs.packages), 'uipath-core') | |
| run: python .github/scripts/wait_for_pypi.py uipath-core | |
| - name: Skip | |
| if: "!contains(fromJson(needs.detect-publishable-packages.outputs.packages), 'uipath-core')" | |
| run: echo "uipath-core not being published — skipping wait" | |
| # --- Tier 1: uipath-platform (depends on core) --- | |
| build-uipath-platform: | |
| needs: [detect-publishable-packages, wait-for-uipath-core] | |
| if: | | |
| always() && | |
| contains(fromJson(needs.detect-publishable-packages.outputs.packages), 'uipath-platform') | |
| uses: ./.github/workflows/build-package.yml | |
| with: | |
| package: uipath-platform | |
| needs-relock: true | |
| publish-uipath-platform: | |
| name: Publish uipath-platform | |
| needs: [detect-publishable-packages, build-uipath-platform] | |
| if: | | |
| always() && | |
| contains(fromJson(needs.detect-publishable-packages.outputs.packages), 'uipath-platform') | |
| runs-on: ubuntu-latest | |
| environment: pypi | |
| permissions: | |
| contents: read | |
| id-token: write | |
| steps: | |
| - name: Retrieve release distributions | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: release-dists-uipath-platform | |
| path: dist/ | |
| - name: Publish package distributions to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| verbose: true | |
| skip-existing: true | |
| wait-for-uipath-platform: | |
| name: Wait for uipath-platform on PyPI | |
| needs: [detect-publishable-packages, publish-uipath-platform] | |
| if: | | |
| always() && | |
| contains(fromJson(needs.detect-publishable-packages.outputs.packages), 'uipath') | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| if: contains(fromJson(needs.detect-publishable-packages.outputs.packages), 'uipath-platform') | |
| uses: actions/checkout@v4 | |
| - name: Setup Python | |
| if: contains(fromJson(needs.detect-publishable-packages.outputs.packages), 'uipath-platform') | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Wait for uipath-platform | |
| if: contains(fromJson(needs.detect-publishable-packages.outputs.packages), 'uipath-platform') | |
| run: python .github/scripts/wait_for_pypi.py uipath-platform | |
| - name: Skip | |
| if: "!contains(fromJson(needs.detect-publishable-packages.outputs.packages), 'uipath-platform')" | |
| run: echo "uipath-platform not being published — skipping wait" | |
| # --- Tier 2: uipath (depends on core + platform) --- | |
| build-uipath: | |
| needs: [detect-publishable-packages, wait-for-uipath-platform] | |
| if: | | |
| always() && | |
| contains(fromJson(needs.detect-publishable-packages.outputs.packages), 'uipath') | |
| uses: ./.github/workflows/build-package.yml | |
| with: | |
| package: uipath | |
| needs-relock: true | |
| secrets: | |
| APPLICATIONINSIGHTS_CONNECTION_STRING: ${{ secrets.APPLICATIONINSIGHTS_CONNECTION_STRING }} | |
| publish-uipath: | |
| name: Publish uipath | |
| needs: [detect-publishable-packages, build-uipath] | |
| if: | | |
| always() && | |
| contains(fromJson(needs.detect-publishable-packages.outputs.packages), 'uipath') | |
| runs-on: ubuntu-latest | |
| environment: pypi | |
| permissions: | |
| contents: read | |
| id-token: write | |
| steps: | |
| - name: Retrieve release distributions | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: release-dists-uipath | |
| path: dist/ | |
| - name: Publish package distributions to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| verbose: true | |
| skip-existing: true |