From 492724b8022147a033db53f29ee3963394d00c8f Mon Sep 17 00:00:00 2001 From: Thomas Grainger Date: Fri, 22 Oct 2021 10:08:12 +0100 Subject: [PATCH 1/4] publish package on a successfull tag build --- .github/workflows/test.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ac03e37..9997a6f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -44,5 +44,11 @@ jobs: runs-on: ubuntu-latest needs: [test] steps: + - name: Publish package + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') + uses: pypa/gh-action-pypi-publish@release/v1 + with: + user: __token__ + password: ${{ secrets.PYPI_API_TOKEN }} - name: note that all tests succeeded run: echo "🎉" From 602c95811680b7581a938c711b5d0d9db2a69148 Mon Sep 17 00:00:00 2001 From: Thomas Grainger Date: Fri, 22 Oct 2021 10:13:30 +0100 Subject: [PATCH 2/4] build the package --- .github/workflows/test.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9997a6f..db873f0 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -43,7 +43,15 @@ jobs: # https://github.community/t/is-it-possible-to-require-all-github-actions-tasks-to-pass-without-enumerating-them/117957/4?u=graingert runs-on: ubuntu-latest needs: [test] - steps: + steps: + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: "3.10" + - name: build package + run: | + python -m pip install -U build + python -m build - name: Publish package if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') uses: pypa/gh-action-pypi-publish@release/v1 From 7bc4f2ae31f1febe9b0a22c2a813bbb285b34844 Mon Sep 17 00:00:00 2001 From: Thomas Grainger Date: Fri, 22 Oct 2021 10:13:59 +0100 Subject: [PATCH 3/4] remove redundant whitespace --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index db873f0..ba6155f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -43,7 +43,7 @@ jobs: # https://github.community/t/is-it-possible-to-require-all-github-actions-tasks-to-pass-without-enumerating-them/117957/4?u=graingert runs-on: ubuntu-latest needs: [test] - steps: + steps: - name: Set up Python uses: actions/setup-python@v2 with: From e2cd43a23231ccffe6699396355409d96c733017 Mon Sep 17 00:00:00 2001 From: Thomas Grainger Date: Fri, 22 Oct 2021 10:16:19 +0100 Subject: [PATCH 4/4] have to check the code out to build it --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ba6155f..7d82110 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -44,6 +44,7 @@ jobs: runs-on: ubuntu-latest needs: [test] steps: + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v2 with: