Skip to content

Commit

Permalink
Merge pull request #81 from ecmwf/feature/cd-pypi
Browse files Browse the repository at this point in the history
Add pypi CD
  • Loading branch information
dtip authored Jul 14, 2023
2 parents bba6c1d + ff7e7a7 commit 6e55a8b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 42 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: cd

on:
push:
tags:
- '**'

jobs:
pypi:
uses: ecmwf-actions/reusable-workflows/.github/workflows/cd-pypi.yml@v2
secrets: inherit
49 changes: 7 additions & 42 deletions .github/workflows/check-and-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ jobs:
fail-fast: false
matrix:
platform: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.8", "3.9", "3.10", "3.11"]
method: ["conda", "ecmwflibs"]
python-version: ['3.8', '3.9', '3.10', '3.11']
method: ['conda', 'ecmwflibs']
exclude:
- platform: macos-latest
python-version: "3.9"
method: "ecmwflibs"
python-version: '3.9'
method: 'ecmwflibs'

name: Python ${{ matrix.python-version }} on ${{ matrix.platform }} (${{ matrix.method }})
runs-on: ${{ matrix.platform }}
Expand Down Expand Up @@ -79,8 +79,8 @@ jobs:
- run: pytest
if: matrix.method == 'conda' && matrix.platform == 'windows-latest'
env:
ECCODES_DEFINITION_PATH: "C:/Miniconda/Library/share/eccodes/definitions"
ECCODES_SAMPLES_PATH: "C:/Miniconda/Library/share/eccodes/samples"
ECCODES_DEFINITION_PATH: 'C:/Miniconda/Library/share/eccodes/definitions'
ECCODES_SAMPLES_PATH: 'C:/Miniconda/Library/share/eccodes/samples'

- run: pytest
if: matrix.method != 'conda' || matrix.platform != 'windows-latest'
Expand All @@ -89,39 +89,4 @@ jobs:

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
if: "false"

deploy:
if: ${{ github.event_name == 'release' }}

name: Upload to Pypi
needs: checks

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Check version
run: |
release=${GITHUB_REF##*/}
version=$(python setup.py --version)
test "$release" == "$version"
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist
twine upload dist/*
if: 'false'

0 comments on commit 6e55a8b

Please sign in to comment.