From 0b9c396725050a9abad14fe7a299a2174ede1c18 Mon Sep 17 00:00:00 2001 From: hsm207 Date: Wed, 31 Jan 2024 10:12:08 +0000 Subject: [PATCH 01/20] make prebuild workflow resusable --- .github/workflows/prebuild.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/prebuild.yml b/.github/workflows/prebuild.yml index 861c529..2f7b28a 100644 --- a/.github/workflows/prebuild.yml +++ b/.github/workflows/prebuild.yml @@ -1,6 +1,7 @@ name: Pre-build checks on: + workflow_call: push: branches: [ main ] pull_request: From 941725c3ff75ea81d4af3dc2e5f45aa67181969b Mon Sep 17 00:00:00 2001 From: hsm207 Date: Wed, 31 Jan 2024 10:37:57 +0000 Subject: [PATCH 02/20] commet out unnecessary jobs --- .github/workflows/_release.yml | 356 ++++++++++++++++----------------- 1 file changed, 178 insertions(+), 178 deletions(-) diff --git a/.github/workflows/_release.yml b/.github/workflows/_release.yml index bd63d69..a848220 100644 --- a/.github/workflows/_release.yml +++ b/.github/workflows/_release.yml @@ -9,64 +9,64 @@ env: POETRY_VERSION: "1.7.1" jobs: - release-please: - runs-on: ubuntu-latest - permissions: - contents: write - pull-requests: write - outputs: - releases_created: ${{ steps.release.outputs.release_created }} - paths_released: ${{ steps.release.outputs.paths_released }} - prs_created: ${{ steps.release.outputs.prs_created }} - prs: ${{ steps.release.outputs.prs }} - steps: - - uses: google-github-actions/release-please-action@v4 - id: release - with: - manifest-file: ".release-please-manifest.json" - config-file: "release-please-config.json" - build: - needs: release-please - if: ${{ needs.release-please.outputs.releases_created }} - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Set up Python + Poetry ${{ env.POETRY_VERSION }} - uses: "./.github/actions/poetry_setup" - with: - python-version: ${{ env.PYTHON_VERSION }} - poetry-version: ${{ env.POETRY_VERSION }} - working-directory: . - cache-key: release - - name: Build project for distribution - run: poetry build - working-directory: . + # release-please: + # runs-on: ubuntu-latest + # permissions: + # contents: write + # pull-requests: write + # outputs: + # releases_created: ${{ steps.release.outputs.release_created }} + # paths_released: ${{ steps.release.outputs.paths_released }} + # prs_created: ${{ steps.release.outputs.prs_created }} + # prs: ${{ steps.release.outputs.prs }} + # steps: + # - uses: google-github-actions/release-please-action@v4 + # id: release + # with: + # manifest-file: ".release-please-manifest.json" + # config-file: "release-please-config.json" + # build: + # needs: release-please + # if: ${{ needs.release-please.outputs.releases_created }} + # runs-on: ubuntu-latest + # steps: + # - uses: actions/checkout@v4 + # - name: Set up Python + Poetry ${{ env.POETRY_VERSION }} + # uses: "./.github/actions/poetry_setup" + # with: + # python-version: ${{ env.PYTHON_VERSION }} + # poetry-version: ${{ env.POETRY_VERSION }} + # working-directory: . + # cache-key: release + # - name: Build project for distribution + # run: poetry build + # working-directory: . - - name: Upload build - uses: actions/upload-artifact@v3 - with: - name: dist - path: ./dist/ + # - name: Upload build + # uses: actions/upload-artifact@v3 + # with: + # name: dist + # path: ./dist/ - - name: Check Version - id: check-version - shell: bash - working-directory: . - run: | - echo pkg-name="$(poetry version | cut -d ' ' -f 1)" >> $GITHUB_OUTPUT - echo version="$(poetry version --short)" >> $GITHUB_OUTPUT + # - name: Check Version + # id: check-version + # shell: bash + # working-directory: . + # run: | + # echo pkg-name="$(poetry version | cut -d ' ' -f 1)" >> $GITHUB_OUTPUT + # echo version="$(poetry version --short)" >> $GITHUB_OUTPUT - # We want to keep this build stage *separate* from the release stage, - # so that there's no sharing of permissions between them. - # The release stage has trusted publishing and GitHub repo contents write access, - # and we want to keep the scope of that access limited just to the release job. - # Otherwise, a malicious `build` step (e.g. via a compromised dependency) - # could get access to our GitHub or PyPI credentials. - # - # Per the trusted publishing GitHub Action: - # > It is strongly advised to separate jobs for building [...] - # > from the publish job. - # https://github.com/pypa/gh-action-pypi-publish#non-goals + # # We want to keep this build stage *separate* from the release stage, + # # so that there's no sharing of permissions between them. + # # The release stage has trusted publishing and GitHub repo contents write access, + # # and we want to keep the scope of that access limited just to the release job. + # # Otherwise, a malicious `build` step (e.g. via a compromised dependency) + # # could get access to our GitHub or PyPI credentials. + # # + # # Per the trusted publishing GitHub Action: + # # > It is strongly advised to separate jobs for building [...] + # # > from the publish job. + # # https://github.com/pypa/gh-action-pypi-publish#non-goals test-pypi-publish: needs: @@ -75,147 +75,147 @@ jobs: ./.github/workflows/_test_release.yml secrets: inherit - pre-release-checks: - needs: - - build - - test-pypi-publish - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 + # pre-release-checks: + # needs: + # - build + # - test-pypi-publish + # runs-on: ubuntu-latest + # steps: + # - uses: actions/checkout@v4 - # We explicitly *don't* set up caching here. This ensures our tests are - # maximally sensitive to catching breakage. - # - # For example, here's a way that caching can cause a falsely-passing test: - # - Make the langchain package manifest no longer list a dependency package - # as a requirement. This means it won't be installed by `pip install`, - # and attempting to use it would cause a crash. - # - That dependency used to be required, so it may have been cached. - # When restoring the venv packages from cache, that dependency gets included. - # - Tests pass, because the dependency is present even though it wasn't specified. - # - The package is published, and it breaks on the missing dependency when - # used in the real world. + # # We explicitly *don't* set up caching here. This ensures our tests are + # # maximally sensitive to catching breakage. + # # + # # For example, here's a way that caching can cause a falsely-passing test: + # # - Make the langchain package manifest no longer list a dependency package + # # as a requirement. This means it won't be installed by `pip install`, + # # and attempting to use it would cause a crash. + # # - That dependency used to be required, so it may have been cached. + # # When restoring the venv packages from cache, that dependency gets included. + # # - Tests pass, because the dependency is present even though it wasn't specified. + # # - The package is published, and it breaks on the missing dependency when + # # used in the real world. - - name: Set up Python + Poetry ${{ env.POETRY_VERSION }} - uses: "./.github/actions/poetry_setup" - with: - python-version: ${{ env.PYTHON_VERSION }} - poetry-version: ${{ env.POETRY_VERSION }} - working-directory: . + # - name: Set up Python + Poetry ${{ env.POETRY_VERSION }} + # uses: "./.github/actions/poetry_setup" + # with: + # python-version: ${{ env.PYTHON_VERSION }} + # poetry-version: ${{ env.POETRY_VERSION }} + # working-directory: . - - name: Import published package - shell: bash - working-directory: . - env: - PKG_NAME: ${{ needs.build.outputs.pkg-name }} - VERSION: ${{ needs.build.outputs.version }} - # Here we use: - # - The default regular PyPI index as the *primary* index, meaning - # that it takes priority (https://pypi.org/simple) - # - The test PyPI index as an extra index, so that any dependencies that - # are not found on test PyPI can be resolved and installed anyway. - # (https://test.pypi.org/simple). This will include the PKG_NAME==VERSION - # package because VERSION will not have been uploaded to regular PyPI yet. - # - attempt install again after 5 seconds if it fails because there is - # sometimes a delay in availability on test pypi - run: | - poetry run pip install \ - --extra-index-url https://test.pypi.org/simple/ \ - "$PKG_NAME==$VERSION" || \ - ( \ - sleep 5 && \ - poetry run pip install \ - --extra-index-url https://test.pypi.org/simple/ \ - "$PKG_NAME==$VERSION" \ - ) + # - name: Import published package + # shell: bash + # working-directory: . + # env: + # PKG_NAME: ${{ needs.build.outputs.pkg-name }} + # VERSION: ${{ needs.build.outputs.version }} + # # Here we use: + # # - The default regular PyPI index as the *primary* index, meaning + # # that it takes priority (https://pypi.org/simple) + # # - The test PyPI index as an extra index, so that any dependencies that + # # are not found on test PyPI can be resolved and installed anyway. + # # (https://test.pypi.org/simple). This will include the PKG_NAME==VERSION + # # package because VERSION will not have been uploaded to regular PyPI yet. + # # - attempt install again after 5 seconds if it fails because there is + # # sometimes a delay in availability on test pypi + # run: | + # poetry run pip install \ + # --extra-index-url https://test.pypi.org/simple/ \ + # "$PKG_NAME==$VERSION" || \ + # ( \ + # sleep 5 && \ + # poetry run pip install \ + # --extra-index-url https://test.pypi.org/simple/ \ + # "$PKG_NAME==$VERSION" \ + # ) - # Replace all dashes in the package name with underscores, - # since that's how Python imports packages with dashes in the name. - IMPORT_NAME="$(echo "$PKG_NAME" | sed s/-/_/g)" + # # Replace all dashes in the package name with underscores, + # # since that's how Python imports packages with dashes in the name. + # IMPORT_NAME="$(echo "$PKG_NAME" | sed s/-/_/g)" - poetry run python -c "import $IMPORT_NAME; print(dir($IMPORT_NAME))" + # poetry run python -c "import $IMPORT_NAME; print(dir($IMPORT_NAME))" - - name: Import test dependencies - run: poetry install --with test,test_integration - working-directory: . + # - name: Import test dependencies + # run: poetry install --with test,test_integration + # working-directory: . - # Overwrite the local version of the package with the test PyPI version. - - name: Import published package (again) - working-directory: . - shell: bash - env: - PKG_NAME: ${{ needs.build.outputs.pkg-name }} - VERSION: ${{ needs.build.outputs.version }} - run: | - poetry run pip install \ - --extra-index-url https://test.pypi.org/simple/ \ - "$PKG_NAME==$VERSION" + # # Overwrite the local version of the package with the test PyPI version. + # - name: Import published package (again) + # working-directory: . + # shell: bash + # env: + # PKG_NAME: ${{ needs.build.outputs.pkg-name }} + # VERSION: ${{ needs.build.outputs.version }} + # run: | + # poetry run pip install \ + # --extra-index-url https://test.pypi.org/simple/ \ + # "$PKG_NAME==$VERSION" - - name: Run unit tests - run: make tests - working-directory: . + # - name: Run unit tests + # run: make tests + # working-directory: . - - name: 'Authenticate to Google Cloud' - id: 'auth' - uses: google-github-actions/auth@v2 - with: - credentials_json: '${{ secrets.GOOGLE_CREDENTIALS }}' + # - name: 'Authenticate to Google Cloud' + # id: 'auth' + # uses: google-github-actions/auth@v2 + # with: + # credentials_json: '${{ secrets.GOOGLE_CREDENTIALS }}' - - name: Run integration tests - env: - OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} - run: make integration_tests - working-directory: . + # - name: Run integration tests + # env: + # OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} + # run: make integration_tests + # working-directory: . - # - name: Run unit tests with minimum dependency versions - # if: ${{ (inputs.working-directory == 'libs/langchain') || (inputs.working-directory == 'libs/community') || (inputs.working-directory == 'libs/experimental') }} - # run: | - # poetry run pip install -r _test_minimum_requirements.txt - # make tests - # working-directory: . + # # - name: Run unit tests with minimum dependency versions + # # if: ${{ (inputs.working-directory == 'libs/langchain') || (inputs.working-directory == 'libs/community') || (inputs.working-directory == 'libs/experimental') }} + # # run: | + # # poetry run pip install -r _test_minimum_requirements.txt + # # make tests + # # working-directory: . - publish: - needs: - - build - - test-pypi-publish - - pre-release-checks - runs-on: ubuntu-latest - permissions: - # This permission is used for trusted publishing: - # https://blog.pypi.org/posts/2023-04-20-introducing-trusted-publishers/ - # - # Trusted publishing has to also be configured on PyPI for each package: - # https://docs.pypi.org/trusted-publishers/adding-a-publisher/ - id-token: write + # publish: + # needs: + # - build + # - test-pypi-publish + # - pre-release-checks + # runs-on: ubuntu-latest + # permissions: + # # This permission is used for trusted publishing: + # # https://blog.pypi.org/posts/2023-04-20-introducing-trusted-publishers/ + # # + # # Trusted publishing has to also be configured on PyPI for each package: + # # https://docs.pypi.org/trusted-publishers/adding-a-publisher/ + # id-token: write - defaults: - run: - working-directory: . + # defaults: + # run: + # working-directory: . - steps: - - uses: actions/checkout@v4 + # steps: + # - uses: actions/checkout@v4 - - name: Set up Python + Poetry ${{ env.POETRY_VERSION }} - uses: "./.github/actions/poetry_setup" - with: - python-version: ${{ env.PYTHON_VERSION }} - poetry-version: ${{ env.POETRY_VERSION }} - working-directory: . - cache-key: release + # - name: Set up Python + Poetry ${{ env.POETRY_VERSION }} + # uses: "./.github/actions/poetry_setup" + # with: + # python-version: ${{ env.PYTHON_VERSION }} + # poetry-version: ${{ env.POETRY_VERSION }} + # working-directory: . + # cache-key: release - - uses: actions/download-artifact@v3 - with: - name: dist - path: ./dist/ + # - uses: actions/download-artifact@v3 + # with: + # name: dist + # path: ./dist/ - - name: Publish package distributions to PyPI - uses: pypa/gh-action-pypi-publish@release/v1 - with: - packages-dir: ./dist/ - verbose: true - print-hash: true + # - name: Publish package distributions to PyPI + # uses: pypa/gh-action-pypi-publish@release/v1 + # with: + # packages-dir: ./dist/ + # verbose: true + # print-hash: true - mark-release: + # mark-release: needs: - build - test-pypi-publish From 4a32ea533373a0143642e86a258d214ed6349ee0 Mon Sep 17 00:00:00 2001 From: hsm207 Date: Wed, 31 Jan 2024 10:39:04 +0000 Subject: [PATCH 03/20] let workflow run on pr in current branch --- .github/workflows/_release.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/_release.yml b/.github/workflows/_release.yml index a848220..f1e3808 100644 --- a/.github/workflows/_release.yml +++ b/.github/workflows/_release.yml @@ -3,6 +3,8 @@ on: push: branches: - main + pull_request: + branches: [ release ] env: PYTHON_VERSION: "3.10" From 481b262ae53f58b53eebe8d30756ba48321f913f Mon Sep 17 00:00:00 2001 From: hsm207 Date: Wed, 31 Jan 2024 10:40:50 +0000 Subject: [PATCH 04/20] add prebuild check job --- .github/workflows/_release.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/_release.yml b/.github/workflows/_release.yml index f1e3808..acba104 100644 --- a/.github/workflows/_release.yml +++ b/.github/workflows/_release.yml @@ -11,6 +11,8 @@ env: POETRY_VERSION: "1.7.1" jobs: + prebuild-checks: + uses: ./.github/workflows/prebuild.yml # release-please: # runs-on: ubuntu-latest # permissions: From b743fba936bc4f63dc4baf06ed7be38e6bb7ef42 Mon Sep 17 00:00:00 2001 From: hsm207 Date: Wed, 31 Jan 2024 10:43:29 +0000 Subject: [PATCH 05/20] fix missed comments --- .github/workflows/_release.yml | 52 +++++++++++++++++----------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/.github/workflows/_release.yml b/.github/workflows/_release.yml index acba104..61083bf 100644 --- a/.github/workflows/_release.yml +++ b/.github/workflows/_release.yml @@ -220,36 +220,36 @@ jobs: # print-hash: true # mark-release: - needs: - - build - - test-pypi-publish - - pre-release-checks - - publish - runs-on: ubuntu-latest - permissions: - # This permission is needed by `ncipollo/release-action` to - # create the GitHub release. - contents: write + # needs: + # - build + # - test-pypi-publish + # - pre-release-checks + # - publish + # runs-on: ubuntu-latest + # permissions: + # # This permission is needed by `ncipollo/release-action` to + # # create the GitHub release. + # contents: write - defaults: - run: - working-directory: . + # defaults: + # run: + # working-directory: . - steps: - - uses: actions/checkout@v4 + # steps: + # - uses: actions/checkout@v4 - - name: Set up Python + Poetry ${{ env.POETRY_VERSION }} - uses: "./.github/actions/poetry_setup" - with: - python-version: ${{ env.PYTHON_VERSION }} - poetry-version: ${{ env.POETRY_VERSION }} - working-directory: . - cache-key: release + # - name: Set up Python + Poetry ${{ env.POETRY_VERSION }} + # uses: "./.github/actions/poetry_setup" + # with: + # python-version: ${{ env.PYTHON_VERSION }} + # poetry-version: ${{ env.POETRY_VERSION }} + # working-directory: . + # cache-key: release - - uses: actions/download-artifact@v3 - with: - name: dist - path: ./dist/ + # - uses: actions/download-artifact@v3 + # with: + # name: dist + # path: ./dist/ # - name: Create Release # uses: ncipollo/release-action@v1 From fca3812035d23e3c4f270d2f5aa0010654694006 Mon Sep 17 00:00:00 2001 From: hsm207 Date: Wed, 31 Jan 2024 14:10:13 +0000 Subject: [PATCH 06/20] Triggering workflow with an empty commit From 73db8760322557d38cf640f76413eaac044731f1 Mon Sep 17 00:00:00 2001 From: hsm207 Date: Wed, 31 Jan 2024 14:12:58 +0000 Subject: [PATCH 07/20] test --- .github/workflows/_release.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/_release.yml b/.github/workflows/_release.yml index 61083bf..27d83a5 100644 --- a/.github/workflows/_release.yml +++ b/.github/workflows/_release.yml @@ -3,6 +3,7 @@ on: push: branches: - main + - release pull_request: branches: [ release ] From b40eb09a7acebc6c637bf44ac6d6dcc5e31572cb Mon Sep 17 00:00:00 2001 From: hsm207 Date: Wed, 31 Jan 2024 14:14:19 +0000 Subject: [PATCH 08/20] test --- .github/workflows/_release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/_release.yml b/.github/workflows/_release.yml index 27d83a5..447cb54 100644 --- a/.github/workflows/_release.yml +++ b/.github/workflows/_release.yml @@ -74,8 +74,8 @@ jobs: # # https://github.com/pypa/gh-action-pypi-publish#non-goals test-pypi-publish: - needs: - - build + # needs: + # - build uses: ./.github/workflows/_test_release.yml secrets: inherit From 07b3048f2a8a5ec34de665e3a9648c683b5b9b3a Mon Sep 17 00:00:00 2001 From: hsm207 Date: Wed, 31 Jan 2024 14:37:48 +0000 Subject: [PATCH 09/20] pass secrets --- .github/workflows/_release.yml | 1 + .github/workflows/prebuild.yml | 3 +++ 2 files changed, 4 insertions(+) diff --git a/.github/workflows/_release.yml b/.github/workflows/_release.yml index 447cb54..70beaeb 100644 --- a/.github/workflows/_release.yml +++ b/.github/workflows/_release.yml @@ -14,6 +14,7 @@ env: jobs: prebuild-checks: uses: ./.github/workflows/prebuild.yml + secrets: inherit # release-please: # runs-on: ubuntu-latest # permissions: diff --git a/.github/workflows/prebuild.yml b/.github/workflows/prebuild.yml index 2f7b28a..e8f3a8d 100644 --- a/.github/workflows/prebuild.yml +++ b/.github/workflows/prebuild.yml @@ -2,6 +2,9 @@ name: Pre-build checks on: workflow_call: + secrets: + OPENAI_API_KEY_FROM_WEAVIATE: + required: true push: branches: [ main ] pull_request: From 2169a95509fc5f6adea813b0bf56f44193fd5267 Mon Sep 17 00:00:00 2001 From: hsm207 Date: Wed, 31 Jan 2024 14:46:39 +0000 Subject: [PATCH 10/20] connect with test release --- .github/workflows/_release.yml | 4 ++-- .github/workflows/_test_release.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/_release.yml b/.github/workflows/_release.yml index 70beaeb..9487ee6 100644 --- a/.github/workflows/_release.yml +++ b/.github/workflows/_release.yml @@ -75,8 +75,8 @@ jobs: # # https://github.com/pypa/gh-action-pypi-publish#non-goals test-pypi-publish: - # needs: - # - build + needs: + - prebuild-checks uses: ./.github/workflows/_test_release.yml secrets: inherit diff --git a/.github/workflows/_test_release.yml b/.github/workflows/_test_release.yml index e54d1d0..2be546c 100644 --- a/.github/workflows/_test_release.yml +++ b/.github/workflows/_test_release.yml @@ -9,7 +9,7 @@ env: jobs: build: - if: github.ref == 'refs/heads/main' + # if: github.ref == 'refs/heads/main' # not necessary since we only release on tags pushed to main runs-on: ubuntu-latest outputs: From 96f66422d3c58cc4ef9758ddfea75aa9e9114956 Mon Sep 17 00:00:00 2001 From: hsm207 Date: Wed, 31 Jan 2024 14:52:27 +0000 Subject: [PATCH 11/20] bump version --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 9b8144d..2d7365c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "langchain-weaviate" -version = "0.0.1rc1" +version = "0.0.1rc2" description = "An integration package connecting Weaviate and LangChain" authors = [] readme = "README.md" From bd33c8861f87d8057c2ed55312e2daa2865cf56e Mon Sep 17 00:00:00 2001 From: hsm207 Date: Wed, 31 Jan 2024 15:37:06 +0000 Subject: [PATCH 12/20] add build job --- .github/workflows/_release.yml | 55 +++++++++++++++++----------------- 1 file changed, 27 insertions(+), 28 deletions(-) diff --git a/.github/workflows/_release.yml b/.github/workflows/_release.yml index 9487ee6..c14c798 100644 --- a/.github/workflows/_release.yml +++ b/.github/workflows/_release.yml @@ -31,36 +31,35 @@ jobs: # with: # manifest-file: ".release-please-manifest.json" # config-file: "release-please-config.json" - # build: - # needs: release-please - # if: ${{ needs.release-please.outputs.releases_created }} - # runs-on: ubuntu-latest - # steps: - # - uses: actions/checkout@v4 - # - name: Set up Python + Poetry ${{ env.POETRY_VERSION }} - # uses: "./.github/actions/poetry_setup" - # with: - # python-version: ${{ env.PYTHON_VERSION }} - # poetry-version: ${{ env.POETRY_VERSION }} - # working-directory: . - # cache-key: release - # - name: Build project for distribution - # run: poetry build - # working-directory: . + build: + needs: prebuild-checks + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up Python + Poetry ${{ env.POETRY_VERSION }} + uses: "./.github/actions/poetry_setup" + with: + python-version: ${{ env.PYTHON_VERSION }} + poetry-version: ${{ env.POETRY_VERSION }} + working-directory: . + cache-key: release + - name: Build project for distribution + run: poetry build + working-directory: . - # - name: Upload build - # uses: actions/upload-artifact@v3 - # with: - # name: dist - # path: ./dist/ + - name: Upload build + uses: actions/upload-artifact@v3 + with: + name: dist + path: ./dist/ - # - name: Check Version - # id: check-version - # shell: bash - # working-directory: . - # run: | - # echo pkg-name="$(poetry version | cut -d ' ' -f 1)" >> $GITHUB_OUTPUT - # echo version="$(poetry version --short)" >> $GITHUB_OUTPUT + - name: Check Version + id: check-version + shell: bash + working-directory: . + run: | + echo pkg-name="$(poetry version | cut -d ' ' -f 1)" >> $GITHUB_OUTPUT + echo version="$(poetry version --short)" >> $GITHUB_OUTPUT # # We want to keep this build stage *separate* from the release stage, # # so that there's no sharing of permissions between them. From 3a4f1b331563852e0dc688feb2d4f5b71161d6dd Mon Sep 17 00:00:00 2001 From: hsm207 Date: Wed, 31 Jan 2024 15:37:22 +0000 Subject: [PATCH 13/20] version bump --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 2d7365c..cb72b0d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "langchain-weaviate" -version = "0.0.1rc2" +version = "0.0.1rc3" description = "An integration package connecting Weaviate and LangChain" authors = [] readme = "README.md" From b2575a64a0df4c10c92dc3e6183602f6c010f2cc Mon Sep 17 00:00:00 2001 From: hsm207 Date: Wed, 31 Jan 2024 15:49:40 +0000 Subject: [PATCH 14/20] add publish job --- .github/workflows/_release.yml | 69 +++++++++++++++++----------------- 1 file changed, 34 insertions(+), 35 deletions(-) diff --git a/.github/workflows/_release.yml b/.github/workflows/_release.yml index c14c798..3426107 100644 --- a/.github/workflows/_release.yml +++ b/.github/workflows/_release.yml @@ -179,46 +179,45 @@ jobs: # # make tests # # working-directory: . - # publish: - # needs: - # - build - # - test-pypi-publish - # - pre-release-checks - # runs-on: ubuntu-latest - # permissions: - # # This permission is used for trusted publishing: - # # https://blog.pypi.org/posts/2023-04-20-introducing-trusted-publishers/ - # # - # # Trusted publishing has to also be configured on PyPI for each package: - # # https://docs.pypi.org/trusted-publishers/adding-a-publisher/ - # id-token: write + publish: + needs: + - build + - test-pypi-publish + runs-on: ubuntu-latest + permissions: + # This permission is used for trusted publishing: + # https://blog.pypi.org/posts/2023-04-20-introducing-trusted-publishers/ + # + # Trusted publishing has to also be configured on PyPI for each package: + # https://docs.pypi.org/trusted-publishers/adding-a-publisher/ + id-token: write - # defaults: - # run: - # working-directory: . + defaults: + run: + working-directory: . - # steps: - # - uses: actions/checkout@v4 + steps: + - uses: actions/checkout@v4 - # - name: Set up Python + Poetry ${{ env.POETRY_VERSION }} - # uses: "./.github/actions/poetry_setup" - # with: - # python-version: ${{ env.PYTHON_VERSION }} - # poetry-version: ${{ env.POETRY_VERSION }} - # working-directory: . - # cache-key: release + - name: Set up Python + Poetry ${{ env.POETRY_VERSION }} + uses: "./.github/actions/poetry_setup" + with: + python-version: ${{ env.PYTHON_VERSION }} + poetry-version: ${{ env.POETRY_VERSION }} + working-directory: . + cache-key: release - # - uses: actions/download-artifact@v3 - # with: - # name: dist - # path: ./dist/ + - uses: actions/download-artifact@v3 + with: + name: dist + path: ./dist/ - # - name: Publish package distributions to PyPI - # uses: pypa/gh-action-pypi-publish@release/v1 - # with: - # packages-dir: ./dist/ - # verbose: true - # print-hash: true + - name: Publish package distributions to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + packages-dir: ./dist/ + verbose: true + print-hash: true # mark-release: # needs: From 4601dbe18719027da0097e91c6d4deaf0f6271e0 Mon Sep 17 00:00:00 2001 From: hsm207 Date: Wed, 31 Jan 2024 16:05:37 +0000 Subject: [PATCH 15/20] add release job --- .github/workflows/_release.yml | 71 ++++++++++++++++------------------ 1 file changed, 34 insertions(+), 37 deletions(-) diff --git a/.github/workflows/_release.yml b/.github/workflows/_release.yml index 3426107..6dfaeb9 100644 --- a/.github/workflows/_release.yml +++ b/.github/workflows/_release.yml @@ -219,45 +219,42 @@ jobs: verbose: true print-hash: true - # mark-release: - # needs: - # - build - # - test-pypi-publish - # - pre-release-checks - # - publish - # runs-on: ubuntu-latest - # permissions: - # # This permission is needed by `ncipollo/release-action` to - # # create the GitHub release. - # contents: write + mark-release: + needs: + - publish + runs-on: ubuntu-latest + permissions: + # This permission is needed by `ncipollo/release-action` to + # create the GitHub release. + contents: write - # defaults: - # run: - # working-directory: . + defaults: + run: + working-directory: . - # steps: - # - uses: actions/checkout@v4 + steps: + - uses: actions/checkout@v4 - # - name: Set up Python + Poetry ${{ env.POETRY_VERSION }} - # uses: "./.github/actions/poetry_setup" - # with: - # python-version: ${{ env.PYTHON_VERSION }} - # poetry-version: ${{ env.POETRY_VERSION }} - # working-directory: . - # cache-key: release + - name: Set up Python + Poetry ${{ env.POETRY_VERSION }} + uses: "./.github/actions/poetry_setup" + with: + python-version: ${{ env.PYTHON_VERSION }} + poetry-version: ${{ env.POETRY_VERSION }} + working-directory: . + cache-key: release - # - uses: actions/download-artifact@v3 - # with: - # name: dist - # path: ./dist/ + - uses: actions/download-artifact@v3 + with: + name: dist + path: ./dist/ - # - name: Create Release - # uses: ncipollo/release-action@v1 - # if: ${{ inputs.working-directory == 'libs/langchain' }} - # with: - # artifacts: "dist/*" - # token: ${{ secrets.GITHUB_TOKEN }} - # draft: false - # generateReleaseNotes: true - # tag: v${{ needs.build.outputs.version }} - # commit: master + - name: Create Release + uses: ncipollo/release-action@v1 + if: ${{ inputs.working-directory == 'libs/langchain' }} + with: + artifacts: "dist/*" + token: ${{ secrets.GITHUB_TOKEN }} + draft: false + generateReleaseNotes: true + tag: v${{ needs.build.outputs.version }} + commit: master From 1c704348d8a93e933ec8be9c5d6c5382baf49f33 Mon Sep 17 00:00:00 2001 From: hsm207 Date: Wed, 31 Jan 2024 16:06:48 +0000 Subject: [PATCH 16/20] bump version --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index cb72b0d..134fa02 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "langchain-weaviate" -version = "0.0.1rc3" +version = "0.0.1rc4" description = "An integration package connecting Weaviate and LangChain" authors = [] readme = "README.md" From eaea461a4b5150e59e01405613b1b8fa492be4cc Mon Sep 17 00:00:00 2001 From: hsm207 Date: Wed, 31 Jan 2024 16:15:56 +0000 Subject: [PATCH 17/20] fix typo --- .github/workflows/_release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/_release.yml b/.github/workflows/_release.yml index 6dfaeb9..c9a3cfb 100644 --- a/.github/workflows/_release.yml +++ b/.github/workflows/_release.yml @@ -250,7 +250,7 @@ jobs: - name: Create Release uses: ncipollo/release-action@v1 - if: ${{ inputs.working-directory == 'libs/langchain' }} + if: ${{ inputs.working-directory == 'libs/langchain-weaviate' }} with: artifacts: "dist/*" token: ${{ secrets.GITHUB_TOKEN }} From 2490cb19024cb8bd383450e5e30af8479c2e1f96 Mon Sep 17 00:00:00 2001 From: hsm207 Date: Wed, 31 Jan 2024 16:35:33 +0000 Subject: [PATCH 18/20] bump version --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 134fa02..ced6e8b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "langchain-weaviate" -version = "0.0.1rc4" +version = "0.0.1rc5" description = "An integration package connecting Weaviate and LangChain" authors = [] readme = "README.md" From aab1183ffb29819729e7b3fa3f8378cdf5717534 Mon Sep 17 00:00:00 2001 From: hsm207 Date: Wed, 31 Jan 2024 16:50:14 +0000 Subject: [PATCH 19/20] try fixing mark release job --- .github/workflows/_release.yml | 73 +++++++++++++++++----------------- 1 file changed, 37 insertions(+), 36 deletions(-) diff --git a/.github/workflows/_release.yml b/.github/workflows/_release.yml index c9a3cfb..3b38734 100644 --- a/.github/workflows/_release.yml +++ b/.github/workflows/_release.yml @@ -179,49 +179,50 @@ jobs: # # make tests # # working-directory: . - publish: - needs: - - build - - test-pypi-publish - runs-on: ubuntu-latest - permissions: - # This permission is used for trusted publishing: - # https://blog.pypi.org/posts/2023-04-20-introducing-trusted-publishers/ - # - # Trusted publishing has to also be configured on PyPI for each package: - # https://docs.pypi.org/trusted-publishers/adding-a-publisher/ - id-token: write + # publish: + # needs: + # - build + # - test-pypi-publish + # runs-on: ubuntu-latest + # permissions: + # # This permission is used for trusted publishing: + # # https://blog.pypi.org/posts/2023-04-20-introducing-trusted-publishers/ + # # + # # Trusted publishing has to also be configured on PyPI for each package: + # # https://docs.pypi.org/trusted-publishers/adding-a-publisher/ + # id-token: write - defaults: - run: - working-directory: . + # defaults: + # run: + # working-directory: . - steps: - - uses: actions/checkout@v4 + # steps: + # - uses: actions/checkout@v4 - - name: Set up Python + Poetry ${{ env.POETRY_VERSION }} - uses: "./.github/actions/poetry_setup" - with: - python-version: ${{ env.PYTHON_VERSION }} - poetry-version: ${{ env.POETRY_VERSION }} - working-directory: . - cache-key: release + # - name: Set up Python + Poetry ${{ env.POETRY_VERSION }} + # uses: "./.github/actions/poetry_setup" + # with: + # python-version: ${{ env.PYTHON_VERSION }} + # poetry-version: ${{ env.POETRY_VERSION }} + # working-directory: . + # cache-key: release - - uses: actions/download-artifact@v3 - with: - name: dist - path: ./dist/ + # - uses: actions/download-artifact@v3 + # with: + # name: dist + # path: ./dist/ - - name: Publish package distributions to PyPI - uses: pypa/gh-action-pypi-publish@release/v1 - with: - packages-dir: ./dist/ - verbose: true - print-hash: true + # - name: Publish package distributions to PyPI + # uses: pypa/gh-action-pypi-publish@release/v1 + # with: + # packages-dir: ./dist/ + # verbose: true + # print-hash: true mark-release: needs: - - publish + # - publish + - build runs-on: ubuntu-latest permissions: # This permission is needed by `ncipollo/release-action` to @@ -250,7 +251,7 @@ jobs: - name: Create Release uses: ncipollo/release-action@v1 - if: ${{ inputs.working-directory == 'libs/langchain-weaviate' }} + # if: ${{ inputs.working-directory == 'libs/langchain-weaviate' }} with: artifacts: "dist/*" token: ${{ secrets.GITHUB_TOKEN }} From 033df5b885731cdc2b2f259dface68a4040b960e Mon Sep 17 00:00:00 2001 From: hsm207 Date: Wed, 31 Jan 2024 16:56:38 +0000 Subject: [PATCH 20/20] try fixing again --- .github/workflows/_release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/_release.yml b/.github/workflows/_release.yml index 3b38734..ec3462d 100644 --- a/.github/workflows/_release.yml +++ b/.github/workflows/_release.yml @@ -258,4 +258,4 @@ jobs: draft: false generateReleaseNotes: true tag: v${{ needs.build.outputs.version }} - commit: master + commit: release