Merge pull request #209 from paperless-ngx/feature-ci-ngx-dirs

Update CI from -ng to -ngx
This commit is contained in:
Quinn Casey 2022-03-04 08:28:01 -08:00 committed by GitHub
commit 3ea6028c9f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,7 +2,8 @@ name: ci
on: on:
push: push:
tags: ngx-* tags:
- ngx-*
branches-ignore: branches-ignore:
- 'translations**' - 'translations**'
pull_request: pull_request:
@ -177,37 +178,37 @@ jobs:
name: Move files name: Move files
run: | run: |
mkdir dist mkdir dist
mkdir dist/paperless-ng mkdir dist/paperless-ngx
mkdir dist/paperless-ng/scripts mkdir dist/paperless-ngx/scripts
cp .dockerignore .env Dockerfile Pipfile Pipfile.lock LICENSE README.md requirements.txt dist/paperless-ng/ cp .dockerignore .env Dockerfile Pipfile Pipfile.lock LICENSE README.md requirements.txt dist/paperless-ngx/
cp paperless.conf.example dist/paperless-ng/paperless.conf cp paperless.conf.example dist/paperless-ngx/paperless.conf
cp gunicorn.conf.py dist/paperless-ng/gunicorn.conf.py cp gunicorn.conf.py dist/paperless-ngx/gunicorn.conf.py
cp docker/ dist/paperless-ng/docker -r cp docker/ dist/paperless-ngx/docker -r
cp scripts/*.service scripts/*.sh dist/paperless-ng/scripts/ cp scripts/*.service scripts/*.sh dist/paperless-ngx/scripts/
cp src/ dist/paperless-ng/src -r cp src/ dist/paperless-ngx/src -r
cp docs/_build/html/ dist/paperless-ng/docs -r cp docs/_build/html/ dist/paperless-ngx/docs -r
- -
name: Compile messages name: Compile messages
run: | run: |
cd dist/paperless-ng/src cd dist/paperless-ngx/src
python3 manage.py compilemessages python3 manage.py compilemessages
- -
name: Collect static files name: Collect static files
run: | run: |
cd dist/paperless-ng/src cd dist/paperless-ngx/src
python3 manage.py collectstatic --no-input python3 manage.py collectstatic --no-input
- -
name: Make release package name: Make release package
run: | run: |
cd dist cd dist
find . -name __pycache__ | xargs rm -r find . -name __pycache__ | xargs rm -r
tar -cJf paperless-ng.tar.xz paperless-ng/ tar -cJf paperless-ngx.tar.xz paperless-ngx/
- -
name: Upload release artifact name: Upload release artifact
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v2
with: with:
name: release name: release
path: dist/paperless-ng.tar.xz path: dist/paperless-ngx.tar.xz
publish-release: publish-release:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@ -224,7 +225,7 @@ jobs:
name: Get version name: Get version
id: get_version id: get_version
run: | run: |
echo ::set-output name=version::${GITHUB_REF#refs/tags/ng-} echo ::set-output name=version::${GITHUB_REF#refs/tags/ngx-}
- -
name: Create release name: Create release
id: create_release id: create_release
@ -232,12 +233,12 @@ jobs:
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with: with:
tag_name: ng-${{ steps.get_version.outputs.version }} tag_name: ngx-${{ steps.get_version.outputs.version }}
release_name: Paperless-ng ${{ steps.get_version.outputs.version }} release_name: Paperless-ngx ${{ steps.get_version.outputs.version }}
draft: false draft: false
prerelease: false prerelease: false
body: | body: |
For a complete list of changes, see the changelog at https://paperless-ng.readthedocs.io/en/latest/changelog.html. For a complete list of changes, see the changelog at https://paperless-ngx.readthedocs.io/en/latest/changelog.html.
- -
name: Upload release archive name: Upload release archive
id: upload-release-asset id: upload-release-asset
@ -246,13 +247,13 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with: with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./paperless-ng.tar.xz asset_path: ./paperless-ngx.tar.xz
asset_name: paperless-ng-${{ steps.get_version.outputs.version }}.tar.xz asset_name: paperless-ngx-${{ steps.get_version.outputs.version }}.tar.xz
asset_content_type: application/x-xz asset_content_type: application/x-xz
# build and push image to docker hub. # build and push image to docker hub.
build-docker-image: build-docker-image:
if: github.event_name == 'push' && (startsWith(github.ref, 'refs/heads/feature-') || github.ref == 'refs/heads/dev' || startsWith(github.ref, 'refs/tags/ng-')) if: github.event_name == 'push' && (startsWith(github.ref, 'refs/heads/feature-') || github.ref == 'refs/heads/dev' || startsWith(github.ref, 'refs/tags/ngx-'))
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: [tests, codeformatting, codestyle] needs: [tests, codeformatting, codestyle]
steps: steps:
@ -261,8 +262,8 @@ jobs:
id: prepare id: prepare
run: | run: |
IMAGE_NAME=ghcr.io/${{ github.repository }} IMAGE_NAME=ghcr.io/${{ github.repository }}
if [[ $GITHUB_REF == refs/tags/ng-* ]]; then if [[ $GITHUB_REF == refs/tags/ngx-* ]]; then
TAGS=${IMAGE_NAME}:${GITHUB_REF#refs/tags/ng-},${IMAGE_NAME}:latest TAGS=${IMAGE_NAME}:${GITHUB_REF#refs/tags/ngx-},${IMAGE_NAME}:latest
INSPECT_TAG=${IMAGE_NAME}:latest INSPECT_TAG=${IMAGE_NAME}:latest
elif [[ $GITHUB_REF == refs/heads/* ]]; then elif [[ $GITHUB_REF == refs/heads/* ]]; then
TAGS=${IMAGE_NAME}:${GITHUB_REF#refs/heads/} TAGS=${IMAGE_NAME}:${GITHUB_REF#refs/heads/}