From 04413e3f21b4aaa42ffde1510acb880dce8fdf8f Mon Sep 17 00:00:00 2001 From: Pavel Dat Date: Tue, 12 Sep 2023 12:34:11 +0300 Subject: [PATCH 1/4] Try ti publish package to test.pypi --- .github/workflows/deploy-job.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy-job.yml b/.github/workflows/deploy-job.yml index 0882600..bcc5aa6 100644 --- a/.github/workflows/deploy-job.yml +++ b/.github/workflows/deploy-job.yml @@ -55,7 +55,6 @@ jobs: deploy: runs-on: ubuntu-latest needs: test - if: github.ref == 'refs/heads/main' steps: - uses: actions/checkout@v3 - name: Download artifacts @@ -63,3 +62,8 @@ jobs: with: name: built-artifacts path: dist + - name: Publish package to Tet PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + password: ${{ secrets.TEST_PYPI_API_TOKEN }} + repository-url: https://test.pypi.org/legacy/ From b94393e137b67f8486baadd5d5058fe4ea5146fc Mon Sep 17 00:00:00 2001 From: Pavel Dat Date: Tue, 12 Sep 2023 13:13:00 +0300 Subject: [PATCH 2/4] Configure publishing package to PyPI and Test-PyPI --- .github/workflows/deploy-job.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy-job.yml b/.github/workflows/deploy-job.yml index bcc5aa6..46aa37b 100644 --- a/.github/workflows/deploy-job.yml +++ b/.github/workflows/deploy-job.yml @@ -62,8 +62,13 @@ jobs: with: name: built-artifacts path: dist - - name: Publish package to Tet PyPI + - name: Publish package to Test PyPI uses: pypa/gh-action-pypi-publish@release/v1 with: password: ${{ secrets.TEST_PYPI_API_TOKEN }} repository-url: https://test.pypi.org/legacy/ + - name: Publish package to PyPI + if: github.ref == 'refs/heads/main' + uses: pypa/gh-action-pypi-publish@release/v1 + with: + password: ${{ secrets.PYPI_API_TOKEN }} From 7c27f220f0ee8c4da47731a0e116c1e174ef640d Mon Sep 17 00:00:00 2001 From: Pavel Dat Date: Tue, 12 Sep 2023 13:35:32 +0300 Subject: [PATCH 3/4] Change package version --- .github/workflows/deploy-job.yml | 1 + CHANGELOG.md | 5 +++++ setup.cfg | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy-job.yml b/.github/workflows/deploy-job.yml index 46aa37b..07dfd6f 100644 --- a/.github/workflows/deploy-job.yml +++ b/.github/workflows/deploy-job.yml @@ -63,6 +63,7 @@ jobs: name: built-artifacts path: dist - name: Publish package to Test PyPI + if: github.ref == 'refs/heads/main' uses: pypa/gh-action-pypi-publish@release/v1 with: password: ${{ secrets.TEST_PYPI_API_TOKEN }} diff --git a/CHANGELOG.md b/CHANGELOG.md index f62479d..c0e35d2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # gods_eye changelog +## 1.0.6 +- Add pipeline. + Add deploy to PyPI. + Add tests and code check. + ## 1.0.5 - Pylint check code style diff --git a/setup.cfg b/setup.cfg index 8d4feca..3bec01a 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = gods_eye -version = 1.0.5 +version = 1.0.6 author = Pavel Dat author_email = dats.pavel1999@gmail.com description = A set of tools which should be used in Gods Eye From 4a07469e5f0fae735a8610b9b974b4274e0522a8 Mon Sep 17 00:00:00 2001 From: Pavel Dat Date: Tue, 12 Sep 2023 13:47:46 +0300 Subject: [PATCH 4/4] Modify deploy job --- .github/workflows/deploy-job.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy-job.yml b/.github/workflows/deploy-job.yml index 07dfd6f..4a65d52 100644 --- a/.github/workflows/deploy-job.yml +++ b/.github/workflows/deploy-job.yml @@ -54,22 +54,31 @@ jobs: python3 -m pytest -sr tests/test_c*.py deploy: runs-on: ubuntu-latest + if: github.ref == 'refs/heads/main' needs: test steps: - uses: actions/checkout@v3 + - name: Verify Changed files + uses: tj-actions/verify-changed-files@v16 + id: verify-changed-files + with: + files: | + src/**/*.py + setup.cfg - name: Download artifacts + if: steps.verify-changed-files.outputs.files_changed == 'true' uses: actions/download-artifact@v3 with: name: built-artifacts path: dist - name: Publish package to Test PyPI - if: github.ref == 'refs/heads/main' + if: steps.verify-changed-files.outputs.files_changed == 'true' uses: pypa/gh-action-pypi-publish@release/v1 with: password: ${{ secrets.TEST_PYPI_API_TOKEN }} repository-url: https://test.pypi.org/legacy/ - name: Publish package to PyPI - if: github.ref == 'refs/heads/main' + if: steps.verify-changed-files.outputs.files_changed == 'true' uses: pypa/gh-action-pypi-publish@release/v1 with: password: ${{ secrets.PYPI_API_TOKEN }}