@oliasoft-open-source/react-ui-library 2.0.0 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/.gitlab-ci.yml +43 -8
  2. package/package.json +1 -1
package/.gitlab-ci.yml CHANGED
@@ -2,7 +2,7 @@ image: node:18
2
2
 
3
3
  stages:
4
4
  - test
5
- - publish
5
+ - release
6
6
 
7
7
  test:
8
8
  stage: test
@@ -18,22 +18,57 @@ cache:
18
18
  - node_modules/
19
19
  - public/
20
20
 
21
+ # Public the static docs site (including Storybook) upon merge to master
21
22
  pages:
22
- stage: publish
23
+ stage: release
24
+ only:
25
+ - master
23
26
  script:
24
- - npm install
27
+ - npm install --progress=false --no-save
25
28
  - npm run build
26
29
  - cp public/index.html public/404.html
27
30
  artifacts:
28
31
  paths:
29
32
  - public
30
- only:
31
- - master
32
33
 
34
+ # Push a tag and publish to the public NPM registry upon merge to master
33
35
  publish:
34
- stage: publish
36
+ stage: release
35
37
  only:
36
38
  - master
37
39
  script:
38
- - echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > .npmrc
39
- - npm publish
40
+ # Get the version from package.json
41
+ - VERSION=$(node -p "require('./package.json').version")
42
+ # Prepare .npmrc
43
+ - echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > .npmrc
44
+ # Configure git
45
+ - mkdir -p ~/.ssh
46
+ - echo "$SSH_PRIVATE_KEY_TOOLKIT" > ~/.ssh/id_rsa; chmod 0600 ~/.ssh/id_rsa
47
+ - echo "StrictHostKeyChecking no " > /root/.ssh/config
48
+ - git config --global http.sslVerify false
49
+ - git config --global user.email "$GITLAB_USER_EMAIL"
50
+ - git config --global user.name "🤖 GitLab CI/CD"
51
+ - echo "setting origin remote to 'git@$CI_SERVER_HOST:$CI_PROJECT_PATH.git'"
52
+ - git remote -v
53
+ - git remote rm origin
54
+ - git remote add origin git@$CI_SERVER_HOST:$CI_PROJECT_PATH.git
55
+ - git remote -v
56
+ - git branch
57
+ - git fetch --quiet
58
+ - git checkout "$CI_BUILD_REF_NAME"
59
+ - git fetch --tags --quiet
60
+ # Only complete pipeline if version does not already exist
61
+ - >
62
+ if [ $(git tag -l "$VERSION") ]; then
63
+ echo "Version $VERSION already exists"
64
+ exit 1
65
+ else
66
+ # Tag a release in gitlab
67
+ echo "Tagging release in git"
68
+ git tag $VERSION -m "🤖 Tagged by Gitlab CI/CD Pipeline" -m "For further reference see $CI_PIPELINE_URL" -m "[skip ci]"
69
+ echo "Pushing tag to remote repository"
70
+ git push origin $VERSION --no-verify
71
+ # Publish the NPM package to the public NPM registry
72
+ echo "Publishing package to NPM registry"
73
+ npm publish
74
+ fi
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oliasoft-open-source/react-ui-library",
3
- "version": "2.0.0",
3
+ "version": "2.1.0",
4
4
  "description": "Reusable UI components for React projects",
5
5
  "main": "index.js",
6
6
  "scripts": {