| cd -- "$(dirname "$0")/../.." >/dev/null 2>&1 |
| RELEASE_FILE_NAME=${GITHUB_RUN_NUMBER} |
| RELEASE_NAME=gh-${RELEASE_FILE_NAME} |
| HASH=$(git rev-parse HEAD) |
| echo "${RELEASE_NAME}" >release_build |
| "${ROOT}"/package*.json \ |
| rm -rf "${ROOT}"/lib/storage/data |
| # Set up and build and webpack everything |
| # Now install only the production dependencies in our output directory |
| npm install --no-audit --ignore-scripts --production |
| rm -rf node_modules/.cache/ node_modules/monaco-editor/ |
| find node_modules -name \*.ts -delete |
| # Output some magic for GH to set the branch name and release name |
| echo "::set-output name=branch::${GITHUB_REF#refs/heads/}" |
| echo "::set-output name=release_name::${RELEASE_NAME}" |
| # Run to make sure we haven't just made something that won't work |
| node -r esm ./app.js --version --dist |
| rm -rf "${ROOT}/out/dist-bin" |
| mkdir -p "${ROOT}/out/dist-bin" |
| tar -Jcf "${ROOT}/out/dist-bin/${RELEASE_FILE_NAME}.tar.xz" . |
| pushd "${ROOT}/out/webpack" |
| tar -Jcf "${ROOT}/out/dist-bin/${RELEASE_FILE_NAME}.static.tar.xz" --transform="s,^static/,," static/* |
| echo "${HASH}" >"${ROOT}/out/dist-bin/${RELEASE_FILE_NAME}.txt" |