Update and fix circleci and add build step

This commit is contained in:
Jonatan Nilsson 2020-09-09 16:12:20 +00:00
parent 8f7b8e24a2
commit ba12f8f59e
3 changed files with 9 additions and 2 deletions

View file

@ -9,12 +9,17 @@ jobs:
- run: - run:
name: Install npm deployment app name: Install npm deployment app
command: sudo npm install -g github-release-cli command: sudo npm install -g github-release-cli
- run:
name: Build client javascript
command: |
npm install
npm run build
- deploy: - deploy:
name: Create a release name: Create a release
command: | command: |
PACKAGE_VERSION=$(cat package.json | grep version | head -1 | awk -F: '{ print $2 }' | sed 's/[", ]//g') 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" echo "Packaging to ${CIRCLE_PROJECT_REPONAME}_build-sc.zip"
zip "${CIRCLE_PROJECT_REPONAME}_build-sc.zip" index.mjs package.json api/** zip "${CIRCLE_PROJECT_REPONAME}_build-sc.zip" index.mjs package.json public api/**
echo "Creating release '${PACKAGE_VERSION}.${CIRCLE_BUILD_NUM}'" echo "Creating release '${PACKAGE_VERSION}.${CIRCLE_BUILD_NUM}'"
github-release upload \ github-release upload \
--commitish $CIRCLE_SHA1 \ --commitish $CIRCLE_SHA1 \
@ -24,7 +29,7 @@ jobs:
--tag "v${PACKAGE_VERSION}.${CIRCLE_BUILD_NUM}" \ --tag "v${PACKAGE_VERSION}.${CIRCLE_BUILD_NUM}" \
--name "v${PACKAGE_VERSION}.${CIRCLE_BUILD_NUM}" \ --name "v${PACKAGE_VERSION}.${CIRCLE_BUILD_NUM}" \
--body "Automatic CircleCI Build of v${PACKAGE_VERSION}.${CIRCLE_BUILD_NUM} from ${CIRCLE_SHA1}" \ --body "Automatic CircleCI Build of v${PACKAGE_VERSION}.${CIRCLE_BUILD_NUM} from ${CIRCLE_SHA1}" \
sc-helloworld_build-sc.zip "${CIRCLE_PROJECT_REPONAME}_build-sc.zip"
workflows: workflows:
version: 2 version: 2

1
.gitignore vendored
View file

@ -106,3 +106,4 @@ dist
db.json db.json
app/* app/*
manage/* manage/*
public/main.js

View file

@ -7,6 +7,7 @@
"js:build:main": "asbundle client/index.js public/main.js", "js:build:main": "asbundle client/index.js public/main.js",
"dev:server": "nodemon --watch runner.mjs --watch api runner.mjs | bunyan", "dev:server": "nodemon --watch runner.mjs --watch api runner.mjs | bunyan",
"dev:client": "nodemon --watch client --exec \"npm run js:build:main\"", "dev:client": "nodemon --watch client --exec \"npm run js:build:main\"",
"build": "npm run js:build:main",
"test": "echo \"Error: no test specified\" && exit 1" "test": "echo \"Error: no test specified\" && exit 1"
}, },
"author": "", "author": "",