commit 80ff5677eacec9271f342525155c250d9245c54c Author: shamoon <4887959+shamoon@users.noreply.github.com> Date: Mon Dec 4 06:40:17 2023 -0800 Fix: bulk edit object permissions should use permissions object (#4797) commit 62c417cd5189be0b93e3c0529326609f9d1e4f40 Author: Trenton Holmes <797416+stumpylog@users.noreply.github.com> Date: Sun Dec 3 19:09:02 2023 -0800 Fixes the 0023 migration to include the new help text and verbose name commit f27f25aa03d032ad7ca6a5f2ba41f83bd00c0bd7 Author: shamoon <4887959+shamoon@users.noreply.github.com> Date: Sun Dec 3 15:35:30 2023 -0800 Enhancement: support assigning custom fields via consumption templates (#4727) commit 285a4b5aef0aa4676ee66751a381e77a9e9fcdcf Author: shamoon <4887959+shamoon@users.noreply.github.com> Date: Sun Dec 3 12:57:43 2023 -0800 Fix: empty strings for consumption template fields should be treated as None (#4762) commit 47a2ded30d7e77f2a264b187821af001232ce3d5 Author: shamoon <4887959+shamoon@users.noreply.github.com> Date: Sat Dec 2 16:52:48 2023 -0800 Fix: use default permissions for objects created via dropdown (#4778) commit 5b502b1e1a34528b59a0af0a01e73a1f9e7c0656 Author: Trenton H <797416+stumpylog@users.noreply.github.com> Date: Sat Dec 2 16:18:06 2023 -0800 Use the original image file for the checksum, not the maybe alpha removed version (#4781) commit aff56077a8ac4d4ec78860d52b824961fada847b Author: shamoon <4887959+shamoon@users.noreply.github.com> Date: Sat Dec 2 08:26:42 2023 -0800 Feature: update user profile (#4678) commit 6e371ac5ac2227a6bdef5e15483f5b478ba78c4d Author: Trenton H <797416+stumpylog@users.noreply.github.com> Date: Sat Dec 2 08:26:19 2023 -0800 Enhancement: Allow excluding mail attachments by name (#4691) * Adds new filtering to exclude attachments from processing * Frontend use include / exclude mail rule filename filters --------- Co-authored-by: shamoon <4887959+shamoon@users.noreply.github.com> commit 1b69b89d2dd4ec021aa6e3bceb175340cdd4e0ff Author: shamoon <4887959+shamoon@users.noreply.github.com> Date: Sat Dec 2 08:24:17 2023 -0800 Chore: Remove unneeded .env entry, revert crowdin action rm, reduce frequency commit 5a20c8e512a7c8a45c26eed5f9e0cf3b1bb04661 Author: shamoon <4887959+shamoon@users.noreply.github.com> Date: Sat Dec 2 07:56:56 2023 -0800 Fix version checker GitHub api url (#4773) commit 4ca1503beb1c65eb4f77ac992b4b3ea74fbc6fd4 Author: shamoon <4887959+shamoon@users.noreply.github.com> Date: Sat Dec 2 07:47:57 2023 -0800 Fix: Limit global drag-drop to events with files (#4767) commit 20f27fe32ffe144813d6c69e3326bf230a2da52a Author: shamoon <4887959+shamoon@users.noreply.github.com> Date: Fri Dec 1 18:05:43 2023 -0800 Remove the pngx .env file for crowdin action commit 1a50d6bb8624a3dd419cadb48e4ee5416fd46ce6 Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat Dec 2 02:04:16 2023 +0000 Bump the actions group with 2 updates (#4745) Bumps the actions group with 2 updates: [actions/github-script](https://github.com/actions/github-script) and [stumpylog/image-cleaner-action](https://github.com/stumpylog/image-cleaner-action). Updates `actions/github-script` from 6 to 7 - [Release notes](https://github.com/actions/github-script/releases) - [Commits](https://github.com/actions/github-script/compare/v6...v7) Updates `stumpylog/image-cleaner-action` from 0.3.0 to 0.4.0 - [Release notes](https://github.com/stumpylog/image-cleaner-action/releases) - [Changelog](https://github.com/stumpylog/image-cleaner-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/stumpylog/image-cleaner-action/compare/v0.3.0...v0.4.0) --- updated-dependencies: - dependency-name: actions/github-script dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions - dependency-name: stumpylog/image-cleaner-action dependency-type: direct:production update-type: version-update:semver-minor dependency-group: actions ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> commit 0b16c2db0372535d18e75267f0a26e4d7f4c812a Author: shamoon <4887959+shamoon@users.noreply.github.com> Date: Fri Dec 1 17:54:00 2023 -0800 Update crowdin action triggers commit 76ac8883865e123bb48f80336cc0658f7d913249 Author: shamoon <4887959+shamoon@users.noreply.github.com> Date: Fri Dec 1 17:44:33 2023 -0800 Chore: Implement crowdin GHA (#4706) commit 7cfa05d7f2c63d2a1c25eb4e0b54ad3a52726a59 Author: Paperless-ngx Bot [bot] <99855517+paperlessngx-bot@users.noreply.github.com> Date: Fri Dec 1 17:44:05 2023 -0800 New Crowdin updates (#4729) commit e3496d04858337a193b623fabc8cc49ec0dc08cf Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat Dec 2 01:07:13 2023 +0000 Bump the frontend-eslint-dependencies group in /src-ui with 3 updates (#4756) Bumps the frontend-eslint-dependencies group in /src-ui with 3 updates: [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin), [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) and [eslint](https://github.com/eslint/eslint). Updates `@typescript-eslint/eslint-plugin` from 6.9.1 to 6.13.1 - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v6.13.1/packages/eslint-plugin) Updates `@typescript-eslint/parser` from 6.9.1 to 6.13.1 - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v6.13.1/packages/parser) Updates `eslint` from 8.52.0 to 8.55.0 - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v8.52.0...v8.55.0) --- updated-dependencies: - dependency-name: "@typescript-eslint/eslint-plugin" dependency-type: direct:development update-type: version-update:semver-minor dependency-group: frontend-eslint-dependencies - dependency-name: "@typescript-eslint/parser" dependency-type: direct:development update-type: version-update:semver-minor dependency-group: frontend-eslint-dependencies - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-minor dependency-group: frontend-eslint-dependencies ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> commit d2c33c00746ecc4ceba35a1ce5339354fdbf20ea Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat Dec 2 00:58:27 2023 +0000 Bump the frontend-jest-dependencies group in /src-ui with 2 updates (#4744) Bumps the frontend-jest-dependencies group in /src-ui with 2 updates: [@types/jest](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/jest) and [jest-preset-angular](https://github.com/thymikee/jest-preset-angular). Updates `@types/jest` from 29.5.7 to 29.5.10 - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/jest) Updates `jest-preset-angular` from 13.1.2 to 13.1.4 - [Release notes](https://github.com/thymikee/jest-preset-angular/releases) - [Changelog](https://github.com/thymikee/jest-preset-angular/blob/main/CHANGELOG.md) - [Commits](https://github.com/thymikee/jest-preset-angular/compare/v13.1.2...v13.1.4) --- updated-dependencies: - dependency-name: "@types/jest" dependency-type: direct:development update-type: version-update:semver-patch dependency-group: frontend-jest-dependencies - dependency-name: jest-preset-angular dependency-type: direct:development update-type: version-update:semver-patch dependency-group: frontend-jest-dependencies ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> commit 9c5caecafadc6f28e414117ba7be329243863608 Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat Dec 2 00:49:46 2023 +0000 Bump @playwright/test from 1.39.0 to 1.40.1 in /src-ui (#4749) Bumps [@playwright/test](https://github.com/microsoft/playwright) from 1.39.0 to 1.40.1. - [Release notes](https://github.com/microsoft/playwright/releases) - [Commits](https://github.com/microsoft/playwright/compare/v1.39.0...v1.40.1) --- updated-dependencies: - dependency-name: "@playwright/test" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> commit 64651d5a8424488ad4878bb61098376c550d892e Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat Dec 2 00:38:35 2023 +0000 Bump wait-on from 7.0.1 to 7.2.0 in /src-ui (#4747) Bumps [wait-on](https://github.com/jeffbski/wait-on) from 7.0.1 to 7.2.0. - [Release notes](https://github.com/jeffbski/wait-on/releases) - [Commits](https://github.com/jeffbski/wait-on/compare/v7.0.1...v7.2.0) --- updated-dependencies: - dependency-name: wait-on dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> commit 4493236879bcc70aa3e4b6be769a543d9ada239d Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri Dec 1 16:28:50 2023 -0800 Bump @types/node from 20.8.10 to 20.10.2 in /src-ui (#4748) Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 20.8.10 to 20.10.2. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) --- updated-dependencies: - dependency-name: "@types/node" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> commit ce643942ea4f2635a13c22e34a933b254647d560 Author: omahs <73983677+omahs@users.noreply.github.com> Date: Fri Dec 1 15:55:03 2023 +0100 Documentation: Fix typos (#4737) commit 46d216b02f35abb5fdbed0539984b8d262192e01 Author: shamoon <4887959+shamoon@users.noreply.github.com> Date: Thu Nov 30 23:14:59 2023 -0800 Remove project actions in favor of GH workflows commit 133d43ae3057bceb56cbedaf96742ce62c0d7930 Author: shamoon <4887959+shamoon@users.noreply.github.com> Date: Thu Nov 30 19:08:03 2023 -0800 Enhancement: auto-refresh logs & tasks (#4680) commit 27155cb7e3230a6909ff9b339e41bf423fb08e64 Author: Trenton H <797416+stumpylog@users.noreply.github.com> Date: Thu Nov 30 17:12:14 2023 -0800 Fixes the image cleaner not running for the registry cache (#4732) commit 69be86e16c956e2129baef318e76a5f4cadf8b7a Author: Trenton Holmes <797416+stumpylog@users.noreply.github.com> Date: Thu Nov 30 07:11:46 2023 -0800 Resets version string to 2.0.1-dev commit 65f6b0881ea2dce37a9c8b8ee079278e4fd81865 Author: Trenton Holmes <797416+stumpylog@users.noreply.github.com> Date: Thu Nov 30 07:11:00 2023 -0800 Bumps version to 2.0.1 commit c2bede40c7094e46f49640790cf2267bd273dadd Merge: 6575c6940 33c2398de Author: Trenton Holmes <797416+stumpylog@users.noreply.github.com> Date: Thu Nov 30 07:10:29 2023 -0800 Merge remote-tracking branch 'origin/dev' commit 33c2398de949dd4ee97b08736e5964efab2fcc01 Author: Paperless-ngx Bot [bot] <99855517+paperlessngx-bot@users.noreply.github.com> Date: Thu Nov 30 07:08:10 2023 -0800 New Crowdin updates (#4695) commit 64cfc43891fbc7da692c138e73922d45b2e12c8c Author: Trenton H <797416+stumpylog@users.noreply.github.com> Date: Thu Nov 30 07:00:54 2023 -0800 Inreases the length to 5, allowing for commas as well as values (#4719) commit 6575c69409afeb68f70fd602832e15c9d0701bc2 Author: shamoon <4887959+shamoon@users.noreply.github.com> Date: Wed Nov 29 21:56:05 2023 -0800 Fix: restore docs search commit e3f4e0b77572a9a784f748a79aa78c25388fb77c Author: Trenton H <797416+stumpylog@users.noreply.github.com> Date: Wed Nov 29 12:18:44 2023 -0800 Adds new setting to control color conversions (#4709) commit 5be89bfda5228e19351387351b27ece458528317 Author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed Nov 29 11:50:30 2023 -0800 Changelog v2.0.0 - GHA (#4693) Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> commit e1b573adeb3f9b644fb51bd9359b51922df10732 Author: Trenton H <797416+stumpylog@users.noreply.github.com> Date: Wed Nov 29 11:28:27 2023 -0800 Fix: Add a warning about a low image DPI which may cause OCR to fail (#4708) commit 0913c7aa9efbd071bd5c423b5d5de5cf12617185 Author: shamoon <4887959+shamoon@users.noreply.github.com> Date: Wed Nov 29 11:10:55 2023 -0800 Fix: share links for URLs containing 'api' incorrect in dropdown (#4701)
664 lines
23 KiB
YAML
664 lines
23 KiB
YAML
name: ci
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
# https://semver.org/#spec-item-2
|
|
- 'v[0-9]+.[0-9]+.[0-9]+'
|
|
# https://semver.org/#spec-item-9
|
|
- 'v[0-9]+.[0-9]+.[0-9]+-beta.rc[0-9]+'
|
|
branches-ignore:
|
|
- 'translations**'
|
|
pull_request:
|
|
branches-ignore:
|
|
- 'translations**'
|
|
|
|
env:
|
|
# This is the version of pipenv all the steps will use
|
|
# If changing this, change Dockerfile
|
|
DEFAULT_PIP_ENV_VERSION: "2023.10.24"
|
|
# This is the default version of Python to use in most steps which aren't specific
|
|
DEFAULT_PYTHON_VERSION: "3.10"
|
|
|
|
jobs:
|
|
pre-commit:
|
|
# We want to run on external PRs, but not on our own internal PRs as they'll be run
|
|
# by the push to the branch. Without this if check, checks are duplicated since
|
|
# internal PRs match both the push and pull_request events.
|
|
if:
|
|
github.event_name == 'push' || github.event.pull_request.head.repo.full_name !=
|
|
github.repository
|
|
|
|
name: Linting Checks
|
|
runs-on: ubuntu-22.04
|
|
steps:
|
|
-
|
|
name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
-
|
|
name: Install python
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: ${{ env.DEFAULT_PYTHON_VERSION }}
|
|
-
|
|
name: Check files
|
|
uses: pre-commit/action@v3.0.0
|
|
|
|
documentation:
|
|
name: "Build Documentation"
|
|
runs-on: ubuntu-22.04
|
|
needs:
|
|
- pre-commit
|
|
steps:
|
|
-
|
|
name: Checkout
|
|
uses: actions/checkout@v4
|
|
-
|
|
name: Set up Python
|
|
id: setup-python
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: ${{ env.DEFAULT_PYTHON_VERSION }}
|
|
cache: "pipenv"
|
|
cache-dependency-path: 'Pipfile.lock'
|
|
-
|
|
name: Install pipenv
|
|
run: |
|
|
pip install --user pipenv==${{ env.DEFAULT_PIP_ENV_VERSION }}
|
|
-
|
|
name: Install dependencies
|
|
run: |
|
|
pipenv --python ${{ steps.setup-python.outputs.python-version }} sync --dev
|
|
-
|
|
name: List installed Python dependencies
|
|
run: |
|
|
pipenv --python ${{ steps.setup-python.outputs.python-version }} run pip list
|
|
-
|
|
name: Make documentation
|
|
run: |
|
|
pipenv --python ${{ steps.setup-python.outputs.python-version }} run mkdocs build --config-file ./mkdocs.yml
|
|
-
|
|
name: Upload artifact
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: documentation
|
|
path: site/
|
|
retention-days: 7
|
|
|
|
documentation-deploy:
|
|
name: "Deploy Documentation"
|
|
runs-on: ubuntu-22.04
|
|
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
|
needs:
|
|
- documentation
|
|
steps:
|
|
-
|
|
name: Checkout
|
|
uses: actions/checkout@v4
|
|
-
|
|
name: Deploy docs
|
|
uses: mhausenblas/mkdocs-deploy-gh-pages@master
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
CUSTOM_DOMAIN: docs.paperless-ngx.com
|
|
CONFIG_FILE: mkdocs.yml
|
|
EXTRA_PACKAGES: build-base
|
|
REQUIREMENTS: docs/requirements.txt
|
|
|
|
tests-backend:
|
|
name: "Backend Tests (Python ${{ matrix.python-version }})"
|
|
runs-on: ubuntu-22.04
|
|
needs:
|
|
- pre-commit
|
|
strategy:
|
|
matrix:
|
|
python-version: ['3.9', '3.10', '3.11']
|
|
fail-fast: false
|
|
steps:
|
|
-
|
|
name: Checkout
|
|
uses: actions/checkout@v4
|
|
-
|
|
name: Start containers
|
|
run: |
|
|
docker compose --file ${GITHUB_WORKSPACE}/docker/compose/docker-compose.ci-test.yml pull --quiet
|
|
docker compose --file ${GITHUB_WORKSPACE}/docker/compose/docker-compose.ci-test.yml up --detach
|
|
-
|
|
name: Set up Python
|
|
id: setup-python
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: "${{ matrix.python-version }}"
|
|
cache: "pipenv"
|
|
cache-dependency-path: 'Pipfile.lock'
|
|
-
|
|
name: Install pipenv
|
|
run: |
|
|
pip install --user pipenv==${{ env.DEFAULT_PIP_ENV_VERSION }}
|
|
-
|
|
name: Install system dependencies
|
|
run: |
|
|
sudo apt-get update -qq
|
|
sudo apt-get install -qq --no-install-recommends unpaper tesseract-ocr imagemagick ghostscript libzbar0 poppler-utils
|
|
-
|
|
name: Configure ImageMagick
|
|
run: |
|
|
sudo cp docker/imagemagick-policy.xml /etc/ImageMagick-6/policy.xml
|
|
-
|
|
name: Install Python dependencies
|
|
run: |
|
|
pipenv --python ${{ steps.setup-python.outputs.python-version }} run python --version
|
|
pipenv --python ${{ steps.setup-python.outputs.python-version }} sync --dev
|
|
-
|
|
name: List installed Python dependencies
|
|
run: |
|
|
pipenv --python ${{ steps.setup-python.outputs.python-version }} run pip list
|
|
-
|
|
name: Tests
|
|
env:
|
|
PAPERLESS_CI_TEST: 1
|
|
# Enable paperless_mail testing against real server
|
|
PAPERLESS_MAIL_TEST_HOST: ${{ secrets.TEST_MAIL_HOST }}
|
|
PAPERLESS_MAIL_TEST_USER: ${{ secrets.TEST_MAIL_USER }}
|
|
PAPERLESS_MAIL_TEST_PASSWD: ${{ secrets.TEST_MAIL_PASSWD }}
|
|
run: |
|
|
cd src/
|
|
pipenv --python ${{ steps.setup-python.outputs.python-version }} run pytest -ra
|
|
-
|
|
name: Upload coverage
|
|
if: ${{ matrix.python-version == env.DEFAULT_PYTHON_VERSION }}
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: backend-coverage-report
|
|
path: src/coverage.xml
|
|
retention-days: 7
|
|
if-no-files-found: warn
|
|
-
|
|
name: Stop containers
|
|
if: always()
|
|
run: |
|
|
docker compose --file ${GITHUB_WORKSPACE}/docker/compose/docker-compose.ci-test.yml logs
|
|
docker compose --file ${GITHUB_WORKSPACE}/docker/compose/docker-compose.ci-test.yml down
|
|
|
|
install-frontend-depedendencies:
|
|
name: "Install Frontend Dependendencies"
|
|
runs-on: ubuntu-22.04
|
|
needs:
|
|
- pre-commit
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
-
|
|
name: Use Node.js 20
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 20.x
|
|
cache: 'npm'
|
|
cache-dependency-path: 'src-ui/package-lock.json'
|
|
- name: Cache frontend depdendencies
|
|
id: cache-frontend-deps
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: |
|
|
~/.npm
|
|
~/.cache
|
|
key: ${{ runner.os }}-frontenddeps-${{ hashFiles('src-ui/package-lock.json') }}
|
|
-
|
|
name: Install dependencies
|
|
if: steps.cache-frontend-deps.outputs.cache-hit != 'true'
|
|
run: cd src-ui && npm ci
|
|
-
|
|
name: Install Playwright
|
|
if: steps.cache-frontend-deps.outputs.cache-hit != 'true'
|
|
run: cd src-ui && npx playwright install --with-deps
|
|
|
|
tests-frontend:
|
|
name: "Frontend Tests (Node ${{ matrix.node-version }} - ${{ matrix.shard-index }}/${{ matrix.shard-count }})"
|
|
runs-on: ubuntu-22.04
|
|
needs:
|
|
- install-frontend-depedendencies
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
node-version: [20.x]
|
|
shard-index: [1, 2, 3, 4]
|
|
shard-count: [4]
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
-
|
|
name: Use Node.js 20
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 20.x
|
|
cache: 'npm'
|
|
cache-dependency-path: 'src-ui/package-lock.json'
|
|
- name: Cache frontend depdendencies
|
|
id: cache-frontend-deps
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: |
|
|
~/.npm
|
|
~/.cache
|
|
key: ${{ runner.os }}-frontenddeps-${{ hashFiles('src-ui/package-lock.json') }}
|
|
- name: Re-link Angular cli
|
|
run: cd src-ui && npm link @angular/cli
|
|
-
|
|
name: Linting checks
|
|
run: cd src-ui && npm run lint
|
|
-
|
|
name: Run Jest unit tests
|
|
run: cd src-ui && npm run test -- --max-workers=2 --shard=${{ matrix.shard-index }}/${{ matrix.shard-count }}
|
|
-
|
|
name: Upload Jest coverage
|
|
if: always()
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: jest-coverage-report-${{ matrix.shard-index }}
|
|
path: |
|
|
src-ui/coverage/coverage-final.json
|
|
src-ui/coverage/lcov.info
|
|
src-ui/coverage/clover.xml
|
|
retention-days: 7
|
|
if-no-files-found: warn
|
|
-
|
|
name: Run Playwright e2e tests
|
|
run: cd src-ui && npx playwright test --shard ${{ matrix.shard-index }}/${{ matrix.shard-count }}
|
|
-
|
|
name: Upload Playwright test results
|
|
if: always()
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: playwright-report
|
|
path: src-ui/playwright-report
|
|
retention-days: 7
|
|
|
|
tests-coverage-upload:
|
|
name: "Upload Coverage"
|
|
runs-on: ubuntu-22.04
|
|
needs:
|
|
- tests-backend
|
|
- tests-frontend
|
|
steps:
|
|
-
|
|
uses: actions/checkout@v4
|
|
-
|
|
name: Download frontend coverage
|
|
uses: actions/download-artifact@v3
|
|
with:
|
|
path: src-ui/coverage/
|
|
-
|
|
name: Upload frontend coverage to Codecov
|
|
uses: codecov/codecov-action@v3
|
|
with:
|
|
# not required for public repos, but intermittently fails otherwise
|
|
token: ${{ secrets.CODECOV_TOKEN }}
|
|
flags: frontend
|
|
directory: src-ui/coverage/
|
|
# dont include backend coverage files here
|
|
files: '!coverage.xml'
|
|
-
|
|
name: Download backend coverage
|
|
uses: actions/download-artifact@v3
|
|
with:
|
|
name: backend-coverage-report
|
|
path: src/
|
|
-
|
|
name: Upload coverage to Codecov
|
|
uses: codecov/codecov-action@v3
|
|
with:
|
|
# not required for public repos, but intermittently fails otherwise
|
|
token: ${{ secrets.CODECOV_TOKEN }}
|
|
# future expansion
|
|
flags: backend
|
|
directory: src/
|
|
|
|
build-docker-image:
|
|
name: Build Docker image for ${{ github.ref_name }}
|
|
runs-on: ubuntu-22.04
|
|
if: github.event_name == 'push' && (startsWith(github.ref, 'refs/heads/feature-') || github.ref == 'refs/heads/dev' || github.ref == 'refs/heads/beta' || contains(github.ref, 'beta.rc') || startsWith(github.ref, 'refs/tags/v'))
|
|
concurrency:
|
|
group: ${{ github.workflow }}-build-docker-image-${{ github.ref_name }}
|
|
cancel-in-progress: true
|
|
needs:
|
|
- tests-backend
|
|
- tests-frontend
|
|
steps:
|
|
-
|
|
name: Check pushing to Docker Hub
|
|
id: push-other-places
|
|
# Only push to Dockerhub from the main repo AND the ref is either:
|
|
# main
|
|
# dev
|
|
# beta
|
|
# a tag
|
|
# Otherwise forks would require a Docker Hub account and secrets setup
|
|
run: |
|
|
if [[ ${{ github.repository_owner }} == "paperless-ngx" && ( ${{ github.ref_name }} == "dev" || ${{ github.ref_name }} == "beta" || ${{ startsWith(github.ref, 'refs/tags/v') }} == "true" ) ]] ; then
|
|
echo "Enabling DockerHub image push"
|
|
echo "enable=true" >> $GITHUB_OUTPUT
|
|
else
|
|
echo "Not pushing to DockerHub"
|
|
echo "enable=false" >> $GITHUB_OUTPUT
|
|
fi
|
|
-
|
|
name: Set ghcr repository name
|
|
id: set-ghcr-repository
|
|
run: |
|
|
ghcr_name=$(echo "${{ github.repository }}" | awk '{ print tolower($0) }')
|
|
echo "Name is ${ghcr_name}"
|
|
echo "ghcr-repository=${ghcr_name}" >> $GITHUB_OUTPUT
|
|
-
|
|
name: Gather Docker metadata
|
|
id: docker-meta
|
|
uses: docker/metadata-action@v5
|
|
with:
|
|
images: |
|
|
ghcr.io/${{ steps.set-ghcr-repository.outputs.ghcr-repository }}
|
|
name=paperlessngx/paperless-ngx,enable=${{ steps.push-other-places.outputs.enable }}
|
|
name=quay.io/paperlessngx/paperless-ngx,enable=${{ steps.push-other-places.outputs.enable }}
|
|
tags: |
|
|
# Tag branches with branch name
|
|
type=ref,event=branch
|
|
# Process semver tags
|
|
# For a tag x.y.z or vX.Y.Z, output an x.y.z and x.y image tag
|
|
type=semver,pattern={{version}}
|
|
type=semver,pattern={{major}}.{{minor}}
|
|
-
|
|
name: Checkout
|
|
uses: actions/checkout@v4
|
|
# If https://github.com/docker/buildx/issues/1044 is resolved,
|
|
# the append input with a native arm64 arch could be used to
|
|
# significantly speed up building
|
|
-
|
|
name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
-
|
|
name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v3
|
|
with:
|
|
platforms: arm64
|
|
-
|
|
name: Login to GitHub Container Registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
-
|
|
name: Login to Docker Hub
|
|
uses: docker/login-action@v3
|
|
# Don't attempt to login is not pushing to Docker Hub
|
|
if: steps.push-other-places.outputs.enable == 'true'
|
|
with:
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
-
|
|
name: Login to Quay.io
|
|
uses: docker/login-action@v3
|
|
# Don't attempt to login is not pushing to Quay.io
|
|
if: steps.push-other-places.outputs.enable == 'true'
|
|
with:
|
|
registry: quay.io
|
|
username: ${{ secrets.QUAY_USERNAME }}
|
|
password: ${{ secrets.QUAY_ROBOT_TOKEN }}
|
|
-
|
|
name: Build and push
|
|
uses: docker/build-push-action@v5
|
|
with:
|
|
context: .
|
|
file: ./Dockerfile
|
|
platforms: linux/amd64,linux/arm64
|
|
push: ${{ github.event_name != 'pull_request' }}
|
|
tags: ${{ steps.docker-meta.outputs.tags }}
|
|
labels: ${{ steps.docker-meta.outputs.labels }}
|
|
# Get cache layers from this branch, then dev
|
|
# This allows new branches to get at least some cache benefits, generally from dev
|
|
cache-from: |
|
|
type=registry,ref=ghcr.io/${{ steps.set-ghcr-repository.outputs.ghcr-repository }}/builder/cache/app:${{ github.ref_name }}
|
|
type=registry,ref=ghcr.io/${{ steps.set-ghcr-repository.outputs.ghcr-repository }}/builder/cache/app:dev
|
|
cache-to: |
|
|
type=registry,mode=max,ref=ghcr.io/${{ steps.set-ghcr-repository.outputs.ghcr-repository }}/builder/cache/app:${{ github.ref_name }}
|
|
-
|
|
name: Inspect image
|
|
run: |
|
|
docker buildx imagetools inspect ${{ fromJSON(steps.docker-meta.outputs.json).tags[0] }}
|
|
-
|
|
name: Export frontend artifact from docker
|
|
run: |
|
|
docker create --name frontend-extract ${{ fromJSON(steps.docker-meta.outputs.json).tags[0] }}
|
|
docker cp frontend-extract:/usr/src/paperless/src/documents/static/frontend src/documents/static/frontend/
|
|
-
|
|
name: Upload frontend artifact
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: frontend-compiled
|
|
path: src/documents/static/frontend/
|
|
retention-days: 7
|
|
|
|
build-release:
|
|
name: "Build Release"
|
|
needs:
|
|
- build-docker-image
|
|
runs-on: ubuntu-22.04
|
|
steps:
|
|
-
|
|
name: Checkout
|
|
uses: actions/checkout@v4
|
|
-
|
|
name: Set up Python
|
|
id: setup-python
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: ${{ env.DEFAULT_PYTHON_VERSION }}
|
|
cache: "pipenv"
|
|
cache-dependency-path: 'Pipfile.lock'
|
|
-
|
|
name: Install pipenv + tools
|
|
run: |
|
|
pip install --upgrade --user pipenv==${{ env.DEFAULT_PIP_ENV_VERSION }} setuptools wheel
|
|
-
|
|
name: Install Python dependencies
|
|
run: |
|
|
pipenv --python ${{ steps.setup-python.outputs.python-version }} sync --dev
|
|
-
|
|
name: Patch whitenoise
|
|
run: |
|
|
curl --fail --silent --show-error --location --output 484.patch https://github.com/evansd/whitenoise/pull/484.patch
|
|
patch -d $(pipenv --venv)/lib/python3.10/site-packages --verbose -p2 < 484.patch
|
|
rm 484.patch
|
|
-
|
|
name: Install system dependencies
|
|
run: |
|
|
sudo apt-get update -qq
|
|
sudo apt-get install -qq --no-install-recommends gettext liblept5
|
|
-
|
|
name: Download frontend artifact
|
|
uses: actions/download-artifact@v3
|
|
with:
|
|
name: frontend-compiled
|
|
path: src/documents/static/frontend/
|
|
-
|
|
name: Download documentation artifact
|
|
uses: actions/download-artifact@v3
|
|
with:
|
|
name: documentation
|
|
path: docs/_build/html/
|
|
-
|
|
name: Generate requirements file
|
|
run: |
|
|
pipenv --python ${{ steps.setup-python.outputs.python-version }} requirements > requirements.txt
|
|
-
|
|
name: Compile messages
|
|
run: |
|
|
cd src/
|
|
pipenv --python ${{ steps.setup-python.outputs.python-version }} run python3 manage.py compilemessages
|
|
-
|
|
name: Collect static files
|
|
run: |
|
|
cd src/
|
|
pipenv --python ${{ steps.setup-python.outputs.python-version }} run python3 manage.py collectstatic --no-input
|
|
-
|
|
name: Move files
|
|
run: |
|
|
echo "Making dist folders"
|
|
for directory in dist \
|
|
dist/paperless-ngx \
|
|
dist/paperless-ngx/scripts;
|
|
do
|
|
mkdir --verbose --parents ${directory}
|
|
done
|
|
|
|
echo "Copying basic files"
|
|
for file_name in .dockerignore \
|
|
.env \
|
|
Dockerfile \
|
|
Pipfile \
|
|
Pipfile.lock \
|
|
requirements.txt \
|
|
LICENSE \
|
|
README.md \
|
|
paperless.conf.example \
|
|
gunicorn.conf.py
|
|
do
|
|
cp --verbose ${file_name} dist/paperless-ngx/
|
|
done
|
|
mv --verbose dist/paperless-ngx/paperless.conf.example dist/paperless-ngx/paperless.conf
|
|
|
|
echo "Copying Docker related files"
|
|
cp --recursive docker/ dist/paperless-ngx/docker
|
|
|
|
echo "Copying startup scripts"
|
|
cp --verbose scripts/*.service scripts/*.sh scripts/*.socket dist/paperless-ngx/scripts/
|
|
|
|
echo "Copying source files"
|
|
cp --recursive src/ dist/paperless-ngx/src
|
|
echo "Copying documentation"
|
|
cp --recursive docs/_build/html/ dist/paperless-ngx/docs
|
|
|
|
mv --verbose static dist/paperless-ngx
|
|
-
|
|
name: Make release package
|
|
run: |
|
|
echo "Creating release archive"
|
|
cd dist
|
|
sudo chown -R 1000:1000 paperless-ngx/
|
|
tar -cJf paperless-ngx.tar.xz paperless-ngx/
|
|
-
|
|
name: Upload release artifact
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: release
|
|
path: dist/paperless-ngx.tar.xz
|
|
retention-days: 7
|
|
|
|
publish-release:
|
|
name: "Publish Release"
|
|
runs-on: ubuntu-22.04
|
|
outputs:
|
|
prerelease: ${{ steps.get_version.outputs.prerelease }}
|
|
changelog: ${{ steps.create-release.outputs.body }}
|
|
version: ${{ steps.get_version.outputs.version }}
|
|
needs:
|
|
- build-release
|
|
if: github.ref_type == 'tag' && (startsWith(github.ref_name, 'v') || contains(github.ref_name, '-beta.rc'))
|
|
steps:
|
|
-
|
|
name: Download release artifact
|
|
uses: actions/download-artifact@v3
|
|
with:
|
|
name: release
|
|
path: ./
|
|
-
|
|
name: Get version
|
|
id: get_version
|
|
run: |
|
|
echo "version=${{ github.ref_name }}" >> $GITHUB_OUTPUT
|
|
if [[ ${{ contains(github.ref_name, '-beta.rc') }} == 'true' ]]; then
|
|
echo "prerelease=true" >> $GITHUB_OUTPUT
|
|
else
|
|
echo "prerelease=false" >> $GITHUB_OUTPUT
|
|
fi
|
|
-
|
|
name: Create Release and Changelog
|
|
id: create-release
|
|
uses: release-drafter/release-drafter@v5
|
|
with:
|
|
name: Paperless-ngx ${{ steps.get_version.outputs.version }}
|
|
tag: ${{ steps.get_version.outputs.version }}
|
|
version: ${{ steps.get_version.outputs.version }}
|
|
prerelease: ${{ steps.get_version.outputs.prerelease }}
|
|
publish: true # ensures release is not marked as draft
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
-
|
|
name: Upload release archive
|
|
id: upload-release-asset
|
|
uses: shogo82148/actions-upload-release-asset@v1
|
|
with:
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
upload_url: ${{ steps.create-release.outputs.upload_url }}
|
|
asset_path: ./paperless-ngx.tar.xz
|
|
asset_name: paperless-ngx-${{ steps.get_version.outputs.version }}.tar.xz
|
|
asset_content_type: application/x-xz
|
|
|
|
append-changelog:
|
|
name: "Append Changelog"
|
|
runs-on: ubuntu-22.04
|
|
needs:
|
|
- publish-release
|
|
if: needs.publish-release.outputs.prerelease == 'false'
|
|
steps:
|
|
-
|
|
name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
ref: main
|
|
-
|
|
name: Set up Python
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: ${{ env.DEFAULT_PYTHON_VERSION }}
|
|
cache: "pipenv"
|
|
cache-dependency-path: 'Pipfile.lock'
|
|
-
|
|
name: Install pipenv + tools
|
|
run: |
|
|
pip install --upgrade --user pipenv==${{ env.DEFAULT_PIP_ENV_VERSION }} setuptools wheel
|
|
-
|
|
name: Append Changelog to docs
|
|
id: append-Changelog
|
|
working-directory: docs
|
|
run: |
|
|
git branch ${{ needs.publish-release.outputs.version }}-changelog
|
|
git checkout ${{ needs.publish-release.outputs.version }}-changelog
|
|
echo -e "# Changelog\n\n${{ needs.publish-release.outputs.changelog }}\n" > changelog-new.md
|
|
echo "Manually linking usernames"
|
|
sed -i -r 's|@(.+?) \(\[#|[@\1](https://github.com/\1) ([#|ig' changelog-new.md
|
|
CURRENT_CHANGELOG=`tail --lines +2 changelog.md`
|
|
echo -e "$CURRENT_CHANGELOG" >> changelog-new.md
|
|
mv changelog-new.md changelog.md
|
|
pipenv run pre-commit run --files changelog.md || true
|
|
git config --global user.name "github-actions"
|
|
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
|
git commit -am "Changelog ${{ needs.publish-release.outputs.version }} - GHA"
|
|
git push origin ${{ needs.publish-release.outputs.version }}-changelog
|
|
-
|
|
name: Create Pull Request
|
|
uses: actions/github-script@v7
|
|
with:
|
|
script: |
|
|
const { repo, owner } = context.repo;
|
|
const result = await github.rest.pulls.create({
|
|
title: '[Documentation] Add ${{ needs.publish-release.outputs.version }} changelog',
|
|
owner,
|
|
repo,
|
|
head: '${{ needs.publish-release.outputs.version }}-changelog',
|
|
base: 'main',
|
|
body: 'This PR is auto-generated by CI.'
|
|
});
|
|
github.rest.issues.addLabels({
|
|
owner,
|
|
repo,
|
|
issue_number: result.data.number,
|
|
labels: ['documentation', 'skip-changelog']
|
|
});
|