version: 2.1
orbs:
  gh-app: wmfs/github-app-token@1.0.0
jobs:
  build:
    docker:
      - image: cimg/node:lts
        environment:
          TZ: "Europe/London"
    working_directory: ~/repo
    steps:
      - checkout
      - run:
          name: install
          command: |
            npm config set //registry.npmjs.org/:_authToken=$NPM_TOKEN
            npm install
      - gh-app/mint
      - run:
          name: release
          command: npx semantic-release
workflows:
  release:
    jobs:
      - build:
          context:
            - build-env-vars
            - github-app
          filters:
            branches:
              only: master
