diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index 3044164..6c0f0a8 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -75,13 +75,116 @@ jobs: popd shell: bash - - name: Lint + # - name: Lint + # run: | + # poetry run python -m finecode run lint + # shell: bash + + - name: Build finecode_extension_api + if: runner.os == 'Linux' + run: | + pushd finecode_extension_api + 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: | - poetry run python -m finecode run lint + pushd presets/fine_python_format + poetry build + popd shell: bash + # - name: Build finecode + # if: runner.os == 'Linux' + # run: | + # poetry build + # shell: bash + + - name: Collect all distribution packages + if: runner.os == 'Linux' + 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/ + # - 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/ + verbose: true 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.