From 478e875c60557d203c722038f46b214cec8cd9fe Mon Sep 17 00:00:00 2001 From: Jesper Dramsch Date: Fri, 9 Aug 2024 15:17:08 +0200 Subject: [PATCH] ci: inherit pypi publish flow (#17) * ci: inherit pypi publish flow Co-authored-by: Helen Theissen * docs: add to changelog * fix: typo in reusable workflow * fix: another typo * chore: bump actions/setup-python to v5 * ci: run downstream-ci for changes in src and tests * docs: update changelog --------- Co-authored-by: Helen Theissen --- .github/workflows/ci.yml | 3 +++ .github/workflows/python-publish.yml | 27 +++------------------------ CHANGELOG.md | 2 ++ 3 files changed, 8 insertions(+), 24 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ab853f5..5867ee0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,6 +8,9 @@ on: - 'develop' tags-ignore: - '**' + paths: + - "src/**" + - "tests/**" # Trigger the workflow on pull request pull_request: ~ diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 666f65d..de01bf6 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -35,7 +35,7 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: actions/setup-python@v2 + - uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} @@ -48,27 +48,6 @@ jobs: run: pytest deploy: - - if: ${{ github.event_name == 'release' }} - runs-on: ubuntu-latest needs: [checks, quality] - - steps: - - uses: actions/checkout@v4 - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: 3.x - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install build wheel twine - - name: Build and publish - env: - TWINE_USERNAME: __token__ - TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} - run: | - python -m build - twine upload dist/* + uses: ecmwf-actions/reusable-workflows/.github/workflows/cd-pypi.yml@v2 + secrets: inherit diff --git a/CHANGELOG.md b/CHANGELOG.md index 03e5fae..e39f5aa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,8 @@ Keep it human-readable, your future self will thank you! - configurabilty of the dropout probability in the the MultiHeadSelfAttention module ### Changed + - Update CI to inherit from common infrastructue reusable workflows + - run downstream-ci only when src and tests folders have changed - New error messages for wrongs graphs.