Skip to content

Commit

Permalink
Merge pull request jonaswinkler#209 from paperless-ngx/feature-ci-ngx…
Browse files Browse the repository at this point in the history
…-dirs

Update CI from -ng to -ngx
  • Loading branch information
qcasey authored Mar 4, 2022
2 parents 6e901ff + 37531ec commit 3ea6028
Showing 1 changed file with 24 additions and 23 deletions.
47 changes: 24 additions & 23 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ name: ci

on:
push:
tags: ngx-*
tags:
- ngx-*
branches-ignore:
- 'translations**'
pull_request:
Expand Down Expand Up @@ -177,37 +178,37 @@ jobs:
name: Move files
run: |
mkdir dist
mkdir dist/paperless-ng
mkdir dist/paperless-ng/scripts
cp .dockerignore .env Dockerfile Pipfile Pipfile.lock LICENSE README.md requirements.txt dist/paperless-ng/
cp paperless.conf.example dist/paperless-ng/paperless.conf
cp gunicorn.conf.py dist/paperless-ng/gunicorn.conf.py
cp docker/ dist/paperless-ng/docker -r
cp scripts/*.service scripts/*.sh dist/paperless-ng/scripts/
cp src/ dist/paperless-ng/src -r
cp docs/_build/html/ dist/paperless-ng/docs -r
mkdir dist/paperless-ngx
mkdir dist/paperless-ngx/scripts
cp .dockerignore .env Dockerfile Pipfile Pipfile.lock LICENSE README.md requirements.txt dist/paperless-ngx/
cp paperless.conf.example dist/paperless-ngx/paperless.conf
cp gunicorn.conf.py dist/paperless-ngx/gunicorn.conf.py
cp docker/ dist/paperless-ngx/docker -r
cp scripts/*.service scripts/*.sh dist/paperless-ngx/scripts/
cp src/ dist/paperless-ngx/src -r
cp docs/_build/html/ dist/paperless-ngx/docs -r
-
name: Compile messages
run: |
cd dist/paperless-ng/src
cd dist/paperless-ngx/src
python3 manage.py compilemessages
-
name: Collect static files
run: |
cd dist/paperless-ng/src
cd dist/paperless-ngx/src
python3 manage.py collectstatic --no-input
-
name: Make release package
run: |
cd dist
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
uses: actions/upload-artifact@v2
with:
name: release
path: dist/paperless-ng.tar.xz
path: dist/paperless-ngx.tar.xz

publish-release:
runs-on: ubuntu-latest
Expand All @@ -224,20 +225,20 @@ jobs:
name: Get version
id: get_version
run: |
echo ::set-output name=version::${GITHUB_REF#refs/tags/ng-}
echo ::set-output name=version::${GITHUB_REF#refs/tags/ngx-}
-
name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ng-${{ steps.get_version.outputs.version }}
release_name: Paperless-ng ${{ steps.get_version.outputs.version }}
tag_name: ngx-${{ steps.get_version.outputs.version }}
release_name: Paperless-ngx ${{ steps.get_version.outputs.version }}
draft: false
prerelease: false
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
id: upload-release-asset
Expand All @@ -246,13 +247,13 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
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
asset_path: ./paperless-ng.tar.xz
asset_name: paperless-ng-${{ steps.get_version.outputs.version }}.tar.xz
asset_path: ./paperless-ngx.tar.xz
asset_name: paperless-ngx-${{ steps.get_version.outputs.version }}.tar.xz
asset_content_type: application/x-xz

# build and push image to docker hub.
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
needs: [tests, codeformatting, codestyle]
steps:
Expand All @@ -261,8 +262,8 @@ jobs:
id: prepare
run: |
IMAGE_NAME=ghcr.io/${{ github.repository }}
if [[ $GITHUB_REF == refs/tags/ng-* ]]; then
TAGS=${IMAGE_NAME}:${GITHUB_REF#refs/tags/ng-},${IMAGE_NAME}:latest
if [[ $GITHUB_REF == refs/tags/ngx-* ]]; then
TAGS=${IMAGE_NAME}:${GITHUB_REF#refs/tags/ngx-},${IMAGE_NAME}:latest
INSPECT_TAG=${IMAGE_NAME}:latest
elif [[ $GITHUB_REF == refs/heads/* ]]; then
TAGS=${IMAGE_NAME}:${GITHUB_REF#refs/heads/}
Expand Down

0 comments on commit 3ea6028

Please sign in to comment.