diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..acfc5e8 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,64 @@ +version: 2.1 + +defaults: &defaults + working_directory: ~/repo + docker: + - image: circleci/node:8.9.1 + +jobs: + test: + <<: *defaults + steps: + - checkout + - restore_cache: + keys: + - v1-dependencies-{{ checksum "package.json" }} + - v1-dependencies- + - run: + name: Install dependencies + command: npm i + - save_cache: + paths: + - node_modules + key: v1-dependencies-{{ checksum "package.json" }} + - persist_to_workspace: + root: ~/repo + paths: . + publish: + <<: *defaults + steps: + - checkout + - restore_cache: + keys: + - v1-dependencies-{{ checksum "package.json" }} + - v1-dependencies- + - run: + name: Install dependencies + command: npm i + - save_cache: + paths: + - node_modules + key: v1-dependencies-{{ checksum "package.json" }} + - persist_to_workspace: + root: ~/repo + paths: . + - run: + name: Build + command: npm run build && cd dist + - run: + name: Authentication + command: npx npm-cli-login -u ${NPM_USER} -p ${NPM_PASS} -e ${NPM_EMAIL} + - run: + name: Publish + command: npm publish --access public +workflows: + version: 2 + test-publish: + jobs: + - test + - publish: + requires: + - test + filters: + branches: + only: master diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index 7296dd7..0000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,24 +0,0 @@ -stages: - - Test - - Publish - -Test: - stage: Test - image: node:10.16-alpine - script: - - npm install --no-progress --loglevel error - - npx tsc - - npm run test - -Publish: - when: manual - stage: Publish - image: node:10.16-alpine - script: - - npm i --no-progress --loglevel error - - npm run build - - cd dist - - npx npm-cli-login -u ${NPM_USER} -p ${NPM_PASS} -e ${NPM_EMAIL} - - npm publish --access public - only: - - master diff --git a/package.json b/package.json index bc523b5..4a4850a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@nestlab/google-recaptcha", - "version": "1.0.3", + "version": "1.0.5", "description": "Google recaptcha module for NestJS.", "keywords": [ "nestjs", @@ -18,14 +18,14 @@ }, "repository": { "type": "git", - "url": "git+https://gitlab.com/nestlab/google-recaptcha.git" + "url": "https://github.com/chvarkov/google-recaptcha.git" }, "author": "Alexey Chvarkov", "license": "MIT", "bugs": { - "url": "https://gitlab.com/nestlab/google-recaptcha/issues" + "url": "https://github.com/chvarkov/google-recaptcha/issues" }, - "homepage": "https://gitlab.com/nestlab/google-recaptcha#readme", + "homepage": "https://gitlab.com/nestlab/google-recaptcha", "peerDependencies": { "@nestjs/common": "^6.0.0", "@nestjs/core": "^6.0.0"