2020-05-12 12:42:14 -04:00
version : 2.1
orbs :
2020-05-12 15:32:10 -04:00
node : circleci/node@2.1.0
2020-05-28 09:08:15 -04:00
slack : circleci/slack@3.4.2
2020-05-13 12:35:53 -04:00
defaults : &defaults
working_directory : ~/project
executor :
name : node/default
2022-10-28 11:25:20 -04:00
tag : '16.18.0'
2020-05-12 12:42:14 -04:00
jobs :
build-and-test :
2020-05-13 12:35:53 -04:00
<< : *defaults
2020-05-12 12:42:14 -04:00
steps :
- checkout
2020-05-13 12:35:53 -04:00
- node/install-packages #node orb cmd caches
- run : npm run test
- persist_to_workspace :
root : ~/project
paths : .
deploy-npm :
<< : *defaults
steps :
- attach_workspace :
at : ~/project
2020-05-27 14:36:47 -04:00
- add_ssh_keys :
fingerprints :
2023-01-06 17:04:51 -05:00
- "be:38:fa:65:8c:8b:cc:04:db:f5:2b:6e:22:9d:82:55"
2020-05-27 16:23:49 -04:00
- run : ssh-keyscan -H github.com >> ~/.ssh/known_hosts
2020-05-13 12:35:53 -04:00
- run :
2020-05-27 15:56:51 -04:00
name : "configure release version"
2020-05-13 12:35:53 -04:00
command : |
VPKG=$($(npm bin)/json -f package.json version)
echo "export VERSION=${VPKG/%?/}$(date +%Y%m%d%H%M%S)" >> $BASH_ENV
- run :
name : "publish"
command : |
2020-05-27 15:56:51 -04:00
npm --no-git-tag-version version $VERSION
2020-05-13 12:35:53 -04:00
npm set //registry.npmjs.org/:_authToken=$NPM_TOKEN
npm publish
- run :
name : "tag release"
command : |
git tag $VERSION
git push $CIRCLE_REPOSITORY_URL $VERSION
2020-05-13 15:22:50 -04:00
pull-translations :
<< : *defaults
steps :
- checkout
2020-05-28 07:35:58 -04:00
- node/install-packages
2020-05-13 15:22:50 -04:00
- run :
name : "pull editor and www translations"
command : |
npm run pull:editor
npm run pull:www
npm run test
2023-01-03 15:03:33 -05:00
no_output_timeout : 30m
2020-05-13 15:22:50 -04:00
- persist_to_workspace :
root : ~/project
paths : .
2020-05-28 09:08:15 -04:00
- slack/status :
fail_only : true
2020-06-16 15:52:01 -04:00
failure_message : ":explosion: Pull editor and www translations failed, for help see: https://github.com/LLK/scratch-l10n/wiki/Developer-Guide#weekly-editor-and-website-update"
2020-05-28 09:08:15 -04:00
only_for_branches : "master"
2020-05-13 15:22:50 -04:00
commit-translations :
<< : *defaults
steps :
- attach_workspace :
at : ~/project
- add_ssh_keys :
fingerprints :
2023-01-06 17:04:51 -05:00
- "be:38:fa:65:8c:8b:cc:04:db:f5:2b:6e:22:9d:82:55"
2020-05-27 16:23:49 -04:00
- run : ssh-keyscan -H github.com >> ~/.ssh/known_hosts
2020-05-13 15:22:50 -04:00
- run :
name : "commit translation updates"
command : |
2020-06-03 11:02:26 -04:00
git config --global user.email $(git log --pretty=format:"%ae" -n1)
git config --global user.name $(git log --pretty=format:"%an" -n1)
2020-05-13 15:22:50 -04:00
git add .
2022-11-03 17:00:57 -04:00
if git diff --cached --exit-code --quiet; then
echo "Nothing to commit."
else
git commit -m "pull new editor translations from Transifex"
git push $CIRCLE_REPOSITORY_URL HEAD:master
fi
2020-05-13 15:34:15 -04:00
sync-help :
<< : *defaults
steps :
- checkout
2020-05-28 07:35:58 -04:00
- node/install-packages
2020-05-13 15:34:15 -04:00
- run : npm run sync:help
2020-05-28 09:08:15 -04:00
- slack/status :
fail_only : true
2020-06-16 15:52:01 -04:00
failure_message : ":boom: Scratch Help update failed, for help see: https://github.com/LLK/scratch-l10n/wiki/Developer-Guide#daily-help-update"
2020-05-28 09:08:15 -04:00
only_for_branches : "master"
2020-05-12 12:42:14 -04:00
workflows :
2020-05-13 12:35:53 -04:00
version : 2
build-test-and-deploy :
jobs :
- build-and-test
- deploy-npm :
requires :
- build-and-test
filters :
branches :
only : master
2020-06-03 11:02:26 -04:00
manual-pull :
2020-06-15 12:29:58 -04:00
when :
equal : [ tx-pull-manual, << pipeline.git.branch >> ]
2020-06-03 11:02:26 -04:00
jobs :
- pull-translations
- commit-translations :
requires :
- pull-translations
filters :
branches :
only : tx-pull-manual
2020-10-21 09:51:53 -04:00
daily-tx-pull :
2020-05-13 15:22:50 -04:00
triggers :
2020-10-21 09:51:53 -04:00
- schedule : # daily at 3am UTC (10pm EST)
cron : "0 3 * * *"
2020-05-13 15:22:50 -04:00
filters :
branches :
only : master
jobs :
- pull-translations
- commit-translations :
requires :
- pull-translations # don't commit if there were errors
2020-05-13 15:34:15 -04:00
daily-help-update :
triggers :
2020-10-21 09:51:53 -04:00
- schedule : # daily at 5am UTC
2020-06-22 07:24:13 -04:00
cron : "0 5 * * *"
2020-05-13 15:34:15 -04:00
filters :
branches :
only : master
jobs :
- sync-help