ci: only set production flags when create release is enabled

This commit is contained in:
Nicolas Giard 2022-04-15 17:41:14 -04:00 committed by GitHub
parent 2f78a56aed
commit 72d1293f09
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -188,7 +188,7 @@ jobs:
uses: actions/download-artifact@v3.0.0
with:
name: coverage
- name: Make Release Build
env:
DEBIAN_FRONTEND: noninteractive
@ -204,8 +204,17 @@ jobs:
sed -i -r -e "s|^__version__ += '.*'$|__version__ = '$PKG_VERSION_STRICT'|" ietf/__init__.py
sed -i -r -e "s|^__release_hash__ += '.*'$|__release_hash__ = '$GITHUB_SHA'|" ietf/__init__.py
sed -i -r -e "s|^__release_branch__ += '.*'$|__release_branch__ = '$GITHUB_REF_NAME'|" ietf/__init__.py
- name: Set Production Flags
if: ${{ env.SHOULD_DEPLOY == 'true' }}
run: |
echo "Setting production flags in settings.py..."
sed -i -r -e 's/^DEBUG *= *.*$/DEBUG = False/' -e "s/^SERVER_MODE *= *.*\$/SERVER_MODE = 'production'/" ietf/settings.py
- name: Make Release Tarball
env:
DEBIAN_FRONTEND: noninteractive
run: |
echo "Build release tarball..."
mkdir -p /home/runner/work/release
tar -czf /home/runner/work/release/release.tar.gz -X dev/deploy/exclude-patterns.txt .