image: node:16-alpine stages: - install - test - release variables: GITLAB_NPM_REGISTRY_URL: "https://gitlab.com/api/v4/groups/$KUMORI_GROUP_ID/-/packages/npm/" install: stage: install tags: - docker script: - npm ci artifacts: paths: - node_modules/ test: stage: test image: node:16-alpine tags: - docker dependencies: - install script: - npm install --no-save jest-junit - npm run test coverage: '/All files.*?\|\s*[\d\.]+\s*\|\s*[\d\.]+\s*\|\s*[\d\.]+\s*\|\s*([\d\.]+)/' artifacts: when: always paths: - report.xml reports: junit: report.xml only: - merge_requests - master - tags release: stage: release tags: - docker dependencies: - install rules: - if: '$CI_COMMIT_TAG =~ /^v\d+\.\d+\.\d+$/' when: manual - when: never script: - echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > $HOME/.npmrc - npm whoami - npm publish --access public