Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

Commit 5cd9210

Browse files
authored
Merge pull request #157 from mobify/hotfix/add-circle-yml
Hotfix: Add circle.yml file for publishing to npm
2 parents b274551 + 05a1fa7 commit 5cd9210

File tree

3 files changed

+25
-1
lines changed

3 files changed

+25
-1
lines changed

RELEASE.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,7 @@
33
Use Slack to release new versions of the Mobify Code Style.
44

55
`@mobitron release mobify-code-style [minor|patch]`
6+
7+
The release script will create the release and prep the npm package. Near the
8+
end it merges a release branch in `master` which kicks off `circle.yml`. The
9+
final npm publish step is done within the circle.yml file.

circle.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
version: 2
2+
jobs:
3+
build:
4+
docker:
5+
- image: node:6.10.3
6+
working_directory: /home/ubuntu/mobify-code-style
7+
steps:
8+
- checkout
9+
- run: npm install
10+
# npm outputs extra info on... ?linux? that breaks the diffs in docs/test/
11+
# test.sh causing tests to fail on CircleCI only, but not on a macOS. As a
12+
# result we use `--quiet` to suppress this npm output.
13+
- run: npm test --quiet
14+
- deploy:
15+
command: |
16+
if [ "${CIRCLE_BRANCH}" == "master" ]; then
17+
# NPM login based on env variables
18+
echo -e "$NPM_USERNAME\n$NPM_PASSWORD\n$NPM_EMAIL" | npm login
19+
npm publish
20+
fi

docs/test/test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,6 @@ EXIT_BAD_FILENAME=$?
3131
# This if will fall apart quickly as we add more test cases.
3232
# Need to consider some type of looping, etc possibly.
3333
if [ "$EXIT_GOOD" -ne "0" ] || [ "$EXIT_BAD" -ne "0" ] || [ "$EXIT_BAD_FILENAME" -ne "0" ]; then
34-
echo "One or more tests failed!"
34+
echo "One or more tests failed! Good: $EXIT_GOOD Bad: $EXIT_BAD Bad Filename: $EXIT_BAD_FILENAME"
3535
exit 1
3636
fi

0 commit comments

Comments
 (0)