Skip to content
107 changes: 105 additions & 2 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 3 additions & 0 deletions finecode_extension_api/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# finecode_extension_api

Package with FineCode API for extensions.
Loading