diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index cd416fe..b6aacc0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,52 +1,37 @@ -name: Create Release +name: Release on: push: tags: - - 'v*' # Trigger on version tags + - 'v*' jobs: + test: + uses: ./.github/workflows/test.yml + release: + needs: test runs-on: ubuntu-latest - permissions: - contents: write + steps: - - name: Checkout code - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: '3.8' - - - name: Update version in pyproject.toml - run: | - # Extract version from tag (remove 'v' prefix) - VERSION=${GITHUB_REF#refs/tags/v} - # Update version in pyproject.toml - sed -i "s/version = \".*\"/version = \"$VERSION\"/" pyproject.toml - - - name: Commit version update - run: | - git config --local user.email "github-actions[bot]@users.noreply.github.com" - git config --local user.name "github-actions[bot]" - git commit -am "Bump version to ${GITHUB_REF#refs/tags/}" - git push - - - name: Get tag message - id: tag - run: | - git fetch --tags - echo "message=$(git tag -l --format='%(contents)' ${{ github.ref_name }})" >> $GITHUB_OUTPUT - echo "version=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT - - - name: Create Release - uses: softprops/action-gh-release@v1 - with: - name: Release ${{ steps.tag.outputs.version }} - body: ${{ steps.tag.outputs.message }} - draft: false - prerelease: false - token: ${{ secrets.GITHUB_TOKEN }} + - uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.8' + cache: 'pip' + + - name: Install dependencies + run: | + curl -sSL https://pdm-project.org/install-pdm.py | python3 - + pdm install + + - name: Build package + run: pdm build + + - name: Create Release + uses: softprops/action-gh-release@v1 + with: + files: dist/* + generate_release_notes: true \ No newline at end of file diff --git a/README.md b/README.md index b7f6289..ab72065 100644 --- a/README.md +++ b/README.md @@ -95,6 +95,7 @@ cd milvus-beir # Install dependencies using PDM pdm install +pre-commit install ``` ### Running Tests diff --git a/pyproject.toml b/pyproject.toml index c7883b6..1efd2ab 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,25 +1,19 @@ [project] name = "milvus_beir" -version = "0.1.0" -description = "Default template for PDM package" +dynamic = ["version"] +description = "A Python library that integrates Milvus vector database with BEIR (Benchmarking IR) for efficient information retrieval and evaluation." readme = "README.md" requires-python = ">=3.8" -dependencies = [ - "pymilvus>=2.5.0", - "milvus-model>=0.2.10", - "beir>=2.0.0", - "torch<=2.2.2", - "ranx>=0.3.20", - "onnxruntime<=1.19.0", - 'numpy>=1.26.4; python_version >= "3.12"', - 'numpy>=1.23.2,<1.27.0; python_version >= "3.9" and python_version < "3.12"', - 'numpy>=1.19.5,<1.25.0; python_version >= "3.8" and python_version < "3.9"', -] +dependencies = ["pymilvus>=2.5.0", "milvus-model>=0.2.10", "beir>=2.0.0", "torch<=2.2.2", "ranx>=0.3.20", "onnxruntime<=1.19.0"] authors = [ {name = "zhuwenxing", email = "wenxing.zhu@zilliz.com"}, ] license = {text = "MIT"} +[build-system] +requires = ["pdm-backend"] +build-backend = "pdm.backend" + [dependency-groups] test = [ "pytest>=8.3.4", @@ -54,4 +48,5 @@ known-first-party = ["milvus_beir"] [tool.pdm] distribution = true +version = {source = "file", path = "src/milvus_beir/__init__.py"} diff --git a/src/milvus_beir/__init__.py b/src/milvus_beir/__init__.py index e69de29..f102a9c 100644 --- a/src/milvus_beir/__init__.py +++ b/src/milvus_beir/__init__.py @@ -0,0 +1 @@ +__version__ = "0.0.1"