From 9442d2a47aaf1fca15ecbc6316d0579c4e8ad9d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o?= Date: Sat, 1 Feb 2025 19:55:11 -0300 Subject: [PATCH] remove original repo actions --- .github/actions/setup-poetry/action.yml | 19 --------- .github/scripts/release.sh | 39 ------------------ .github/workflows/cd-docs.yml | 14 ------- .github/workflows/cd.yml | 53 ------------------------- .github/workflows/checks.yml | 40 ------------------- .github/workflows/ci-docs.yml | 16 -------- .github/workflows/ci.yml | 19 --------- .github/workflows/docs.yml | 23 ----------- .github/workflows/pypi.yml | 21 ---------- 9 files changed, 244 deletions(-) delete mode 100644 .github/actions/setup-poetry/action.yml delete mode 100755 .github/scripts/release.sh delete mode 100644 .github/workflows/cd-docs.yml delete mode 100644 .github/workflows/cd.yml delete mode 100644 .github/workflows/checks.yml delete mode 100644 .github/workflows/ci-docs.yml delete mode 100644 .github/workflows/ci.yml delete mode 100644 .github/workflows/docs.yml delete mode 100644 .github/workflows/pypi.yml diff --git a/.github/actions/setup-poetry/action.yml b/.github/actions/setup-poetry/action.yml deleted file mode 100644 index 473326dc..00000000 --- a/.github/actions/setup-poetry/action.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: 'Set up Poetry and install' -description: 'Set up a specific version of Poetry and install dependencies using caching.' -inputs: - python-version: - description: "Version range or exact version of Python or PyPy to use, using SemVer's version range syntax." - default: '3.11' -runs: - using: 'composite' - steps: - - name: Install poetry - run: pipx install poetry==1.8.5 - shell: bash - - uses: actions/setup-python@v5 - with: - python-version: ${{ inputs.python-version }} - cache: 'poetry' - - name: Install dependencies - run: poetry install --all-extras - shell: bash diff --git a/.github/scripts/release.sh b/.github/scripts/release.sh deleted file mode 100755 index 6cac4006..00000000 --- a/.github/scripts/release.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/bash - -set -e # trigger failure on error - do not remove! -set -x # display command on output - -if [ -z "${TARGET_VERSION}" ]; then - >&2 echo "No TARGET_VERSION specified" - exit 1 -fi -CHGLOG_FILE="${CHGLOG_FILE:-CHANGELOG.md}" - -# update package version -poetry version "${TARGET_VERSION}" - -# collect release notes -REL_NOTES=$(mktemp) -poetry run semantic-release changelog --unreleased >> "${REL_NOTES}" - -# update changelog -TMP_CHGLOG=$(mktemp) -TARGET_TAG_NAME="v${TARGET_VERSION}" -RELEASE_URL="$(gh repo view --json url -q ".url")/releases/tag/${TARGET_TAG_NAME}" -printf "## [${TARGET_TAG_NAME}](${RELEASE_URL}) - $(date -Idate)\n\n" >> "${TMP_CHGLOG}" -cat "${REL_NOTES}" >> "${TMP_CHGLOG}" -if [ -f "${CHGLOG_FILE}" ]; then - printf "\n" | cat - "${CHGLOG_FILE}" >> "${TMP_CHGLOG}" -fi -mv "${TMP_CHGLOG}" "${CHGLOG_FILE}" - -# push changes -git config --global user.name 'github-actions[bot]' -git config --global user.email 'github-actions[bot]@users.noreply.github.com' -git add pyproject.toml "${CHGLOG_FILE}" -COMMIT_MSG="chore: bump version to ${TARGET_VERSION} [skip ci]" -git commit -m "${COMMIT_MSG}" -git push origin main - -# create GitHub release (incl. Git tag) -gh release create "${TARGET_TAG_NAME}" -F "${REL_NOTES}" diff --git a/.github/workflows/cd-docs.yml b/.github/workflows/cd-docs.yml deleted file mode 100644 index 1ff7c4fc..00000000 --- a/.github/workflows/cd-docs.yml +++ /dev/null @@ -1,14 +0,0 @@ -name: "Run Docs CD" - -on: - push: - branches: - - "main" - -jobs: - build-deploy-docs: - uses: ./.github/workflows/docs.yml - with: - deploy: true - permissions: - contents: write diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml deleted file mode 100644 index 1f0502dc..00000000 --- a/.github/workflows/cd.yml +++ /dev/null @@ -1,53 +0,0 @@ -name: "Run CD" - -on: - workflow_dispatch: - -env: - # disable keyring (https://github.com/actions/runner-images/issues/6185): - PYTHON_KEYRING_BACKEND: keyring.backends.null.Keyring - -jobs: - code-checks: - uses: ./.github/workflows/checks.yml - pre-release-check: - runs-on: ubuntu-latest - outputs: - TARGET_TAG_V: ${{ steps.version_check.outputs.TRGT_VERSION }} - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 # for fetching tags, required for semantic-release - - uses: ./.github/actions/setup-poetry - - name: Check version of potential release - id: version_check - run: | - TRGT_VERSION=$(poetry run semantic-release print-version) - echo "TRGT_VERSION=${TRGT_VERSION}" >> $GITHUB_OUTPUT - echo "${TRGT_VERSION}" - - name: Check notes of potential release - run: poetry run semantic-release changelog --unreleased - release: - needs: [code-checks, pre-release-check] - if: needs.pre-release-check.outputs.TARGET_TAG_V != '' - environment: auto-release - runs-on: ubuntu-latest - concurrency: release - steps: - - uses: actions/create-github-app-token@v1 - id: app-token - with: - app-id: ${{ vars.CI_APP_ID }} - private-key: ${{ secrets.CI_PRIVATE_KEY }} - - uses: actions/checkout@v4 - with: - token: ${{ steps.app-token.outputs.token }} - fetch-depth: 0 # for fetching tags, required for semantic-release - - uses: ./.github/actions/setup-poetry - - name: Run release script - env: - GH_TOKEN: ${{ steps.app-token.outputs.token }} - TARGET_VERSION: ${{ needs.pre-release-check.outputs.TARGET_TAG_V }} - CHGLOG_FILE: CHANGELOG.md - run: ./.github/scripts/release.sh - shell: bash diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml deleted file mode 100644 index e04e2803..00000000 --- a/.github/workflows/checks.yml +++ /dev/null @@ -1,40 +0,0 @@ -on: - workflow_call: - -jobs: - run-checks: - runs-on: ubuntu-latest - strategy: - matrix: - python-version: ['3.9', '3.10', '3.11', '3.12', '3.13'] - steps: - - uses: actions/checkout@v4 - - name: Install tesseract - run: sudo apt-get update && sudo apt-get install -y tesseract-ocr tesseract-ocr-eng tesseract-ocr-fra tesseract-ocr-deu tesseract-ocr-spa tesseract-ocr-script-latn libleptonica-dev libtesseract-dev pkg-config - - name: Set TESSDATA_PREFIX - run: | - echo "TESSDATA_PREFIX=$(dpkg -L tesseract-ocr-eng | grep tessdata$)" >> "$GITHUB_ENV" - - uses: ./.github/actions/setup-poetry - with: - python-version: ${{ matrix.python-version }} - - name: Run styling check - run: poetry run pre-commit run --all-files - - name: Install with poetry - run: poetry install --all-extras - - name: Testing - run: | - poetry run pytest -v tests - - name: Run examples - run: | - for file in docs/examples/*.py; do - # Skip batch_convert.py - if [[ "$(basename "$file")" =~ ^(batch_convert|minimal|export_multimodal|custom_convert|develop_picture_enrichment).py ]]; then - echo "Skipping $file" - continue - fi - - echo "Running example $file" - poetry run python "$file" || exit 1 - done - - name: Build with poetry - run: poetry build diff --git a/.github/workflows/ci-docs.yml b/.github/workflows/ci-docs.yml deleted file mode 100644 index 6e9134d5..00000000 --- a/.github/workflows/ci-docs.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: "Run Docs CI" - -on: - pull_request: - types: [opened, reopened, synchronize] - push: - branches: - - "**" - - "!gh-pages" - -jobs: - build-docs: - if: ${{ github.event_name == 'push' || (github.event.pull_request.head.repo.full_name != 'DS4SD/docling' && github.event.pull_request.head.repo.full_name != 'ds4sd/docling') }} - uses: ./.github/workflows/docs.yml - with: - deploy: false diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index e2b21ed2..00000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: "Run CI" - -on: - pull_request: - types: [opened, reopened, synchronize] - push: - branches: - - "**" - - "!main" - - "!gh-pages" - -env: - # disable keyring (https://github.com/actions/runner-images/issues/6185): - PYTHON_KEYRING_BACKEND: keyring.backends.null.Keyring - -jobs: - code-checks: - if: ${{ github.event_name == 'push' || (github.event.pull_request.head.repo.full_name != 'DS4SD/docling' && github.event.pull_request.head.repo.full_name != 'ds4sd/docling') }} - uses: ./.github/workflows/checks.yml diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml deleted file mode 100644 index 0fc3ac7a..00000000 --- a/.github/workflows/docs.yml +++ /dev/null @@ -1,23 +0,0 @@ -on: - workflow_call: - inputs: - deploy: - type: boolean - description: "If true, the docs will be deployed." - default: false - -jobs: - run-docs: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: ./.github/actions/setup-poetry - - name: Build docs - run: poetry run mkdocs build --verbose --clean - - name: Make docs LLM ready - if: inputs.deploy - uses: demodrive-ai/llms-txt-action@ad720693843126e6a73910a667d0eba37c1dea4b - - name: Build and push docs - if: inputs.deploy - run: poetry run mkdocs gh-deploy --force --dirty - diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml deleted file mode 100644 index 395f34cd..00000000 --- a/.github/workflows/pypi.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: "Build and publish package" - -on: - release: - types: [published] - -permissions: - contents: read - -env: - # disable keyring (https://github.com/actions/runner-images/issues/6185): - PYTHON_KEYRING_BACKEND: keyring.backends.null.Keyring - -jobs: - build-and-publish: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: ./.github/actions/setup-poetry - - name: Build and publish - run: poetry publish --build --no-interaction --username=__token__ --password=${{ secrets.PYPI_TOKEN }}