Skip to content

Commit 280254c

Browse files
committed
chore: release v4
1 parent e869b15 commit 280254c

File tree

2 files changed

+39
-5
lines changed

2 files changed

+39
-5
lines changed

.github/workflows/main.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,3 +96,39 @@ jobs:
9696
pip3 install --upgrade pip
9797
pip3 install tox
9898
TOXENV=${{ matrix.toxenv }} ALGOLIA_APPLICATION_ID=${{ secrets.ALGOLIA_APPLICATION_ID }} ALGOLIA_API_KEY=${{ secrets.ALGOLIA_API_KEY }} tox
99+
100+
release:
101+
name: Publish
102+
runs-on: ubuntu-22.04
103+
environment:
104+
name: pypi
105+
url: https://pypi.org/p/algoliasearch-django
106+
permissions:
107+
id-token: write
108+
needs:
109+
- build
110+
if: |
111+
always() &&
112+
startsWith(github.event.head_commit.message, 'chore: release')
113+
!contains(needs.*.result, 'cancelled') &&
114+
!contains(needs.*.result, 'failure') &&
115+
github.ref == 'refs/heads/master'
116+
steps:
117+
- uses: actions/checkout@v4
118+
119+
- name: Set up Python
120+
uses: actions/setup-python@v4
121+
with:
122+
python-version: 3.13
123+
124+
- name: Install dependencies and release
125+
timeout-minutes: 20
126+
run: |
127+
python -m venv python-ci-run
128+
source python-ci-run/bin/activate
129+
pip3 install --upgrade pip
130+
pip3 install tox
131+
tox release
132+
133+
- name: Publish algoliasearch package to PyPI
134+
uses: pypa/gh-action-pypi-publish@release/v1

tox.ini

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ twine = >=5.1,<6.0
3030
wheel = >=0.45,<1.0
3131
ruff = >=0.7.4,<1.0
3232
pyright = >=1.1.389,<2.0
33+
setuptools = >=75.0,<76.0
3334

3435
[testenv:coverage]
3536
basepython = python3.13
@@ -52,18 +53,15 @@ commands =
5253
coverage report
5354
coveralls
5455

55-
[testenv:release]
56+
[testenv:build]
5657
basepython = python3.13
5758
deps =
5859
twine {[versions]twine}
5960
wheel {[versions]wheel}
60-
passenv =
61-
PYPI_USER
62-
PYPI_PASSWORD
61+
setuptools {[versions]setuptools}
6362
commands =
6463
python setup.py sdist bdist_wheel
6564
twine check dist/*
66-
twine upload -u {env:PYPI_USER} -p {env:PYPI_PASSWORD} --repository-url https://upload.pypi.org/legacy/ dist/*
6765

6866
[testenv:lint]
6967
deps =

0 commit comments

Comments
 (0)