Skip to content
Snippets Groups Projects

Publish on npm using CI pipeline

Merged Bastien Abadie requested to merge release-npm into main
2 files
+ 19
1
Compare changes
  • Side-by-side
  • Inline
Files
2
+ 24
7
@@ -3,6 +3,7 @@ stages:
- test
- build
- deploy
- release
# Prevent detached merge request pipelines
# https://docs.gitlab.com/ee/ci/merge_request_pipelines/
@@ -38,10 +39,11 @@ build-webext:
paths:
- dist-ext
expire_in: 2 weeks
script:
- npm run build-ext
build-surge:
build-lib:
stage: build
# Ignore frontend-audit to speed up CI builds
@@ -51,15 +53,10 @@ build-surge:
paths:
- dist-lib
expire_in: 2 weeks
script:
- npm run build-lib
# Only deploy branches on surge
rules:
- if: '$CI_COMMIT_BRANCH && $CI_COMMIT_BRANCH != "master"'
when: on_success
- when: never
.surge:
stage: deploy
@@ -72,6 +69,9 @@ build-surge:
deploy-surge:
extends: .surge
dependencies:
- build-lib
# Only deploy branches on surge
rules:
- if: '$CI_COMMIT_BRANCH && $CI_COMMIT_BRANCH != "master"'
@@ -104,3 +104,20 @@ stop-surge:
script:
- surge teardown ${CI_ENVIRONMENT_URL}
release-npm:
stage: release
dependencies:
- build-lib
# Publish only on tags
only:
- tags
before_script:
- echo 'always-auth=true' > .npmrc
- echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" >> .npmrc
script:
- npm publish --access public
Loading