circleci: Trigger build

This commit is contained in:
Jonatan Nilsson 2020-09-12 20:53:45 +00:00
parent f29f12a63e
commit f89fd01fa7

View file

@ -12,7 +12,12 @@ jobs:
- run: - run:
name: Check if this is a new release name: Check if this is a new release
command: | command: |
echo test github-release list --owner $CIRCLE_PROJECT_USERNAME --repo $CIRCLE_PROJECT_REPONAME | grep "tag_name=\"v${PACKAGE_VERSION}\""
retVal=$?
if [ $retVal -eq 0 ]; then
echo "Release already exists. Quitting early"
circleci step halt
fi
- run: - run:
name: Get current git commit message name: Get current git commit message
command: | command: |
@ -24,6 +29,16 @@ jobs:
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-core.zip" runner.mjs package.json service/* core/**/* core/* zip "${CIRCLE_PROJECT_REPONAME}_build-sc-core.zip" runner.mjs package.json service/* core/**/* core/*
echo "Creating release '${PACKAGE_VERSION}'"
github-release upload \
--commitish $CIRCLE_SHA1 \
--token $GITHUB_TOKEN \
--owner $CIRCLE_PROJECT_USERNAME \
--repo $CIRCLE_PROJECT_REPONAME \
--tag "v${PACKAGE_VERSION}" \
--name "v${PACKAGE_VERSION}" \
--body "Automatic CircleCI Build of v${PACKAGE_VERSION} from ${CIRCLE_SHA1}: ${COMMIT_MESSAGE}" \
"${CIRCLE_PROJECT_REPONAME}_build-sc-core.zip"
workflows: workflows:
version: 2 version: 2