circleci: Fix bugs and other stuff, switch to 7zip for core

This commit is contained in:
Jonatan Nilsson 2021-12-02 12:26:36 +00:00
parent 3b8405021a
commit 1e82f47604

View file

@ -3,11 +3,9 @@ jobs:
build:
docker:
- image: circleci/node:latest
resource_class: medium
working_directory: ~/app
steps:
- add_ssh_keys:
fingerprints:
- "9d:a2:fe:4c:56:e8:f7:91:14:ed:b8:dd:34:98:25:e9"
- checkout
- run:
name: Install npm deployment app
@ -16,6 +14,7 @@ jobs:
name: Check if this is a new release
command: |
set +e
PACKAGE_VERSION=$(cat package.json | grep version | head -1 | awk -F: '{ print $2 }' | sed 's/[", ]//g')
github-release list --owner $CIRCLE_PROJECT_USERNAME --repo $CIRCLE_PROJECT_REPONAME | grep "tag_name=\"v${PACKAGE_VERSION}\""
retVal=$?
if [ $retVal -eq 0 ]; then
@ -27,13 +26,19 @@ jobs:
command: |
echo "export COMMIT_MESSAGE=\"$(git log --format=oneline -n 1 $CIRCLE_SHA1)\"" >> $BASH_ENV
source $BASH_ENV
- run:
name: Get 7zz
command: |
wget https://www.7-zip.org/a/7z2106-linux-x64.tar.xz
tar -xvf 7z2106-linux-x64.tar.xz
- deploy:
name: Create a release
command: |
PACKAGE_VERSION=$(cat package.json | grep version | head -1 | awk -F: '{ print $2 }' | sed 's/[", ]//g')
echo "Packaging to ${CIRCLE_PROJECT_REPONAME}_build-sc.zip"
zip "${CIRCLE_PROJECT_REPONAME}_build-sc-core.zip" runner.mjs package.json service/* core/**/* core/*
zip "${CIRCLE_PROJECT_REPONAME}_app.zip" runner.mjs package.json service/* core/**/* core/* service/* config.json install.bat npminstall.bat README.md start.bat stop.bat uninstall.bat
echo "Creating release v${PACKAGE_VERSION}"
./7zz a "${CIRCLE_PROJECT_REPONAME}_build-sc-core.7z" runner.mjs package.json "service/*" "core/**/*" "core/*" -mx9 -mfb273 -mmt2 -md16M -mqs -myx9
./7zz a "${CIRCLE_PROJECT_REPONAME}_app.zip" runner.mjs package.json "service/*" "core/**/*" "core/*" config.json install.bat npminstall.bat README.md uninstall.bat
echo "Creating release '${PACKAGE_VERSION}'"
github-release upload \
--commitish $CIRCLE_SHA1 \