Browse Source

bump_version.bash

tags/site-v9.3.1
Guillaume Vincent 2 years ago
parent
commit
cd5f1cbf6f
11 changed files with 113 additions and 29 deletions
  1. +2
    -0
      .github/workflows/cli-publish.yml
  2. +2
    -4
      .github/workflows/lesspass-crypto-publish.yml
  3. +1
    -3
      .github/workflows/lesspass-entropy-publish.yml
  4. +1
    -3
      .github/workflows/lesspass-fingerprint-publish.yml
  5. +3
    -5
      .github/workflows/lesspass-pure-publish.yml
  6. +1
    -3
      .github/workflows/lesspass-render-password-publish.yml
  7. +1
    -1
      .github/workflows/lesspass-render-password-test.yml
  8. +4
    -4
      .github/workflows/lesspass-web-extension-publish.yml
  9. +93
    -0
      bin/bump_version.bash
  10. +4
    -5
      packages/lesspass-web-extension/amo.md
  11. +1
    -1
      packages/lesspass-web-extension/package.json

+ 2
- 0
.github/workflows/cli-publish.yml View File

@@ -7,6 +7,7 @@ on:
- completed
jobs:
publish:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
@@ -16,6 +17,7 @@ jobs:
- run: |
cd cli
./deploy
continue-on-error: true
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}

+ 2
- 4
.github/workflows/lesspass-crypto-publish.yml View File

@@ -16,10 +16,8 @@ jobs:
node-version: "14"
registry-url: "https://registry.npmjs.org"
- run: yarn install
- run: yarn workspace lesspass-crypto run build
- run: |
cd packages/lesspass-crypto
yarn publish --non-interactive
- run: yarn workspace lesspass-crypto build
- run: yarn workspace lesspass-crypto publish --non-interactive
continue-on-error: true
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

+ 1
- 3
.github/workflows/lesspass-entropy-publish.yml View File

@@ -16,9 +16,7 @@ jobs:
node-version: "14"
registry-url: "https://registry.npmjs.org"
- run: yarn install
- run: |
cd packages/lesspass-entropy
yarn publish --non-interactive
- run: yarn workspace lesspass-entropy publish --non-interactive
continue-on-error: true
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

+ 1
- 3
.github/workflows/lesspass-fingerprint-publish.yml View File

@@ -16,9 +16,7 @@ jobs:
node-version: "14"
registry-url: "https://registry.npmjs.org"
- run: yarn install
- run: |
cd packages/lesspass-fingerprint
yarn publish --non-interactive
- run: yarn workspace lesspass-fingerprint publish --non-interactive
continue-on-error: true
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

+ 3
- 5
.github/workflows/lesspass-pure-publish.yml View File

@@ -16,11 +16,9 @@ jobs:
node-version: "14"
registry-url: "https://registry.npmjs.org"
- run: yarn install
- run: yarn workspace lesspass-crypto run build
- run: yarn workspace lesspass-pure run build
- run: |
cd packages/lesspass-pure
yarn publish --non-interactive
- run: yarn workspace lesspass-crypto build
- run: yarn workspace lesspass-pure build
- run: yarn workspace lesspass-pure publish --non-interactive
continue-on-error: true
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

+ 1
- 3
.github/workflows/lesspass-render-password-publish.yml View File

@@ -16,9 +16,7 @@ jobs:
node-version: "14"
registry-url: "https://registry.npmjs.org"
- run: yarn install
- run: |
cd packages/lesspass-render-password
yarn publish --non-interactive
- run: yarn workspace lesspass-render-password publish --non-interactive
continue-on-error: true
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

+ 1
- 1
.github/workflows/lesspass-render-password-test.yml View File

@@ -15,4 +15,4 @@ jobs:
with:
node-version: "14"
- run: yarn install
- run: yarn workspace lesspass-render-password run test
- run: yarn workspace lesspass-render-password test

+ 4
- 4
.github/workflows/lesspass-web-extension-publish.yml View File

@@ -12,10 +12,10 @@ jobs:
with:
node-version: "14"
- run: yarn install
- run: yarn workspace lesspass-crypto run build
- run: yarn workspace lesspass-pure run build
- run: yarn workspace lesspass-web-extension run build
- run: yarn workspace lesspass-web-extension run release
- run: yarn workspace lesspass-crypto build
- run: yarn workspace lesspass-pure build
- run: yarn workspace lesspass-web-extension build
- run: yarn workspace lesspass-web-extension release
continue-on-error: true
env:
WEB_EXT_API_KEY: ${{ secrets.WEB_EXT_API_KEY }}


+ 93
- 0
bin/bump_version.bash View File

@@ -0,0 +1,93 @@
#!/usr/bin/env bash

RED='\033[0;31m'
GREEN='\033[0;32m'
NOCOLOR='\033[0m'

function echo_red {
echo -e "${RED}$1${NOCOLOR}"
}

function echo_green {
echo -e "${GREEN}$1${NOCOLOR}"
}

function check_current_directory_is_root {
if [ ! -f README.md ]; then
echo_red "You seems to be in the wrong directory"
echo_red "Execute this script from the root of lesspass with ./bin/${0##*/}"
exit 1
fi
}

function check_repository_is_clean {
git remote update
git add .
git status
git diff-index --quiet HEAD
if [ $? == 1 ]
then
echo_red "Git repository not clean. Aborting."
exit 1
fi
if [ $(git rev-parse HEAD) != $(git rev-parse @{u}) ]
then
echo_red "Git branch diverged. Aborting."
exit 1
fi
}

function check_branch_is_main {
BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD)
if [ $BRANCH_NAME != "main" ]
then
echo_red "Current branch is not main. Aborting."
exit 1
fi
}

function check_usage {
is_invalid=false
package="${1}"
if [ "${package}" != "web-extension" ] && [ "${package}" != "site" ]
then
echo_red "Error: package is invalid. (web-extension or site)."
is_invalid=true
fi
bump_type="${2}"
if [ "${bump_type}" != "--major" ] && [ "${bump_type}" != "--minor" ] && [ "${bump_type}" != "--patch" ]
then
echo_red "Error: No bump type specified (--major, --minor or --patch)."
is_invalid=true
fi
if [ "$is_invalid" = true ]
then
echo_green "Example: ./bin/${0##*/} web-extension --patch"
echo_green "Example: ./bin/${0##*/} site --patch"
exit 1
fi
}

set +o errexit

package="${1:-}"
bump_type="${2:-}"
check_usage ${package} ${bump_type}
check_branch_is_main
check_current_directory_is_root
check_repository_is_clean

set -o errexit
set -o pipefail
set -o nounset

current_version=$( grep -m1 version packages/lesspass-${package}/package.json | cut -d '"' -f4 )
echo "Current lesspass-${package} version is ${current_version}"
yarn config set version-tag-prefix "${package}-v"
yarn config set version-git-message "${package}-v%s"
yarn workspace lesspass-${package} version ${bump_type}
yarn config set version-tag-prefix "v"
yarn config set version-git-message "v%s"
new_version=$( grep -m1 version packages/lesspass-${package}/package.json | cut -d '"' -f4 )
echo "New lesspass-${package} version is ${new_version}"
echo_green "git push --tags origin main"

+ 4
- 5
packages/lesspass-web-extension/amo.md View File

@@ -12,8 +12,8 @@ To rebuild the web extension, you need node, yarn and md5sum to check the md5 su

Tested with:

* node version 14.16.0
* yarn version 1.22.5
* node version 16.10.0
* yarn version 1.22.11
* md5sum (GNU coreutils) version 8.32

## unzip source {sha256}.zip
@@ -23,9 +23,8 @@ Tested with:

## Reproduce lesspass.min.js and dist folder with sources

cd packages/lesspass-pure
yarn install
yarn run build
cd ../../
yarn workspace lesspass-crypto build
yarn workspace lesspass-pure build
find packages/lesspass-web-extension/extension/dist/ -type f -exec md5sum {} \;
find packages/lesspass-pure/dist -type f -exec md5sum {} \;

+ 1
- 1
packages/lesspass-web-extension/package.json View File

@@ -1,7 +1,7 @@
{
"name": "lesspass-web-extension",
"description": "LessPass web extension",
"version": "9.5.0",
"version": "9.6.2",
"license": "GPL-3.0",
"author": "Guillaume Vincent <guillaume@oslab.fr>",
"scripts": {


Loading…
Cancel
Save