diff --git a/bitbucket-pipelines.yml b/bitbucket-pipelines.yml index 4ec6317..cc72c82 100644 --- a/bitbucket-pipelines.yml +++ b/bitbucket-pipelines.yml @@ -1,36 +1,38 @@ -image: node:14 - +image: node:18-alpine pipelines: + custom: + - step: &build-and-test + name: Build and Test + caches: + - node + script: + - yarn install + - yarn build + - mkdir dist/src + - cp package.json dist/ + artifacts: + - dist branches: default: - - step: - name: Build and Test - caches: - - node - script: - - yarn install - - yarn build + <<: *build-and-test '{development,realease-no-verify/*}': + <<: *build-and-test - step: - name: Build and Deploy Dev - caches: - - node + name: Prepare Package script: - - yarn install - - yarn build:dev - master: - - step: - name: Build and Deploy Prod - caches: - - node - script: - - yarn install - - yarn build - - mkdir dist/src - - mv dist/*{js,txt} dist/src/ - - cp package.json dist/ + - sed -i s/$BITBUCKET_REPO_SLUG/$BITBUCKET_REPO_SLUG-dev/ dist/package.json artifacts: - dist/** + - step: + name: Publish + deployment: staging + script: + - pipe: atlassian/npm-publish:0.2.0 + variables: + NPM_TOKEN: $NPM_TOKEN + FOLDER: dist + master: + <<: *build-and-test - step: name: Publish deployment: production