diff --git a/.github/workflows/cli-publish.yml b/.github/workflows/cli-publish.yml index 309fce4..6802415 100644 --- a/.github/workflows/cli-publish.yml +++ b/.github/workflows/cli-publish.yml @@ -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 }} diff --git a/.github/workflows/lesspass-crypto-publish.yml b/.github/workflows/lesspass-crypto-publish.yml index f12ad7d..cdf5687 100644 --- a/.github/workflows/lesspass-crypto-publish.yml +++ b/.github/workflows/lesspass-crypto-publish.yml @@ -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 }} diff --git a/.github/workflows/lesspass-entropy-publish.yml b/.github/workflows/lesspass-entropy-publish.yml index 5ec57fd..491ee01 100644 --- a/.github/workflows/lesspass-entropy-publish.yml +++ b/.github/workflows/lesspass-entropy-publish.yml @@ -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 }} diff --git a/.github/workflows/lesspass-fingerprint-publish.yml b/.github/workflows/lesspass-fingerprint-publish.yml index ff82211..3f8967f 100644 --- a/.github/workflows/lesspass-fingerprint-publish.yml +++ b/.github/workflows/lesspass-fingerprint-publish.yml @@ -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 }} diff --git a/.github/workflows/lesspass-pure-publish.yml b/.github/workflows/lesspass-pure-publish.yml index 7c9d321..24af180 100644 --- a/.github/workflows/lesspass-pure-publish.yml +++ b/.github/workflows/lesspass-pure-publish.yml @@ -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 }} diff --git a/.github/workflows/lesspass-render-password-publish.yml b/.github/workflows/lesspass-render-password-publish.yml index bf2a1ac..8befe1d 100644 --- a/.github/workflows/lesspass-render-password-publish.yml +++ b/.github/workflows/lesspass-render-password-publish.yml @@ -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 }} diff --git a/.github/workflows/lesspass-render-password-test.yml b/.github/workflows/lesspass-render-password-test.yml index 3e6f615..761ce72 100644 --- a/.github/workflows/lesspass-render-password-test.yml +++ b/.github/workflows/lesspass-render-password-test.yml @@ -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 diff --git a/.github/workflows/lesspass-web-extension-publish.yml b/.github/workflows/lesspass-web-extension-publish.yml index f36c2cf..3e16815 100644 --- a/.github/workflows/lesspass-web-extension-publish.yml +++ b/.github/workflows/lesspass-web-extension-publish.yml @@ -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 }} diff --git a/bin/bump_version.bash b/bin/bump_version.bash new file mode 100755 index 0000000..9ebbb3b --- /dev/null +++ b/bin/bump_version.bash @@ -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" \ No newline at end of file diff --git a/packages/lesspass-web-extension/amo.md b/packages/lesspass-web-extension/amo.md index 7d1fdff..7380616 100644 --- a/packages/lesspass-web-extension/amo.md +++ b/packages/lesspass-web-extension/amo.md @@ -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 {} \; diff --git a/packages/lesspass-web-extension/package.json b/packages/lesspass-web-extension/package.json index c469085..ac12420 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": "9.5.0", + "version": "9.6.2", "license": "GPL-3.0", "author": "Guillaume Vincent ", "scripts": {