diff --git a/.github/actions/setup-python-env/action.yml b/.github/actions/setup-python-env/action.yml deleted file mode 100644 index a4936e49..00000000 --- a/.github/actions/setup-python-env/action.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: "Setup Python Environment" -description: "Checks out code, installs uv, and sets up Python" -runs: - using: "composite" - steps: - - name: Install uv - uses: astral-sh/setup-uv@v5 - with: - enable-cache: true - - - name: "Set up Python" - uses: actions/setup-python@v5 - with: - python-version-file: ".python-version" - - - name: "Setup venv" - shell: bash - run: | - uv venv - - - name: "Install the project" - shell: bash - run: uv sync --all-extras diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a0b13e4f..660e5ecf 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -5,21 +5,11 @@ on: secrets: token: required: true - inputs: - folder_path: - description: 'The folder path to run actions in' - required: true - type: string jobs: build: name: Build and publish - if: github.ref == 'refs/heads/main' runs-on: "ubuntu-24.04" - defaults: - run: - working-directory: ${{ inputs.folder_path }} - steps: - uses: actions/checkout@v4 @@ -39,7 +29,17 @@ jobs: run: | uv build + - name: Check if version in pyproject.toml was modified + id: check_version + run: | + if git diff --name-only ${{ github.sha }} ${{ github.event.before }} | grep -q 'pyproject.toml'; then + echo "modified=true" >> $GITHUB_OUTPUT + else + echo "modified=false" >> $GITHUB_OUTPUT + fi + - name: "Publish" + if: ${{ steps.check_version.outputs.modified }} == 'true' run: | uv publish env: diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml new file mode 100644 index 00000000..0a1a5af9 --- /dev/null +++ b/.github/workflows/cd.yml @@ -0,0 +1,14 @@ +name: CD + +on: + workflow_run: + workflows: ["Core CI"] + types: + - completed + +jobs: + build: + if: ${{ github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event == 'push' && github.event.workflow_run.head_branch == 'main' }} + uses: ./.github/workflows/build.yml + secrets: + token: ${{ secrets.PYPI_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/langchain_ci.yml b/.github/workflows/ci.yml similarity index 56% rename from .github/workflows/langchain_ci.yml rename to .github/workflows/ci.yml index b45ec691..fb1cc55f 100644 --- a/.github/workflows/langchain_ci.yml +++ b/.github/workflows/ci.yml @@ -1,38 +1,22 @@ -name: Langchain CI +name: Core CI on: workflow_dispatch: {} push: branches: - main - paths: - - "src/**" pull_request: branches: - main - paths: - - "src/**" jobs: lint: uses: ./.github/workflows/lint.yml - with: - folder_path: "." test: uses: ./.github/workflows/test.yml - with: - folder_path: "." secrets: UIPATH_URL: ${{ secrets.UIPATH_URL }} UIPATH_CLIENT_ID: ${{ secrets.UIPATH_CLIENT_ID }} UIPATH_CLIENT_SECRET: ${{ secrets.UIPATH_CLIENT_SECRET }} - - build: - needs: [lint, test] - uses: ./.github/workflows/build.yml - with: - folder_path: "." - secrets: - token: ${{ secrets.PYPI_TOKEN }} diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 35e0d172..b09f54e0 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -3,10 +3,6 @@ name: Reusable Lint Workflow on: workflow_call: inputs: - folder_path: - description: 'The folder path to run actions in' - required: true - type: string should_skip: description: 'Whether to skip the linting step' required: false @@ -18,9 +14,6 @@ jobs: name: Lint runs-on: "ubuntu-24.04" if: inputs.should_skip == false - defaults: - run: - working-directory: ${{ inputs.folder_path }} steps: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 77cdf761..3fb3accc 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -10,10 +10,6 @@ on: UIPATH_CLIENT_SECRET: required: true inputs: - folder_path: - description: 'The folder path to run actions in' - required: true - type: string should_skip: description: 'Whether to skip the linting step' required: false @@ -25,9 +21,6 @@ jobs: name: Test runs-on: "ubuntu-24.04" if: inputs.should_skip == false - defaults: - run: - working-directory: ${{ inputs.folder_path }} steps: - uses: actions/checkout@v4