-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tech 573 Move CI to Circle CI (#313)
Move CI workflows to Circle CI
- Loading branch information
Showing
4 changed files
with
74 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
version: 2.1 | ||
orbs: | ||
node: circleci/[email protected] | ||
executors: | ||
node22: | ||
docker: | ||
- image: cimg/node:22.13 | ||
jobs: | ||
lint_test_build: | ||
executor: | ||
name: node22 | ||
steps: | ||
- checkout | ||
- restore_cache: | ||
keys: | ||
- v1-dependencies-{{ checksum "yarn.lock" }} | ||
- v1-dependencies- | ||
- node/install-yarn | ||
- run: yarn install --frozen-lockfile | ||
- save_cache: | ||
paths: | ||
- ./node_modules | ||
key: v1-dependencies-{{ checksum "yarn.lock" }} | ||
- run: yarn run lint | ||
- run: yarn run coverage | ||
- run: yarn run build | ||
- run: yarn pack | ||
- persist_to_workspace: | ||
root: /home/circleci/project | ||
paths: | ||
- ./aion-dk-js-client-*.tgz | ||
publish: | ||
executor: | ||
name: node22 | ||
steps: | ||
- attach_workspace: | ||
at: /tmp/workspace | ||
- run: | ||
name: Move files | ||
command: | | ||
mv /tmp/workspace/aion-dk-js-client-*.tgz ./ | ||
- run: | ||
name: Set npm access token | ||
command: | | ||
npm set //registry.npmjs.org/:_authToken=$NPM_TOKEN | ||
- run: | ||
name: Publish to NPM | ||
command: | | ||
package_file=$(ls aion-dk-js-client-*.tgz) | ||
if echo "${package_file}" | grep -E "alpha|beta" > /dev/null; then | ||
prerelease=$(echo "${package_file}" | grep -E -o "alpha|beta") | ||
echo "Publishing prerelease with tag ${prerelease} to NPM" | ||
npm publish ${package_file} --tag ${prerelease} | ||
else | ||
echo "Publishing release with to NPM" | ||
npm publish ${package_file} | ||
fi | ||
workflows: | ||
build_and_deploy: | ||
jobs: | ||
- lint_test_build: | ||
filters: | ||
branches: | ||
only: /.*/ | ||
tags: | ||
only: /^v.*/ | ||
- publish: | ||
requires: | ||
- lint_test_build | ||
filters: | ||
branches: | ||
ignore: /.*/ | ||
tags: | ||
only: /^v.*/ |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.