From 280254ca0ed573c3ea1d62319756f724a1c06566 Mon Sep 17 00:00:00 2001 From: shortcuts Date: Tue, 24 Dec 2024 15:47:54 +0100 Subject: [PATCH 1/7] chore: release v4 --- .github/workflows/main.yml | 36 ++++++++++++++++++++++++++++++++++++ tox.ini | 8 +++----- 2 files changed, 39 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index cb72981..47acfe4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -96,3 +96,39 @@ jobs: pip3 install --upgrade pip pip3 install tox TOXENV=${{ matrix.toxenv }} ALGOLIA_APPLICATION_ID=${{ secrets.ALGOLIA_APPLICATION_ID }} ALGOLIA_API_KEY=${{ secrets.ALGOLIA_API_KEY }} tox + + release: + name: Publish + runs-on: ubuntu-22.04 + environment: + name: pypi + url: https://pypi.org/p/algoliasearch-django + permissions: + id-token: write + needs: + - build + if: | + always() && + startsWith(github.event.head_commit.message, 'chore: release') + !contains(needs.*.result, 'cancelled') && + !contains(needs.*.result, 'failure') && + github.ref == 'refs/heads/master' + steps: + - uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: 3.13 + + - name: Install dependencies and release + timeout-minutes: 20 + run: | + python -m venv python-ci-run + source python-ci-run/bin/activate + pip3 install --upgrade pip + pip3 install tox + tox release + + - name: Publish algoliasearch package to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/tox.ini b/tox.ini index 592e645..b351f18 100644 --- a/tox.ini +++ b/tox.ini @@ -30,6 +30,7 @@ twine = >=5.1,<6.0 wheel = >=0.45,<1.0 ruff = >=0.7.4,<1.0 pyright = >=1.1.389,<2.0 +setuptools = >=75.0,<76.0 [testenv:coverage] basepython = python3.13 @@ -52,18 +53,15 @@ commands = coverage report coveralls -[testenv:release] +[testenv:build] basepython = python3.13 deps = twine {[versions]twine} wheel {[versions]wheel} -passenv = - PYPI_USER - PYPI_PASSWORD + setuptools {[versions]setuptools} commands = python setup.py sdist bdist_wheel twine check dist/* - twine upload -u {env:PYPI_USER} -p {env:PYPI_PASSWORD} --repository-url https://upload.pypi.org/legacy/ dist/* [testenv:lint] deps = From 4e7ec71bf31d4ba0c32e927fd09ad081fc230598 Mon Sep 17 00:00:00 2001 From: shortcuts Date: Wed, 25 Dec 2024 21:56:16 +0100 Subject: [PATCH 2/7] chore: native release --- .github/workflows/main.yml | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 47acfe4..9b3faa2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -98,7 +98,7 @@ jobs: TOXENV=${{ matrix.toxenv }} ALGOLIA_APPLICATION_ID=${{ secrets.ALGOLIA_APPLICATION_ID }} ALGOLIA_API_KEY=${{ secrets.ALGOLIA_API_KEY }} tox release: - name: Publish + name: Build and publish runs-on: ubuntu-22.04 environment: name: pypi @@ -109,10 +109,9 @@ jobs: - build if: | always() && - startsWith(github.event.head_commit.message, 'chore: release') + startsWith(github.event.head_commit.message, 'chore: release') && !contains(needs.*.result, 'cancelled') && - !contains(needs.*.result, 'failure') && - github.ref == 'refs/heads/master' + !contains(needs.*.result, 'failure') steps: - uses: actions/checkout@v4 @@ -121,14 +120,12 @@ jobs: with: python-version: 3.13 - - name: Install dependencies and release - timeout-minutes: 20 - run: | - python -m venv python-ci-run - source python-ci-run/bin/activate - pip3 install --upgrade pip - pip3 install tox - tox release + - name: deps + run: python -m pip install -U build + + - name: build + run: python -m build - name: Publish algoliasearch package to PyPI + if: github.ref == 'refs/heads/master' uses: pypa/gh-action-pypi-publish@release/v1 From 98a6eb8f2a650de1be4a0146b4080d5037b8f2bb Mon Sep 17 00:00:00 2001 From: shortcuts Date: Wed, 25 Dec 2024 21:57:10 +0100 Subject: [PATCH 3/7] chore: upgrade --- .github/workflows/main.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9b3faa2..644826a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -98,7 +98,7 @@ jobs: TOXENV=${{ matrix.toxenv }} ALGOLIA_APPLICATION_ID=${{ secrets.ALGOLIA_APPLICATION_ID }} ALGOLIA_API_KEY=${{ secrets.ALGOLIA_API_KEY }} tox release: - name: Build and publish + name: Publish runs-on: ubuntu-22.04 environment: name: pypi @@ -111,7 +111,8 @@ jobs: always() && startsWith(github.event.head_commit.message, 'chore: release') && !contains(needs.*.result, 'cancelled') && - !contains(needs.*.result, 'failure') + !contains(needs.*.result, 'failure') && + github.ref == 'refs/heads/master' steps: - uses: actions/checkout@v4 @@ -121,11 +122,14 @@ jobs: python-version: 3.13 - name: deps - run: python -m pip install -U build + run: | + python -m venv python-ci-run + source python-ci-run/bin/activate + pip3 install --upgrade pip + python -m pip install -U build - name: build run: python -m build - name: Publish algoliasearch package to PyPI - if: github.ref == 'refs/heads/master' uses: pypa/gh-action-pypi-publish@release/v1 From 5b0bc6235ce91b2edb807b7157fc0822da094325 Mon Sep 17 00:00:00 2001 From: shortcuts Date: Wed, 25 Dec 2024 22:45:13 +0100 Subject: [PATCH 4/7] chore: conditional publish --- .github/workflows/main.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 644826a..24f87d0 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -109,10 +109,8 @@ jobs: - build if: | always() && - startsWith(github.event.head_commit.message, 'chore: release') && !contains(needs.*.result, 'cancelled') && - !contains(needs.*.result, 'failure') && - github.ref == 'refs/heads/master' + !contains(needs.*.result, 'failure') steps: - uses: actions/checkout@v4 @@ -132,4 +130,7 @@ jobs: run: python -m build - name: Publish algoliasearch package to PyPI + if: | + github.ref == 'refs/heads/master' && + startsWith(github.event.head_commit.message, 'chore: release') uses: pypa/gh-action-pypi-publish@release/v1 From 8619073c958b542f11758f368be4db2e27fb5b4b Mon Sep 17 00:00:00 2001 From: shortcuts Date: Wed, 25 Dec 2024 23:00:58 +0100 Subject: [PATCH 5/7] chore: env --- .github/workflows/main.yml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 24f87d0..e773ecd 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -119,15 +119,11 @@ jobs: with: python-version: 3.13 - - name: deps + - name: deps and build run: | - python -m venv python-ci-run - source python-ci-run/bin/activate pip3 install --upgrade pip python -m pip install -U build - - - name: build - run: python -m build + python -m build - name: Publish algoliasearch package to PyPI if: | From 729b3f9268315ab0c09b42cb180174adf2ce6896 Mon Sep 17 00:00:00 2001 From: shortcuts Date: Thu, 26 Dec 2024 00:04:14 +0100 Subject: [PATCH 6/7] chore: update changelog --- ChangeLog | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ChangeLog b/ChangeLog index 004e223..4fa87ab 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,11 @@ CHANGELOG +2024-12-26 4.0.0 + * [MAJOR] drop support for python <3.8 [#336](https://github.com/algolia/algoliasearch-django/pull/336) + * [MAJOR] drop support for django <4.0 [#336](https://github.com/algolia/algoliasearch-django/pull/336) + * [MAJOR] remove method `clear_index` in favor of `clear_objects` [#336](https://github.com/algolia/algoliasearch-django/pull/336) + 2023-04-27 3.0.0 * [MAJOR] drop python 2.7, update tox and CI run env (#331) * [FEAT] Add support for Python 3.9, 3.10 and 3.11 (#329) From b480216365557b8af3cf81c64fe1d14976da0e25 Mon Sep 17 00:00:00 2001 From: shortcuts Date: Thu, 26 Dec 2024 10:37:34 +0100 Subject: [PATCH 7/7] chore: try build on every versions --- .github/workflows/main.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e773ecd..18711f7 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -95,7 +95,9 @@ jobs: source python-ci-run/bin/activate pip3 install --upgrade pip pip3 install tox + python -m pip install -U build TOXENV=${{ matrix.toxenv }} ALGOLIA_APPLICATION_ID=${{ secrets.ALGOLIA_APPLICATION_ID }} ALGOLIA_API_KEY=${{ secrets.ALGOLIA_API_KEY }} tox + python -m build release: name: Publish