From dd2e8373fc58efb461ca3c176fbd358573b9d657 Mon Sep 17 00:00:00 2001 From: Guillaume Vincent Date: Wed, 17 Apr 2019 16:33:52 +0200 Subject: [PATCH] Start using the same version number for everything * Deploy automatically on npm all required packages on tag * Create a script to tag automatically and change the version number everywhere * Bump all versions numbers to 8.0.0 --- .travis.yml | 79 +++++++++++++++++++++++++- bin/tag | 76 +++++++++++++++++++++++++ cli/lesspass/version.py | 2 +- mobile/package.json | 2 +- package.json | 2 +- packages/lesspass-crypto/package.json | 2 +- packages/lesspass-entropy/package.json | 2 +- packages/lesspass-fingerprint/package.json | 2 +- packages/lesspass-profiles/package.json | 2 +- packages/lesspass-pure/package.json | 2 +- packages/lesspass-render-password/package.json | 2 +- packages/lesspass-web-component/package.json | 2 +- packages/lesspass-web-extension/package.json | 2 +- packages/lesspass-web-site/package.json | 2 +- 14 files changed, 164 insertions(+), 15 deletions(-) create mode 100755 bin/tag diff --git a/.travis.yml b/.travis.yml index db40355..4ddd232 100644 --- a/.travis.yml +++ b/.travis.yml @@ -77,9 +77,82 @@ jobs: secure: AOCdqmMdtzmxZXnnMM4ToA80y1PftTVoPsFi7D9RglfneRruRocfI+HQ1Y2m3wUkdGEKVrzkHudiOVMLpeuiMerz9JzQNX/MoujjTvq0h24pnXC+Y2JLNgqxQNuKttgBYP9yMhdgo0Si25KqRLTbmGNZLVnN1hXKV206alNmRWqsZeI/Yxje2FDgRnVTsAtXM+R2g/SvM5r/zVnFiogT/gbQ1Voz+kUo7c15o3Sp3D9+WL38P9Sk3tIVl7RA8o1yd7actDVezPhQPddSu+o+3poxUfrX9LtnibJiuWvqBRdQ2Pjwc7ZSjNJ/zPXntCu8hvdEVzCAXbVFfkhsk1xEDGrEne1hyRJuRX3F9o+SgkuKz53mSg1Wxw7tK6fmnyNG+EMU+oeIKGzNd4Ta/Dk9MzmrymeQgFsZSSFIlwi0ecJ7N+3f0UYTlMR788Q7JGXLsqHfY473rI1M5cpC24l88Pibsdjzf66sanlsZtzHN/51CZzuLLHwTt714CV2bVsffdp3UqaJ+pbhdLXYtrLColOg5Ua3el+t999pVr0r/V/gSqRKKVZqgbUwd9ajYTqYXDDt0+/+9c7ynhfH4hMLsafAZNhf74KBIbL7C30A/DfptiHlBP/5TWvOpzc+AyxWt8v1nnrEK/1vAGLGAaYkXKqmazb/9KlxkKDqDMC9ZQc= on: tags: true - all_branches: true - condition: $TRAVIS_TAG =~ ^cli.*$ - + branch: master + - stage: deploy + language: node_js + name: Deploy lesspass-crypto + node_js: + - lts/* + script: skip + before_deploy: cd packages/lesspass-crypto + deploy: + provider: npm + email: guillaume@oslab.fr + api_key: + secure: rD1rs7QEA7IX8erpnJStx2AKhS8DpzvFxCA/jw/t9cx40Hk29jTVq1h22Sr6Gitm169cH9/sFzZEqera64w/sC7tsLimf/3aQhx8ia0y8taNxVw6nQTRYhvJazhOEnPEN0hZV8cW12yAUWNjjU19xokJsmbaT9ICVy7LNoRhRubpPO58ICkn8A6fBaz49i+Q/WXAdzdpH5nvu0ffz5Vm2QXD5BC6MZcBn3NQX8sDftUK1lqUNuSJIppTR6cUuZW+RluuiajssxYT7LX5BUgW4vTgf1CcPJ5AlI2JLeytphOc7xEwJBk72vO9eLXQZ8CiSwHCYcz9QGDbPke1xfmlqBwjN/FaCLSk7fi1zEMLbDy0K8b26KUqlOaulPX2hjWsBzfX1TykrusqDxYZ72tIWe2GHPsLGQPEkmhUHlUSPaIMDkYIPydLcvLwS8YObThShCvG6AVmSR3v/25SM3pfb98AtLuKLieTq5kQFOog1HRqLjDZ4CdXFhxzLfoQb9+tXYC/cKsyD4GqVL6CQlfERhKUDMwSu284/6g6pqdVvZ7rzE7oiXgyO9PM+T9vA/j4UeNTahANbSx28AQrWa3n5EQHNOHMSAxv4rnpyDYUTUBrlTKYAUTHSvenKgBr9BKnGjJ4Oa+1jMpjgzw+BJT8smhJTVSQr5XFQoXiAUK2nzg= + on: + tags: true + branch: master + - stage: deploy + language: node_js + name: Deploy lesspass-entropy + node_js: + - lts/* + script: skip + before_deploy: cd packages/lesspass-entropy + deploy: + provider: npm + email: guillaume@oslab.fr + api_key: + secure: rD1rs7QEA7IX8erpnJStx2AKhS8DpzvFxCA/jw/t9cx40Hk29jTVq1h22Sr6Gitm169cH9/sFzZEqera64w/sC7tsLimf/3aQhx8ia0y8taNxVw6nQTRYhvJazhOEnPEN0hZV8cW12yAUWNjjU19xokJsmbaT9ICVy7LNoRhRubpPO58ICkn8A6fBaz49i+Q/WXAdzdpH5nvu0ffz5Vm2QXD5BC6MZcBn3NQX8sDftUK1lqUNuSJIppTR6cUuZW+RluuiajssxYT7LX5BUgW4vTgf1CcPJ5AlI2JLeytphOc7xEwJBk72vO9eLXQZ8CiSwHCYcz9QGDbPke1xfmlqBwjN/FaCLSk7fi1zEMLbDy0K8b26KUqlOaulPX2hjWsBzfX1TykrusqDxYZ72tIWe2GHPsLGQPEkmhUHlUSPaIMDkYIPydLcvLwS8YObThShCvG6AVmSR3v/25SM3pfb98AtLuKLieTq5kQFOog1HRqLjDZ4CdXFhxzLfoQb9+tXYC/cKsyD4GqVL6CQlfERhKUDMwSu284/6g6pqdVvZ7rzE7oiXgyO9PM+T9vA/j4UeNTahANbSx28AQrWa3n5EQHNOHMSAxv4rnpyDYUTUBrlTKYAUTHSvenKgBr9BKnGjJ4Oa+1jMpjgzw+BJT8smhJTVSQr5XFQoXiAUK2nzg= + on: + tags: true + branch: master + - stage: deploy + language: node_js + name: Deploy lesspass-fingerprint + node_js: + - lts/* + script: skip + before_deploy: cd packages/lesspass-fingerprint + deploy: + provider: npm + email: guillaume@oslab.fr + api_key: + secure: rD1rs7QEA7IX8erpnJStx2AKhS8DpzvFxCA/jw/t9cx40Hk29jTVq1h22Sr6Gitm169cH9/sFzZEqera64w/sC7tsLimf/3aQhx8ia0y8taNxVw6nQTRYhvJazhOEnPEN0hZV8cW12yAUWNjjU19xokJsmbaT9ICVy7LNoRhRubpPO58ICkn8A6fBaz49i+Q/WXAdzdpH5nvu0ffz5Vm2QXD5BC6MZcBn3NQX8sDftUK1lqUNuSJIppTR6cUuZW+RluuiajssxYT7LX5BUgW4vTgf1CcPJ5AlI2JLeytphOc7xEwJBk72vO9eLXQZ8CiSwHCYcz9QGDbPke1xfmlqBwjN/FaCLSk7fi1zEMLbDy0K8b26KUqlOaulPX2hjWsBzfX1TykrusqDxYZ72tIWe2GHPsLGQPEkmhUHlUSPaIMDkYIPydLcvLwS8YObThShCvG6AVmSR3v/25SM3pfb98AtLuKLieTq5kQFOog1HRqLjDZ4CdXFhxzLfoQb9+tXYC/cKsyD4GqVL6CQlfERhKUDMwSu284/6g6pqdVvZ7rzE7oiXgyO9PM+T9vA/j4UeNTahANbSx28AQrWa3n5EQHNOHMSAxv4rnpyDYUTUBrlTKYAUTHSvenKgBr9BKnGjJ4Oa+1jMpjgzw+BJT8smhJTVSQr5XFQoXiAUK2nzg= + on: + tags: true + branch: master + - stage: deploy + language: node_js + name: Deploy lesspass-pure + node_js: + - lts/* + script: skip + before_deploy: cd packages/lesspass-pure + deploy: + provider: npm + email: guillaume@oslab.fr + api_key: + secure: rD1rs7QEA7IX8erpnJStx2AKhS8DpzvFxCA/jw/t9cx40Hk29jTVq1h22Sr6Gitm169cH9/sFzZEqera64w/sC7tsLimf/3aQhx8ia0y8taNxVw6nQTRYhvJazhOEnPEN0hZV8cW12yAUWNjjU19xokJsmbaT9ICVy7LNoRhRubpPO58ICkn8A6fBaz49i+Q/WXAdzdpH5nvu0ffz5Vm2QXD5BC6MZcBn3NQX8sDftUK1lqUNuSJIppTR6cUuZW+RluuiajssxYT7LX5BUgW4vTgf1CcPJ5AlI2JLeytphOc7xEwJBk72vO9eLXQZ8CiSwHCYcz9QGDbPke1xfmlqBwjN/FaCLSk7fi1zEMLbDy0K8b26KUqlOaulPX2hjWsBzfX1TykrusqDxYZ72tIWe2GHPsLGQPEkmhUHlUSPaIMDkYIPydLcvLwS8YObThShCvG6AVmSR3v/25SM3pfb98AtLuKLieTq5kQFOog1HRqLjDZ4CdXFhxzLfoQb9+tXYC/cKsyD4GqVL6CQlfERhKUDMwSu284/6g6pqdVvZ7rzE7oiXgyO9PM+T9vA/j4UeNTahANbSx28AQrWa3n5EQHNOHMSAxv4rnpyDYUTUBrlTKYAUTHSvenKgBr9BKnGjJ4Oa+1jMpjgzw+BJT8smhJTVSQr5XFQoXiAUK2nzg= + on: + tags: true + branch: master + - stage: deploy + language: node_js + name: Deploy lesspass-render-password + node_js: + - lts/* + script: skip + before_deploy: cd packages/lesspass-render-password + deploy: + provider: npm + email: guillaume@oslab.fr + api_key: + secure: rD1rs7QEA7IX8erpnJStx2AKhS8DpzvFxCA/jw/t9cx40Hk29jTVq1h22Sr6Gitm169cH9/sFzZEqera64w/sC7tsLimf/3aQhx8ia0y8taNxVw6nQTRYhvJazhOEnPEN0hZV8cW12yAUWNjjU19xokJsmbaT9ICVy7LNoRhRubpPO58ICkn8A6fBaz49i+Q/WXAdzdpH5nvu0ffz5Vm2QXD5BC6MZcBn3NQX8sDftUK1lqUNuSJIppTR6cUuZW+RluuiajssxYT7LX5BUgW4vTgf1CcPJ5AlI2JLeytphOc7xEwJBk72vO9eLXQZ8CiSwHCYcz9QGDbPke1xfmlqBwjN/FaCLSk7fi1zEMLbDy0K8b26KUqlOaulPX2hjWsBzfX1TykrusqDxYZ72tIWe2GHPsLGQPEkmhUHlUSPaIMDkYIPydLcvLwS8YObThShCvG6AVmSR3v/25SM3pfb98AtLuKLieTq5kQFOog1HRqLjDZ4CdXFhxzLfoQb9+tXYC/cKsyD4GqVL6CQlfERhKUDMwSu284/6g6pqdVvZ7rzE7oiXgyO9PM+T9vA/j4UeNTahANbSx28AQrWa3n5EQHNOHMSAxv4rnpyDYUTUBrlTKYAUTHSvenKgBr9BKnGjJ4Oa+1jMpjgzw+BJT8smhJTVSQr5XFQoXiAUK2nzg= + on: + tags: true + branch: master stages: - name: test - name: deploy diff --git a/bin/tag b/bin/tag new file mode 100755 index 0000000..78f676a --- /dev/null +++ b/bin/tag @@ -0,0 +1,76 @@ +#!/usr/bin/env bash + +set +o errexit + +git diff-index --quiet HEAD +if [ $? == 1 ] +then + echo >&2 "Git repository not clean. Aborting." + exit 1 +fi + +set -o errexit +set -o pipefail +set -o nounset + +function increment_version { + IFS='.' read -a versions <<< "${1}" + + major=${versions[0]} + minor=${versions[1]} + patch=${versions[2]} + + case "${2}" in + "major") + major=$((major + 1)) + minor=0 + patch=0 + ;; + "minor") + minor=$((minor + 1)) + patch=0 + ;; + "patch") + patch=$((patch + 1)) + ;; + esac + + new_version="$major.$minor.$patch" + echo ${new_version} +} + +function replace_versions_in_files { + sed -i "s/\"version\": \"${1}\"/\"version\": \"${2}\"/g" package.json + sed -i "s/__version__ = \"${1}\"/__version__ = \"${2}\"/g" cli/lesspass/version.py + sed -i "s/\"version\": \"${1}\"/\"version\": \"${2}\"/g" mobile/package.json + sed -i "s/\"version\": \"${1}\"/\"version\": \"${2}\"/g" packages/lesspass-crypto/package.json + sed -i "s/\"version\": \"${1}\"/\"version\": \"${2}\"/g" packages/lesspass-entropy/package.json + sed -i "s/\"version\": \"${1}\"/\"version\": \"${2}\"/g" packages/lesspass-fingerprint/package.json + sed -i "s/\"version\": \"${1}\"/\"version\": \"${2}\"/g" packages/lesspass-profiles/package.json + sed -i "s/\"version\": \"${1}\"/\"version\": \"${2}\"/g" packages/lesspass-pure/package.json + sed -i "s/\"version\": \"${1}\"/\"version\": \"${2}\"/g" packages/lesspass-render-password/package.json + sed -i "s/\"version\": \"${1}\"/\"version\": \"${2}\"/g" packages/lesspass-web-component/package.json + sed -i "s/\"version\": \"${1}\"/\"version\": \"${2}\"/g" packages/lesspass-web-extension/package.json + sed -i "s/\"version\": \"${1}\"/\"version\": \"${2}\"/g" packages/lesspass-web-site/package.json +} + +function tag { + git add . + git commit --message="LessPass version ${1}" + git tag "${1}" +} + +__dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +__root="$(cd "$(dirname "${__dir}")" && pwd)" +pushd ${__root} +bump_type="${1:-}" +if [ "${bump_type}" == "major" ] || [ "${bump_type}" == "minor" ] || [ "${bump_type}" == "patch" ] +then + current_version=$(grep -Po '(?<="version": ")[^"]*' package.json) + new_version=$( increment_version ${current_version} ${bump_type} ) + replace_versions_in_files ${current_version} ${new_version} + tag ${new_version} +else + echo >&2 "Error: No bump type specified (major, minor, patch). Aborting." + exit 1 +fi \ No newline at end of file diff --git a/cli/lesspass/version.py b/cli/lesspass/version.py index b2ea6c2..73d4c8b 100644 --- a/cli/lesspass/version.py +++ b/cli/lesspass/version.py @@ -1 +1 @@ -__version__ = "7.0.2" +__version__ = "8.0.0" diff --git a/mobile/package.json b/mobile/package.json index dafb747..56786bd 100644 --- a/mobile/package.json +++ b/mobile/package.json @@ -1,6 +1,6 @@ { "name": "lesspass-mobile", - "version": "3.1.6", + "version": "8.0.0", "description": "LessPass mobile application", "license": "(MPL-2.0 OR GPL-3.0)", "author": { diff --git a/package.json b/package.json index 6446648..19f672a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "lesspass", - "version": "1.0.0", + "version": "8.0.0", "description": "LessPass mono repo", "repository": "https://github.com/lesspass/lesspass", "author": "Guillaume Vincent ", diff --git a/packages/lesspass-crypto/package.json b/packages/lesspass-crypto/package.json index 3c34701..15db9ac 100644 --- a/packages/lesspass-crypto/package.json +++ b/packages/lesspass-crypto/package.json @@ -1,6 +1,6 @@ { "name": "lesspass-crypto", - "version": "1.0.0", + "version": "8.0.0", "description": "LessPass cryptographic functions", "license": "GPL-3.0", "author": "Guillaume Vincent ", diff --git a/packages/lesspass-entropy/package.json b/packages/lesspass-entropy/package.json index fe08afe..82fee79 100644 --- a/packages/lesspass-entropy/package.json +++ b/packages/lesspass-entropy/package.json @@ -1,6 +1,6 @@ { "name": "lesspass-entropy", - "version": "1.0.0", + "version": "8.0.0", "description": "LessPass module used to generate entropy for password generation", "author": "Guillaume Vincent ", "license": "GPL-3.0", diff --git a/packages/lesspass-fingerprint/package.json b/packages/lesspass-fingerprint/package.json index 24089aa..3611022 100644 --- a/packages/lesspass-fingerprint/package.json +++ b/packages/lesspass-fingerprint/package.json @@ -1,6 +1,6 @@ { "name": "lesspass-fingerprint", - "version": "1.0.0", + "version": "8.0.0", "description": "LessPass node module used to get fingerprint for 256 bytes string", "license": "GPL-3.0", "author": "Guillaume Vincent ", diff --git a/packages/lesspass-profiles/package.json b/packages/lesspass-profiles/package.json index 59eeddc..2a0e9d3 100644 --- a/packages/lesspass-profiles/package.json +++ b/packages/lesspass-profiles/package.json @@ -1,6 +1,6 @@ { "name": "lesspass-profiles", - "version": "1.0.0", + "version": "8.0.0", "description": "", "license": "GPL-3.0", "author": "Guillaume Vincent ", diff --git a/packages/lesspass-pure/package.json b/packages/lesspass-pure/package.json index 30341dc..53e785f 100644 --- a/packages/lesspass-pure/package.json +++ b/packages/lesspass-pure/package.json @@ -1,6 +1,6 @@ { "name": "lesspass-pure", - "version": "5.1.8", + "version": "8.0.0", "description": "LessPass web component", "license": "GPL-3.0", "author": "Guillaume Vincent ", diff --git a/packages/lesspass-render-password/package.json b/packages/lesspass-render-password/package.json index efab584..adfeec8 100644 --- a/packages/lesspass-render-password/package.json +++ b/packages/lesspass-render-password/package.json @@ -1,6 +1,6 @@ { "name": "lesspass-render-password", - "version": "1.0.0", + "version": "8.0.0", "description": "LessPass node module used to render password from entropy and options", "license": "GPL-3.0", "author": "Guillaume Vincent ", diff --git a/packages/lesspass-web-component/package.json b/packages/lesspass-web-component/package.json index f11e6e9..b890116 100644 --- a/packages/lesspass-web-component/package.json +++ b/packages/lesspass-web-component/package.json @@ -1,6 +1,6 @@ { "name": "lesspass-web-component", - "version": "1.0.0", + "version": "8.0.0", "description": "LessPass web component", "license": "GPL-3.0", "author": "Guillaume Vincent ", diff --git a/packages/lesspass-web-extension/package.json b/packages/lesspass-web-extension/package.json index e2efc9a..3c644ea 100644 --- a/packages/lesspass-web-extension/package.json +++ b/packages/lesspass-web-extension/package.json @@ -1,7 +1,7 @@ { "name": "lesspass-web-extension", "description": "LessPass web extension", - "version": "3.1.6", + "version": "8.0.0", "license": "GPL-3.0", "author": "Guillaume Vincent ", "scripts": { diff --git a/packages/lesspass-web-site/package.json b/packages/lesspass-web-site/package.json index c7e5217..268a44f 100644 --- a/packages/lesspass-web-site/package.json +++ b/packages/lesspass-web-site/package.json @@ -1,6 +1,6 @@ { "name": "lesspass-web-site", - "version": "1.0.0", + "version": "8.0.0", "description": "LessPass web site", "license": "GPL-3.0", "author": "Guillaume Vincent ",