From 21a5b00df58f6f8ecafc2fe7e8ce3b63cde8d57f Mon Sep 17 00:00:00 2001 From: Leandro Costa Date: Mon, 17 Jun 2024 20:13:27 -0300 Subject: [PATCH] feat: ci/ci --- bitbucket-pipelines.yml | 53 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 bitbucket-pipelines.yml diff --git a/bitbucket-pipelines.yml b/bitbucket-pipelines.yml new file mode 100644 index 0000000..63076db --- /dev/null +++ b/bitbucket-pipelines.yml @@ -0,0 +1,53 @@ +image: node:20-alpine +definitions: + steps: + - step: &build-and-test + name: Build and Test + caches: + - node + script: + - npm install + - npm run build + - npm run test + artifacts: + - dist/** +pipelines: + branches: + default: + <<: *build-and-test + "{development,release-no-verify/*}": + - step: *build-and-test + - step: + name: Prepare Package + script: + - apk add git + - cp package.json dist/ + - npm version patch -m "[skip CI] Version %s" + - git push + artifacts: + - dist/** + - step: + name: Publish + deployment: staging + script: + - pipe: atlassian/npm-publish:0.2.0 + variables: + NPM_TOKEN: $NPM_TOKEN + FOLDER: dist + master: + - step: *build-and-test + - step: + name: Prepare Package + script: + - cp package.json dist/ + - sed -i s/$BITBUCKET_REPO_SLUG-dev/$BITBUCKET_REPO_SLUG/ dist/package.json + artifacts: + - dist/** + - step: + name: Publish + deployment: production + script: + - pipe: atlassian/npm-publish:0.2.0 + variables: + NPM_TOKEN: $NPM_TOKEN + FOLDER: dist