From 5b48c6c07809e443f860717bb6e52c84e38425ff Mon Sep 17 00:00:00 2001 From: Vladyslav Hnatiuk Date: Sat, 17 May 2025 21:12:27 +0200 Subject: [PATCH 01/10] Extend github actions config with publishing to pypi and testpypi --- .github/workflows/ci-cd.yml | 61 +++++++++++++++++++++++++++++++++++-- 1 file changed, 59 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index 3044164..714d841 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -75,13 +75,70 @@ jobs: popd shell: bash - - name: Lint + # - name: Lint + # run: | + # poetry run python -m finecode run lint + # shell: bash + + - name: Build run: | - poetry run python -m finecode run lint + python -m build shell: bash + + - name: Store the distribution packages + uses: actions/upload-artifact@v4 + with: + name: python-package-distributions + path: dist/ # - name: Run unit tests # if: ${{ !cancelled() }} # run: | # poetry run python -m pytest tests/ # shell: bash + + publish-to-pypi: + name: >- + Publish Python 🐍 distribution 📦 to PyPI + if: startsWith(github.ref, 'refs/tags/') + needs: + - build + runs-on: ubuntu-24.04 + environment: + name: pypi + url: https://pypi.org/p/finecode + permissions: + id-token: write # IMPORTANT: mandatory for trusted publishing + + steps: + - name: Download all the dists + uses: actions/download-artifact@v4 + with: + name: python-package-distributions + path: dist/ + - name: Publish distribution 📦 to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + + publish-to-testpypi: + name: Publish Python 🐍 distribution 📦 to TestPyPI + needs: + - build + runs-on: ubuntu-24.04 + + environment: + name: testpypi + url: https://test.pypi.org/p/finecode + + permissions: + id-token: write # IMPORTANT: mandatory for trusted publishing + + steps: + - name: Download all the dists + uses: actions/download-artifact@v4 + with: + name: python-package-distributions + path: dist/ + - name: Publish distribution 📦 to TestPyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + repository-url: https://test.pypi.org/legacy/ From f0a68464fad77988dbb8538a56ad65872bce78a5 Mon Sep 17 00:00:00 2001 From: Vladyslav Hnatiuk Date: Sat, 17 May 2025 21:16:10 +0200 Subject: [PATCH 02/10] Use poetry build instead of python build --- .github/workflows/ci-cd.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index 714d841..d24032b 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -82,7 +82,7 @@ jobs: - name: Build run: | - python -m build + poetry build shell: bash - name: Store the distribution packages From 534ef68b1d5b8692127691255e1a1f87edc4ecbb Mon Sep 17 00:00:00 2001 From: Vladyslav Hnatiuk Date: Sat, 17 May 2025 21:29:55 +0200 Subject: [PATCH 03/10] Store distribution packages only on linux --- .github/workflows/ci-cd.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index d24032b..afe2b98 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -87,6 +87,7 @@ jobs: - name: Store the distribution packages uses: actions/upload-artifact@v4 + if: runner.os == 'Linux' with: name: python-package-distributions path: dist/ From 955aef634f7e06d7bb2ae90a2b1b8fa4d8415c08 Mon Sep 17 00:00:00 2001 From: Vladyslav Hnatiuk Date: Sat, 17 May 2025 21:43:56 +0200 Subject: [PATCH 04/10] Make output of publish action verbose --- .github/workflows/ci-cd.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index afe2b98..c62e215 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -143,3 +143,4 @@ jobs: uses: pypa/gh-action-pypi-publish@release/v1 with: repository-url: https://test.pypi.org/legacy/ + verbose: true From 397230f438c3e0fefa8079142b1f815335a627f5 Mon Sep 17 00:00:00 2001 From: Vladyslav Hnatiuk Date: Sun, 18 May 2025 07:09:25 +0200 Subject: [PATCH 05/10] Add build and publishing of finecode_extension_api in github actions --- .github/workflows/ci-cd.yml | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index c62e215..d91a7f4 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -79,18 +79,29 @@ jobs: # run: | # poetry run python -m finecode run lint # shell: bash - - - name: Build + + - name: Build finecode_extension_api + if: runner.os == 'Linux' run: | + pushd finecode_extension_api poetry build + popd shell: bash + + # - name: Build finecode + # if: runner.os == 'Linux' + # run: | + # poetry build + # shell: bash - name: Store the distribution packages uses: actions/upload-artifact@v4 if: runner.os == 'Linux' with: - name: python-package-distributions - path: dist/ + name: finecode-distributions + path: | + dist/ + finecode_extension_api/dist/ # - name: Run unit tests # if: ${{ !cancelled() }} From ee6feaa319f7ac7e48df86ad6718ef56015a3d3e Mon Sep 17 00:00:00 2001 From: Vladyslav Hnatiuk Date: Sun, 18 May 2025 07:14:55 +0200 Subject: [PATCH 06/10] Correct name of artifact in ci/cd --- .github/workflows/ci-cd.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index d91a7f4..6cc7a88 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -98,7 +98,7 @@ jobs: uses: actions/upload-artifact@v4 if: runner.os == 'Linux' with: - name: finecode-distributions + name: python-package-distributions path: | dist/ finecode_extension_api/dist/ From ec8077f6e0ac0dfd0fbebce9d80fdf645fa382ef Mon Sep 17 00:00:00 2001 From: Vladyslav Hnatiuk Date: Sun, 18 May 2025 07:57:32 +0200 Subject: [PATCH 07/10] Build black, isort extensions and format preset in ci/cd --- .github/workflows/ci-cd.yml | 38 ++++++++++++++++++++++++++++++++++--- 1 file changed, 35 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index 6cc7a88..b8c1539 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -87,6 +87,30 @@ jobs: poetry build popd shell: bash + + - name: Build fine_python_black + if: runner.os == 'Linux' + run: | + pushd extensions/fine_python_black + poetry build + popd + shell: bash + + - name: Build fine_python_isort + if: runner.os == 'Linux' + run: | + pushd extensions/fine_python_isort + poetry build + popd + shell: bash + + - name: Build fine_python_format + if: runner.os == 'Linux' + run: | + pushd presets/fine_python_format + poetry build + popd + shell: bash # - name: Build finecode # if: runner.os == 'Linux' @@ -94,14 +118,22 @@ jobs: # poetry build # shell: bash + - name: Collect all distribution packages + run: | + mkdir -p dist + cp finecode_extension_api/dist/* dist/ + cp extensions/fine_python_black/dist/* dist/ + cp extensions/fine_python_isort/dist/* dist/ + cp presets/fine_python_format/dist/* dist/ + shell: bash + + - name: Store the distribution packages uses: actions/upload-artifact@v4 if: runner.os == 'Linux' with: name: python-package-distributions - path: | - dist/ - finecode_extension_api/dist/ + path: dist/ # - name: Run unit tests # if: ${{ !cancelled() }} From 96e0b659961e573219d90b2c4375da44e2f95a2d Mon Sep 17 00:00:00 2001 From: Vladyslav Hnatiuk Date: Sun, 18 May 2025 08:00:41 +0200 Subject: [PATCH 08/10] Collect distributables packages only on linux --- .github/workflows/ci-cd.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index b8c1539..f98d35e 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -119,6 +119,7 @@ jobs: # shell: bash - name: Collect all distribution packages + if: runner.os == 'Linux' run: | mkdir -p dist cp finecode_extension_api/dist/* dist/ From 0b5676a730cd71da00821d927f016e9c15209f6a Mon Sep 17 00:00:00 2001 From: Vladyslav Hnatiuk Date: Sun, 18 May 2025 08:07:59 +0200 Subject: [PATCH 09/10] Publish first only finecode_extension_api --- .github/workflows/ci-cd.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index f98d35e..6c0f0a8 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -123,9 +123,9 @@ jobs: run: | mkdir -p dist cp finecode_extension_api/dist/* dist/ - cp extensions/fine_python_black/dist/* dist/ - cp extensions/fine_python_isort/dist/* dist/ - cp presets/fine_python_format/dist/* dist/ + # cp extensions/fine_python_black/dist/* dist/ + # cp extensions/fine_python_isort/dist/* dist/ + # cp presets/fine_python_format/dist/* dist/ shell: bash From 286565166d1847748186a95a174d56598ff301c3 Mon Sep 17 00:00:00 2001 From: Vladyslav Hnatiuk Date: Sun, 18 May 2025 08:17:17 +0200 Subject: [PATCH 10/10] Add readme in finecode_extension_api --- finecode_extension_api/README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/finecode_extension_api/README.md b/finecode_extension_api/README.md index e69de29..e033d62 100644 --- a/finecode_extension_api/README.md +++ b/finecode_extension_api/README.md @@ -0,0 +1,3 @@ +# finecode_extension_api + +Package with FineCode API for extensions.