mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-03-03 23:50:20 -05:00
Bumps the actions group with 6 updates in the / directory: | Package | From | To | | --- | --- | --- | | [astral-sh/setup-uv](https://github.com/astral-sh/setup-uv) | `7.3.0` | `7.3.1` | | [actions/upload-artifact](https://github.com/actions/upload-artifact) | `6.0.0` | `7.0.0` | | [actions/download-artifact](https://github.com/actions/download-artifact) | `7.0.0` | `8.0.0` | | [github/codeql-action](https://github.com/github/codeql-action) | `4.32.3` | `4.32.5` | | [crowdin/github-action](https://github.com/crowdin/github-action) | `2.14.0` | `2.15.0` | | [actions/stale](https://github.com/actions/stale) | `10.1.1` | `10.2.0` | Updates `astral-sh/setup-uv` from 7.3.0 to 7.3.1 - [Release notes](https://github.com/astral-sh/setup-uv/releases) - [Commits](https://github.com/astral-sh/setup-uv/compare/v7.3.0...v7.3.1) Updates `actions/upload-artifact` from 6.0.0 to 7.0.0 - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/v6.0.0...v7.0.0) Updates `actions/download-artifact` from 7.0.0 to 8.0.0 - [Release notes](https://github.com/actions/download-artifact/releases) - [Commits](https://github.com/actions/download-artifact/compare/v7.0.0...v8.0.0) Updates `github/codeql-action` from 4.32.3 to 4.32.5 - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/v4.32.3...v4.32.5) Updates `crowdin/github-action` from 2.14.0 to 2.15.0 - [Release notes](https://github.com/crowdin/github-action/releases) - [Commits](https://github.com/crowdin/github-action/compare/v2.14.0...v2.15.0) Updates `actions/stale` from 10.1.1 to 10.2.0 - [Release notes](https://github.com/actions/stale/releases) - [Changelog](https://github.com/actions/stale/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/stale/compare/v10.1.1...v10.2.0) --- updated-dependencies: - dependency-name: astral-sh/setup-uv dependency-version: 7.3.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions - dependency-name: actions/upload-artifact dependency-version: 7.0.0 dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions - dependency-name: actions/download-artifact dependency-version: 8.0.0 dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions - dependency-name: github/codeql-action dependency-version: 4.32.5 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions - dependency-name: crowdin/github-action dependency-version: 2.15.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: actions - dependency-name: actions/stale dependency-version: 10.2.0 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>
239 lines
8.6 KiB
YAML
239 lines
8.6 KiB
YAML
name: Release
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'v[0-9]+.[0-9]+.[0-9]+'
|
|
- 'v[0-9]+.[0-9]+.[0-9]+-beta.rc[0-9]+'
|
|
concurrency:
|
|
group: release-${{ github.ref }}
|
|
cancel-in-progress: false
|
|
env:
|
|
DEFAULT_UV_VERSION: "0.10.x"
|
|
DEFAULT_PYTHON_VERSION: "3.12"
|
|
jobs:
|
|
wait-for-docker:
|
|
name: Wait for Docker Build
|
|
runs-on: ubuntu-24.04
|
|
steps:
|
|
- name: Wait for Docker build
|
|
uses: lewagon/wait-on-check-action@v1.5.0
|
|
with:
|
|
ref: ${{ github.sha }}
|
|
check-name: 'Build Docker Image'
|
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
|
wait-interval: 60
|
|
build-release:
|
|
name: Build Release
|
|
needs: wait-for-docker
|
|
runs-on: ubuntu-24.04
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v6.0.2
|
|
# ---- Frontend Build ----
|
|
- name: Install pnpm
|
|
uses: pnpm/action-setup@v4.2.0
|
|
with:
|
|
version: 10
|
|
- name: Use Node.js 24
|
|
uses: actions/setup-node@v6.2.0
|
|
with:
|
|
node-version: 24.x
|
|
cache: 'pnpm'
|
|
cache-dependency-path: 'src-ui/pnpm-lock.yaml'
|
|
- name: Install frontend dependencies
|
|
run: cd src-ui && pnpm install
|
|
- name: Build frontend
|
|
run: cd src-ui && pnpm run build --configuration production
|
|
# ---- Backend Setup ----
|
|
- name: Set up Python
|
|
id: setup-python
|
|
uses: actions/setup-python@v6.2.0
|
|
with:
|
|
python-version: ${{ env.DEFAULT_PYTHON_VERSION }}
|
|
- name: Install uv
|
|
uses: astral-sh/setup-uv@v7.3.1
|
|
with:
|
|
version: ${{ env.DEFAULT_UV_VERSION }}
|
|
enable-cache: true
|
|
python-version: ${{ steps.setup-python.outputs.python-version }}
|
|
- name: Install Python dependencies
|
|
run: |
|
|
uv sync --python ${{ steps.setup-python.outputs.python-version }} --dev --frozen
|
|
- name: Install system dependencies
|
|
run: |
|
|
sudo apt-get update -qq
|
|
sudo apt-get install -qq --no-install-recommends gettext liblept5
|
|
# ---- Build Documentation ----
|
|
- name: Build documentation
|
|
run: |
|
|
uv run \
|
|
--python ${{ steps.setup-python.outputs.python-version }} \
|
|
--dev \
|
|
--frozen \
|
|
zensical build --clean
|
|
# ---- Prepare Release ----
|
|
- name: Generate requirements file
|
|
run: |
|
|
uv export --quiet --no-dev --all-extras --format requirements-txt --output-file requirements.txt
|
|
- name: Compile messages
|
|
run: |
|
|
cd src/
|
|
uv run \
|
|
--python ${{ steps.setup-python.outputs.python-version }} \
|
|
manage.py compilemessages
|
|
- name: Collect static files
|
|
run: |
|
|
cd src/
|
|
uv run \
|
|
--python ${{ steps.setup-python.outputs.python-version }} \
|
|
manage.py collectstatic --no-input --clear
|
|
- name: Assemble release package
|
|
run: |
|
|
mkdir -p dist/paperless-ngx/scripts
|
|
|
|
for file_name in .dockerignore \
|
|
.env \
|
|
Dockerfile \
|
|
pyproject.toml \
|
|
uv.lock \
|
|
requirements.txt \
|
|
LICENSE \
|
|
README.md \
|
|
paperless.conf.example
|
|
do
|
|
cp --verbose ${file_name} dist/paperless-ngx/
|
|
done
|
|
mv dist/paperless-ngx/paperless.conf.example dist/paperless-ngx/paperless.conf
|
|
|
|
cp --recursive docker/ dist/paperless-ngx/docker
|
|
cp scripts/*.service scripts/*.sh scripts/*.socket dist/paperless-ngx/scripts/
|
|
cp --recursive src/ dist/paperless-ngx/src
|
|
cp --recursive site/ dist/paperless-ngx/docs
|
|
mv static dist/paperless-ngx/
|
|
|
|
find dist/paperless-ngx -name "__pycache__" -type d -exec rm -rf {} +
|
|
- name: Create release archive
|
|
run: |
|
|
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@v7.0.0
|
|
with:
|
|
name: release
|
|
path: dist/paperless-ngx.tar.xz
|
|
retention-days: 7
|
|
publish-release:
|
|
name: Publish Release
|
|
needs: build-release
|
|
runs-on: ubuntu-24.04
|
|
outputs:
|
|
prerelease: ${{ steps.get-version.outputs.prerelease }}
|
|
changelog: ${{ steps.create-release.outputs.body }}
|
|
version: ${{ steps.get-version.outputs.version }}
|
|
steps:
|
|
- name: Download release artifact
|
|
uses: actions/download-artifact@v8.0.0
|
|
with:
|
|
name: release
|
|
path: ./
|
|
- name: Get version info
|
|
id: get-version
|
|
run: |
|
|
echo "version=${{ github.ref_name }}" >> $GITHUB_OUTPUT
|
|
if [[ "${{ github.ref_name }}" == *"-beta.rc"* ]]; 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@v6.2.0
|
|
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
|
|
commitish: main
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
- name: Upload release archive
|
|
uses: shogo82148/actions-upload-release-asset@v1.9.2
|
|
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 to docs (only on non-prerelease)
|
|
# ---------------------------------------------------------------------------
|
|
append-changelog:
|
|
name: Append Changelog
|
|
needs: publish-release
|
|
if: needs.publish-release.outputs.prerelease == 'false'
|
|
runs-on: ubuntu-24.04
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v6.0.2
|
|
with:
|
|
ref: main
|
|
- name: Set up Python
|
|
id: setup-python
|
|
uses: actions/setup-python@v6.2.0
|
|
with:
|
|
python-version: ${{ env.DEFAULT_PYTHON_VERSION }}
|
|
- name: Install uv
|
|
uses: astral-sh/setup-uv@v7.3.1
|
|
with:
|
|
version: ${{ env.DEFAULT_UV_VERSION }}
|
|
enable-cache: true
|
|
python-version: ${{ env.DEFAULT_PYTHON_VERSION }}
|
|
- name: Update 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|@([a-zA-Z0-9_]+) \(\[#|[@\1](https://github.com/\1) ([#|g' changelog-new.md
|
|
|
|
echo "Removing unneeded comment tags"
|
|
sed -i -r 's|@<!---->|@|g' changelog-new.md
|
|
|
|
CURRENT_CHANGELOG=$(tail --lines +2 changelog.md)
|
|
echo -e "$CURRENT_CHANGELOG" >> changelog-new.md
|
|
mv changelog-new.md changelog.md
|
|
|
|
uv run \
|
|
--python ${{ steps.setup-python.outputs.python-version }} \
|
|
--dev \
|
|
prek 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@v8.0.0
|
|
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']
|
|
});
|