image: registry.gitlab.com/factoryfour/api/builder:v4.1.0

stages:
  - build

release:
  stage: build
  only:
    - main
  cache:
    key:
      files:
        - yarn.lock
    paths:
      - .yarn-cache/
      - node_modules/
  script:
    - echo 'yarn-offline-mirror ".yarn-cache/"' >> .yarnrc
    - echo 'yarn-offline-mirror-pruning true' >> .yarnrc
    - yarn install --frozen-lockfile --no-progress --cache-folder .yarn-cache
    - yarn semantic-release
