sc-helloworld/.circleci/config.yml

35 lines
1.2 KiB
YAML
Raw Normal View History

2020-09-04 15:54:01 +00:00
version: 2
jobs:
build:
docker:
- image: circleci/node:latest
working_directory: ~/app
steps:
- checkout
- run:
name: Install npm deployment app
2020-09-04 16:15:09 +00:00
command: sudo npm install -g github-release-cli
2020-09-04 15:54:01 +00:00
- deploy:
name: Create a release
command: |
2020-09-04 16:15:09 +00:00
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/**
2020-09-04 15:54:01 +00:00
echo "Creating release '${PACKAGE_VERSION}.${CIRCLE_BUILD_NUM}'"
2020-09-04 16:15:09 +00:00
github-release upload \
2020-09-04 16:16:11 +00:00
--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}" \
2020-09-04 16:15:09 +00:00
--body "Automatic CircleCI Build of v${PACKAGE_VERSION}.${CIRCLE_BUILD_NUM} from ${CIRCLE_SHA1}" \
sc-helloworld_build-sc.zip
2020-09-04 15:54:01 +00:00
workflows:
version: 2
build_deploy:
jobs:
- build:
context: github-thething