Skip to content

Commit

Permalink
Merge pull request #58 from acsone/fix-ci
Browse files Browse the repository at this point in the history
Modernize CI
  • Loading branch information
sbidoul authored Jul 22, 2024
2 parents 0c6d8f4 + f97570e commit 2e96948
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 20 deletions.
25 changes: 5 additions & 20 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ jobs:
- python-version: "3.10"
toxenv: "py310-16.0"
machine: ubuntu-22.04
- python-version: "3.10"
toxenv: "py310-17.0"
- python-version: "3.12"
toxenv: "py312-17.0"
machine: ubuntu-22.04
- python-version: "3.10"
toxenv: "twine_check"
Expand All @@ -57,11 +57,11 @@ jobs:
PGUSER: odoo
PGPASSWORD: odoo
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "${{ matrix.python-version }}"
- uses: actions/cache@v2
- uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ matrix.toxenv }}
Expand All @@ -76,18 +76,3 @@ jobs:
- name: Run tox
run: tox -e ${{ matrix.toxenv }}
- uses: codecov/codecov-action@v1
deploy:
runs-on: ubuntu-latest
needs:
- tests
if: startsWith(github.ref, 'refs/tags')
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- name: Build a binary wheel and a source tarball
run: pipx run build
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.pypi_token }}
29 changes: 29 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
on:
release:
types:
- published

name: release

jobs:
pypi:
name: upload release to PyPI
runs-on: ubuntu-latest
environment: release

permissions:
# Used to authenticate to PyPI via OIDC.
id-token: write

steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: ">= 3.8"

- name: build
run: pipx run build

- name: publish
uses: pypa/gh-action-pypi-publish@release/v1
3 changes: 3 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,9 @@ you commit, install
`pre-commit <https://github.com/pre-commit/pre-commit>`_ and
run ``pre-commit install`` after cloning the repository.

To release, create a release with a tag on GitHub. This will trigger a
deployment to PyPI.

Useful links
~~~~~~~~~~~~

Expand Down
1 change: 1 addition & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

[tox]
envlist =
py312-{16.0,17.0}
py310-{16.0,17.0}
py38-{15.0}
py36-{11.0,12.0,13.0,14.0}
Expand Down

0 comments on commit 2e96948

Please sign in to comment.