Skip to content

Commit

Permalink
Rework the deploy pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
pckroon committed Sep 6, 2024
1 parent 359a299 commit 96a0f5c
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 46 deletions.
62 changes: 27 additions & 35 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ env:

jobs:
build:

runs-on: ubuntu-20.04

strategy:
Expand All @@ -31,9 +30,9 @@ jobs:
WITH_CODECOV: true

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.py_version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.py_version }}
cache: pip
Expand All @@ -54,6 +53,7 @@ jobs:
run: |
coverage run $(which pytest) -vv --hypothesis-show-statistics
coverage report --omit='*/bin/pytest'
coverage xml
- if: ${{ matrix.WITH_CODECOV }}
name: Upload coverage codecov
Expand All @@ -68,11 +68,11 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up Python 3.11
uses: actions/setup-python@v4
- uses: actions/checkout@v4
- name: Set up Python 3
uses: actions/setup-python@v5
with:
python-version: '3.11'
python-version: '3.x'
cache: pip
cache-dependency-path: |
**/setup.cfg
Expand All @@ -93,11 +93,11 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up Python 3.11
uses: actions/setup-python@v4
- uses: actions/checkout@v4
- name: Set up Python 3
uses: actions/setup-python@v5
with:
python-version: '3.11'
python-version: '3.x'
cache: pip
cache-dependency-path: |
**/setup.cfg
Expand All @@ -118,37 +118,29 @@ jobs:
deploy:
needs: [build, lint, docs]
runs-on: ubuntu-latest

environment:
name: pypi
url: https://pypi.org/p/vermouth
permissions:
id-token: write
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.11
uses: actions/setup-python@v4
- name: Set up Python 3
uses: actions/setup-python@v5
with:
python-version: '3.11'
python-version: '3.x'
cache: pip
cache-dependency-path: |
**/setup.cfg
**/requirements-*.txt
**/pyproject.toml
- name: Install dependencies
run: |
pip install --upgrade setuptools pip
pip install --upgrade .
- name: Install pypa/build
run: >-
python -m
pip install
build
--user
pip install pbr
run: |
python3 -m pip install build --user
- name: Build a binary wheel and a source tarball
run: >-
python -m
build
--sdist
--wheel
--outdir dist/
- name: Publish package to PyPI
run: python3 -m build --sdist --wheel --outdir dist/
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
53 changes: 42 additions & 11 deletions .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ env:

jobs:
build:

runs-on: ubuntu-20.04

strategy:
Expand All @@ -33,9 +32,9 @@ jobs:
WITH_CODECOV: true

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.py_version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.py_version }}
cache: pip
Expand Down Expand Up @@ -71,11 +70,11 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up Python 3.11
uses: actions/setup-python@v4
- uses: actions/checkout@v4
- name: Set up Python 3
uses: actions/setup-python@v5
with:
python-version: '3.11'
python-version: '3.x'
cache: pip
cache-dependency-path: |
**/setup.cfg
Expand All @@ -96,11 +95,11 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up Python 3.11
uses: actions/setup-python@v4
- uses: actions/checkout@v4
- name: Set up Python 3
uses: actions/setup-python@v5
with:
python-version: '3.11'
python-version: '3.x'
cache: pip
cache-dependency-path: |
**/setup.cfg
Expand All @@ -116,3 +115,35 @@ jobs:
run: |
mkdir -p doc/source/_static
sphinx-build -EnW -b html doc/source/ doc/build/html
deploy:
needs: [build, lint, docs]
runs-on: ubuntu-latest
environment:
name: testpypi
url: https://test.pypi.org/p/vermouth
permissions:
id-token: write
steps:
- name: Set up Python 3
uses: actions/setup-python@v5
with:
python-version: '3.x'
cache: pip
cache-dependency-path: |
**/setup.cfg
**/requirements-*.txt
**/pyproject.toml
- name: Install dependencies
run: |
pip install --upgrade setuptools pip
pip install --upgrade .
- name: Install pypa/build
run: |
python3 -m pip install build --user
- name: Build a binary wheel and a source tarball
run: python3 -m build --sdist --wheel --outdir dist/
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/

0 comments on commit 96a0f5c

Please sign in to comment.