From fbed75f6bdab220d4b0ad1b50786e2db47761054 Mon Sep 17 00:00:00 2001 From: Anes Benmerzoug Date: Fri, 4 Nov 2022 11:28:19 +0100 Subject: [PATCH 1/5] Trigger release to PyPI workflow only on tags on the master branch --- .github/workflows/publish.yaml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 6f59ff9d7..2136d7607 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -1,8 +1,9 @@ name: Upload Python Package to PyPI on: - release: - types: [created] + push: + tags: + - "v*" env: PY_COLORS: 1 @@ -16,6 +17,9 @@ jobs: - uses: actions/checkout@v3 with: fetch-depth: 0 + - name: Fail if not on master branch + if: github.ref != 'refs/heads/master' + run: exit -1 - name: Set up Python 3.8 uses: actions/setup-python@v4 with: From a07b8b95b52a1f93c4dda42f391b47633a25cb6e Mon Sep 17 00:00:00 2001 From: Anes Benmerzoug Date: Fri, 4 Nov 2022 11:41:07 +0100 Subject: [PATCH 2/5] Fail CI if linting fails --- .github/workflows/tox.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/tox.yaml b/.github/workflows/tox.yaml index adc92c37b..7a8fd1c32 100644 --- a/.github/workflows/tox.yaml +++ b/.github/workflows/tox.yaml @@ -39,7 +39,6 @@ jobs: path: .tox - name: Lint Code run: tox -e linting - continue-on-error: true - name: Check Type Hints run: tox -e type-checking docs: From 52dfe6f713d681a581ceccfd6f5e61c139cc7615 Mon Sep 17 00:00:00 2001 From: Anes Benmerzoug Date: Fri, 4 Nov 2022 11:41:44 +0100 Subject: [PATCH 3/5] Linting --- tests/conftest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/conftest.py b/tests/conftest.py index 64facb743..5f4f6e014 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,6 +1,6 @@ import functools from collections import OrderedDict, defaultdict -from typing import Dict, TYPE_CHECKING, Optional, Sequence, Tuple, Type +from typing import TYPE_CHECKING, Dict, Optional, Sequence, Tuple, Type import numpy as np import pytest From 53f411e18bfbfdec7671d5a8d0e12738b1512335 Mon Sep 17 00:00:00 2001 From: Anes Benmerzoug Date: Fri, 4 Nov 2022 11:45:33 +0100 Subject: [PATCH 4/5] [skip ci] Update changelog --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 291b61529..c6d7a1e4a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## Unreleased + +- Simplified and fixed publishing to PyPI from CI + [PR #183](https://github.com/appliedAI-Initiative/pyDVL/pull/183) + ## 0.2.0 - 📚 Better docs Mostly API documentation and notebooks, plus some bugfixes. From 3ca76e4244a4681cb076f4c92953e03115f58ad4 Mon Sep 17 00:00:00 2001 From: Anes Benmerzoug Date: Fri, 4 Nov 2022 11:52:01 +0100 Subject: [PATCH 5/5] Dummy commit to trigger CI --- .github/workflows/publish.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 2136d7607..abf27d421 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -17,7 +17,7 @@ jobs: - uses: actions/checkout@v3 with: fetch-depth: 0 - - name: Fail if not on master branch + - name: Fail if not on 'master' branch if: github.ref != 'refs/heads/master' run: exit -1 - name: Set up Python 3.8