From 20b1f0dad00e0e4fd0dd0888c78671cf395be911 Mon Sep 17 00:00:00 2001 From: Stiofain Fordham <17852477+sdfordham@users.noreply.github.com> Date: Sun, 5 Nov 2023 15:04:39 +0000 Subject: [PATCH 1/5] Split up the workflow yml --- .github/workflows/{main.yml => ancillary.yml} | 22 +------------ .github/workflows/tests.yml | 32 +++++++++++++++++++ 2 files changed, 33 insertions(+), 21 deletions(-) rename .github/workflows/{main.yml => ancillary.yml} (64%) create mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/main.yml b/.github/workflows/ancillary.yml similarity index 64% rename from .github/workflows/main.yml rename to .github/workflows/ancillary.yml index 8d6d2f7..3172521 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/ancillary.yml @@ -1,4 +1,4 @@ -name: pysyncon +name: Lint and code coverage on: push: @@ -10,26 +10,6 @@ permissions: contents: read jobs: - tests: - strategy: - fail-fast: false - matrix: - buildplat: [ubuntu-20.04, windows-2019] - python: ["3.8", "3.9", "3.10", "3.11"] - runs-on: ${{ matrix.buildplat }} - steps: - - name: Checkout - uses: actions/checkout@v3 - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python }} - - name: Install dependencies - run: | - python -m pip install --upgrade pip - python -m pip install -r requirements-dev.txt - - name: Run tests - run: python -m unittest discover -s tests lint: runs-on: ubuntu-latest steps: diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..7988bd8 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,32 @@ +name: Run unittests + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +permissions: + contents: read + +jobs: + tests: + strategy: + fail-fast: false + matrix: + buildplat: [ubuntu-20.04, windows-2019] + python: ["3.8", "3.9", "3.10", "3.11"] + runs-on: ${{ matrix.buildplat }} + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install -r requirements-dev.txt + - name: Run tests + run: python -m unittest discover -s tests From 73499b5c260c56fa0dae37729773d78d7dac381c Mon Sep 17 00:00:00 2001 From: Stiofain Fordham <17852477+sdfordham@users.noreply.github.com> Date: Sun, 5 Nov 2023 15:15:32 +0000 Subject: [PATCH 2/5] Add the publish workflow --- .github/workflows/publish.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..f13cc60 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,29 @@ +name: Pypi package upload + +on: + release: + types: [published] + +permissions: + contents: read + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v3 + with: + python-version: '3.x' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install build + - name: Build package + run: python -m build + - name: Publish package + uses: pypa/gh-action-pypi-publish + with: + user: __token__ + password: ${{ secrets.PYPI_API_TOKEN }} From 4f7b3881199e040a4d04d5b9614e356cdcfe54e3 Mon Sep 17 00:00:00 2001 From: Stiofain Fordham <17852477+sdfordham@users.noreply.github.com> Date: Sun, 5 Nov 2023 15:25:58 +0000 Subject: [PATCH 3/5] Fix publish version to a specific commit --- .github/workflows/publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index f13cc60..8823587 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -23,7 +23,7 @@ jobs: - name: Build package run: python -m build - name: Publish package - uses: pypa/gh-action-pypi-publish + uses: pypa/gh-action-pypi-publish@79739dc2f2bf6bcfd21ecf9af9f06bd643dbeeae with: user: __token__ password: ${{ secrets.PYPI_API_TOKEN }} From dfa7515e7e7db6774578c58d54876679ef8b116a Mon Sep 17 00:00:00 2001 From: Stiofain <17852477+sdfordham@users.noreply.github.com> Date: Sun, 5 Nov 2023 17:00:27 +0000 Subject: [PATCH 4/5] Test workflow --- .github/workflows/publish.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 8823587..aacbf57 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -26,4 +26,5 @@ jobs: uses: pypa/gh-action-pypi-publish@79739dc2f2bf6bcfd21ecf9af9f06bd643dbeeae with: user: __token__ - password: ${{ secrets.PYPI_API_TOKEN }} + password: ${{ secrets.TEST_PYPI_API_TOKEN }} + repository-url: https://test.pypi.org/legacy/ From 84e886da8e1da819cba73a3cdd8c514ba2593038 Mon Sep 17 00:00:00 2001 From: Stiofain <17852477+sdfordham@users.noreply.github.com> Date: Sun, 5 Nov 2023 17:01:14 +0000 Subject: [PATCH 5/5] Update the version --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 6756ae0..730168a 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = pysyncon -version = 1.0.0 +version = 1.0.1 author = Stiofán Fordham url = https://github.com/sdfordham/pysyncon/ long_description = file: README.md