From 96e53e776cee1b5084e59c35352c2463bf3e4a49 Mon Sep 17 00:00:00 2001 From: Jonatan Nilsson Date: Fri, 4 Sep 2020 16:15:09 +0000 Subject: [PATCH] circleci: Fix automatic deployment --- .circleci/config.yml | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index f92fdca..e402ff1 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -8,16 +8,23 @@ jobs: - checkout - run: name: Install npm deployment app - command: npm install -g github-release-cli + command: sudo npm install -g github-release-cli - deploy: name: Create a release 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" + zip "${CIRCLE_PROJECT_REPONAME}_build-sc.zip" index.mjs package.json api/** echo "Creating release '${PACKAGE_VERSION}.${CIRCLE_BUILD_NUM}'" + github-release upload \ + --commitish $CIRCLE_SHA1 + --token $GITHUB_TOKEN + --owner $CIRCLE_PROJECT_USERNAME + --repo $CIRCLE_PROJECT_REPONAME + --tag "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}" \ + sc-helloworld_build-sc.zip workflows: version: 2