Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move docs to Publish CI and use Github Releases in Publish CI. #232

Merged
merged 2 commits into from
Feb 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 0 additions & 52 deletions .github/workflows/docs.yml

This file was deleted.

104 changes: 103 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ jobs:

- uses: actions/upload-artifact@v3
with:
name: wheel
path: ./wheelhouse/*.whl

build_sdist:
Expand All @@ -91,6 +92,7 @@ jobs:

- uses: actions/upload-artifact@v3
with:
name: wheel
path: dist/*.tar.gz

build_cc_wheels:
Expand Down Expand Up @@ -147,6 +149,7 @@ jobs:
CARGO_BUILD_TARGET: ${{ matrix.platform.target }}
- uses: actions/upload-artifact@v3
with:
name: wheel
path: dist/*.whl

upload_pypi:
Expand All @@ -156,7 +159,7 @@ jobs:
steps:
- uses: actions/download-artifact@v3
with:
name: artifact
name: wheel
path: dist

- uses: pypa/gh-action-pypi-publish@master
Expand All @@ -165,3 +168,102 @@ jobs:
user: __token__
password: ${{ secrets.PYPI_ACCESS_TOKEN }}
skip_existing: true

build_docs:
name: build static docs
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python-version: ["3.11"]
steps:
- uses: actions/checkout@v3
with:
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token
fetch-depth: 0 # otherwise, you will failed to push refs to dest repo
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Build docs
run: |
make docs-build
touch docs/.nojekyll
echo "FLUVIO_PYTHON_CLIENT_VERSION=$(venv/bin/python setup.py --version 2> /dev/null)" >> $GITHUB_ENV

- uses: actions/upload-artifact@v3
with:
name: docs
path: docs

publish_docs_to_pages:
needs: [build_docs]
name: push static docs
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v3
with:
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token
fetch-depth: 0 # otherwise, you will failed to push refs to dest repo

- uses: actions/download-artifact@v3
with:
name: docs
path: docs-latest

- name: "Git Fetch & Checkout"
run: |
git config --local user.email "[email protected]"
git config --local user.name "Fluvio Authors"
git fetch --all
git checkout -b docs --track origin/docs
git merge -X theirs origin/main -m "Merge remote-tracking branch 'origin/main into docs" --allow-unrelated-histories

- name: Commit files
run: |
git add --force docs
git commit -m "Updated Fluvio Python client docs" -a || true

- name: Push changes
if: github.event_name == 'workflow_dispatch'
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: docs

upload_to_github_releases:
needs: [build_wheels, build_sdist, build_cc_wheels, build_docs]
runs-on: ubuntu-latest

steps:
- uses: actions/download-artifact@v3
with:
name: wheel
path: dist

- uses: actions/download-artifact@v3
with:
name: docs
path: docs

- name: Release
uses: softprops/action-gh-release@v1
if: github.ref == 'refs/heads/main' && github.event_name != 'workflow_dispatch'
with:
name: latest
prerelease: true
files: |
dist/*
docs

- name: Release
uses: softprops/action-gh-release@v1
if: github.event_name == 'workflow_dispatch'
with:
name: ${{ github.FLUVIO_PYTHON_CLIENT_VERSION }}
files: |
dist/*
docs
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,13 @@ manylinux2014_aarch64:
manylinux2014_x86_64:
python setup.py bdist_wheel --py-limited-api=cp38 --plat-name manylinux2014_x86_64

PDOC_OPTS=--logo='https://www.fluvio.io/images/assets/fluvio-with-text.svg' --favicon='https://www.fluvio.io/images/favicon.ico'

docs-serve: venv-pip build-dev
$(PYTHON) -m pdoc fluvio
$(PYTHON) -m pdoc fluvio $(PDOC_OPTS)

docs-build: venv-pip build-dev
$(PYTHON) -m pdoc fluvio -o docs
$(PYTHON) -m pdoc fluvio -o docs/ $(PDOC_OPTS)

clean:
rm -rf venv fluvio/*.so target dist build
10 changes: 5 additions & 5 deletions integration-tests/test_fluvio_python.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,22 @@
def create_topic(topic):
import subprocess

subprocess.run("fluvio topic create %s" % topic, shell=True)
subprocess.run(["fluvio", "topic", "create", topic], shell=True).check_returncode()


def delete_topic(topic):
import subprocess

subprocess.run("fluvio topic delete %s" % topic, shell=True)
subprocess.run(["fluvio", "topic", "delete", topic], shell=True).check_returncode()


def create_smartmodule(sm_name, sm_path):
import subprocess

subprocess.run(
"fluvio smartmodule create %s --wasm-file %s" % (sm_name, sm_path), shell=True
)
subprocess.run("fluvio smartmodule list", shell=True)
["fluvio", "smartmodule", "create", sm_name, "--wasm-file", sm_path], shell=True
).check_returncode()
subprocess.run(["fluvio", "smartmodule", "list"], shell=True)


def delete_smartmodule(sm_name):
Expand Down