Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add npm-publish-token CircleCI context #175

Merged
merged 1 commit into from
Mar 14, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 36 additions & 23 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,43 +3,50 @@

references:

container_config_node: &container_config_node
container_config_node:
&container_config_node
working_directory: ~/project/build
docker:
- image: cimg/node:12.22

workspace_root: &workspace_root
~/project
workspace_root: &workspace_root ~/project

attach_workspace: &attach_workspace
attach_workspace:
&attach_workspace
attach_workspace:
at: *workspace_root

npm_cache_keys: &npm_cache_keys
npm_cache_keys:
&npm_cache_keys
keys:
- v1-dependency-npm-{{ checksum "package.json" }}-
- v1-dependency-npm-{{ checksum "package.json" }}
- v1-dependency-npm-
- v1-dependency-npm-{{ checksum "package.json" }}-
- v1-dependency-npm-{{ checksum "package.json" }}
- v1-dependency-npm-

cache_npm_cache: &cache_npm_cache
cache_npm_cache:
&cache_npm_cache
save_cache:
key: v1-dependency-npm-{{ checksum "package.json" }}-{{ epoch }}
paths:
key: v1-dependency-npm-{{ checksum "package.json" }}-{{ epoch }}
paths:
- ./node_modules/

restore_npm_cache: &restore_npm_cache
restore_npm_cache:
&restore_npm_cache
restore_cache:
<<: *npm_cache_keys
<<: *npm_cache_keys

filters_only_main: &filters_only_main
filters_only_main:
&filters_only_main
branches:
only: main

filters_ignore_tags: &filters_ignore_tags
filters_ignore_tags:
&filters_ignore_tags
tags:
ignore: /.*/

filters_version_tag: &filters_version_tag
filters_version_tag:
&filters_version_tag
tags:
only:
- /^v?\d+\.\d+\.\d+(?:-beta\.\d+)?$/
Expand All @@ -50,11 +57,13 @@ orbs:
node: circleci/node@4.6.0
slack: circleci/slack@3.4.2

filters_only_renovate_nori: &filters_only_renovate_nori
filters_only_renovate_nori:
&filters_only_renovate_nori
branches:
only: /(^renovate-.*|^nori/.*)/

filters_ignore_tags_renovate_nori: &filters_ignore_tags_renovate_nori
filters_ignore_tags_renovate_nori:
&filters_ignore_tags_renovate_nori
tags:
ignore: /.*/
branches:
Expand All @@ -79,7 +88,9 @@ jobs:
- checkout
- run:
name: Checkout next-ci-shared-helpers
command: git clone --depth 1 git@github.com:Financial-Times/next-ci-shared-helpers.git .circleci/shared-helpers
command: git clone --depth 1
git@github.com:Financial-Times/next-ci-shared-helpers.git
.circleci/shared-helpers
- *restore_npm_cache
- node/install-npm:
version: "7"
Expand Down Expand Up @@ -122,7 +133,8 @@ jobs:
- run:
name: shared-helper / npm-store-auth-token
command: .circleci/shared-helpers/helper-npm-store-auth-token
- run: npx snyk monitor --org=customer-products --project-name=Financial-Times/n-health
- run: npx snyk monitor --org=customer-products
--project-name=Financial-Times/n-health
- run:
name: shared-helper / npm-version-and-publish-public
command: .circleci/shared-helpers/helper-npm-version-and-publish-public
Expand Down Expand Up @@ -151,6 +163,7 @@ workflows:
requires:
- build
- publish:
context: npm-publish-token
filters:
<<: *filters_version_tag
requires:
Expand All @@ -161,13 +174,13 @@ workflows:
- waiting-for-approval:
type: approval
filters:
<<: *filters_only_renovate_nori
<<: *filters_only_renovate_nori
- build:
requires:
- waiting-for-approval
- waiting-for-approval
- test:
requires:
- build
- build

nightly:
triggers:
Expand Down