From 0cd9e2ec3dd5116fd3c403e87175e8e0d58c9f16 Mon Sep 17 00:00:00 2001 From: Guillaume Vincent Date: Fri, 18 Oct 2019 20:36:04 +0200 Subject: [PATCH] Fix github deploy action --- .github/workflows/deploy.yml | 8 +++++--- bin/build_web_extension | 11 ----------- bin/build_web_extensions | 11 +++++++++++ bin/release_web_extensions | 23 ++++++++++++----------- yarn.lock | 35 +++++++++++++++++++++++++++++++++++ 5 files changed, 63 insertions(+), 25 deletions(-) delete mode 100755 bin/build_web_extension create mode 100755 bin/build_web_extensions diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 184996b..b74d830 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,9 +1,11 @@ name: deploy on: - push: - branches: - - refs/tags/* + push: + branches: + - master + tags: + - '*' jobs: deploy-containers: diff --git a/bin/build_web_extension b/bin/build_web_extension deleted file mode 100755 index 08c91bd..0000000 --- a/bin/build_web_extension +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env bash - -set -o errexit -set -o pipefail -set -o nounset - -yarn install -yarn workspace lesspass-pure run build -rm -rf packages/lesspass-web-extension/extension/dist -mkdir packages/lesspass-web-extension/extension/dist -cp -r packages/lesspass-pure/dist/. packages/lesspass-web-extension/extension/dist/ diff --git a/bin/build_web_extensions b/bin/build_web_extensions new file mode 100755 index 0000000..08c91bd --- /dev/null +++ b/bin/build_web_extensions @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +set -o errexit +set -o pipefail +set -o nounset + +yarn install +yarn workspace lesspass-pure run build +rm -rf packages/lesspass-web-extension/extension/dist +mkdir packages/lesspass-web-extension/extension/dist +cp -r packages/lesspass-pure/dist/. packages/lesspass-web-extension/extension/dist/ diff --git a/bin/release_web_extensions b/bin/release_web_extensions index 51a4493..04c7047 100755 --- a/bin/release_web_extensions +++ b/bin/release_web_extensions @@ -21,7 +21,9 @@ function check_tag_is_present { } function check_repository_is_clean { - git diff-index --quiet HEAD + git remote update + git status + git diff-index --quiet HEAD --; if [ $? == 1 ] then echo >&2 "Git repository not clean. Aborting." @@ -29,20 +31,19 @@ function check_repository_is_clean { fi } -function check_lesspass_pure_built_files_are_updated { - yarn workspace lesspass-pure run build - check_repository_is_clean -} - -function check_lesspass_web_extension_built_files_are_updated { - yarn workspace lesspass-web-extension run build - check_repository_is_clean +function check_env_variables_setted { + if [ -z "$EXTENSION_ID" ] || [ -z "$CLIENT_ID" ] || [ -z "$CLIENT_SECRET" ] || [ -z "$REFRESH_TOKEN" ] || [ -z "$WEB_EXT_API_KEY" ] || [ -z "$WEB_EXT_API_SECRET" ]; then + echo "Need to set EXTENSION_ID, CLIENT_ID, CLIENT_SECRET, REFRESH_TOKEN, WEB_EXT_API_KEY and WEB_EXT_API_SECRET env variables to release web extensions" + exit 1 + fi } check_branch_is_master check_tag_is_present -check_lesspass_web_extension_built_files_are_updated -check_lesspass_pure_built_files_are_updated +check_env_variables_setted +yarn workspace lesspass-web-extension run build +yarn workspace lesspass-pure run build +check_repository_is_clean set -o errexit set -o pipefail diff --git a/yarn.lock b/yarn.lock index 5648a99..70745dd 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8206,6 +8206,25 @@ left-pad@^1.3.0: resolved "https://registry.yarnpkg.com/left-pad/-/left-pad-1.3.0.tgz#5b8a3a7765dfe001261dde915589e782f8c94d1e" integrity sha512-XI5MPzVNApjAyhQzphX8BkmKsKUxD4LdyK24iZeQGinBN9yTQT3bFlCBy/aVx2HrNcqQGsdot8ghrjyrvMCoEA== +lesspass-crypto@9.0.0: + version "9.0.0" + resolved "https://registry.yarnpkg.com/lesspass-crypto/-/lesspass-crypto-9.0.0.tgz#11bd5a4c22d67b139412af7760647b280d5225fd" + integrity sha512-c2oEEOSx2+w+aGGoCsEVNK+yDw6yVLy2uEFExlMK2ANPzP2VDNtXl7JZizuEeVsGS9MO8A67dSYm/EWLtDsZ5A== + +lesspass-entropy@9.0.0: + version "9.0.0" + resolved "https://registry.yarnpkg.com/lesspass-entropy/-/lesspass-entropy-9.0.0.tgz#58201ad4242643c0b0097466202b6fd731d8310e" + integrity sha512-apX/BL3vdr9VvRm5lIVn8Pl17IIAnzuoAbFAN3Sf7jWiK7jCfbLMvN+yjtv2/Vnxqop4NX42oMq9fynMb1/cKw== + dependencies: + lesspass-crypto "9.0.0" + +lesspass-fingerprint@9.0.0: + version "9.0.0" + resolved "https://registry.yarnpkg.com/lesspass-fingerprint/-/lesspass-fingerprint-9.0.0.tgz#ffaf20dda04eb9c6b9f98e2110852d827618a34a" + integrity sha512-pguc6+hF8iXCTQEVegLeVGqvk0464M6tS0RdRdHx894fwL0/311EzDg2sYXIV6hJ82R6dB4mTLp0JJf0lXgRQQ== + dependencies: + lesspass-crypto "9.0.0" + lesspass-pure@latest: version "9.0.0" resolved "https://registry.yarnpkg.com/lesspass-pure/-/lesspass-pure-9.0.0.tgz#33030839e3bce7acc782a8cb8204152e2a29fd1d" @@ -8231,6 +8250,22 @@ lesspass-pure@latest: vuex-persistedstate "^2.5.4" vuex-router-sync "5.0.0" +lesspass-render-password@9.0.0: + version "9.0.0" + resolved "https://registry.yarnpkg.com/lesspass-render-password/-/lesspass-render-password-9.0.0.tgz#80cdc80b8362323b2e8d80aa286e558724659e92" + integrity sha512-qu5bySq0hBIzN4aSMY9RkRy2r0Xy4Y0ZocdsenOaU34az632xDZxkioyocgq16WquIyxhyh/QTaUQVfzqwt3aA== + dependencies: + big-integer "1.6.22" + +lesspass@9.0.0: + version "9.0.0" + resolved "https://registry.yarnpkg.com/lesspass/-/lesspass-9.0.0.tgz#376f2fc28482ec5596b0078ec7ab98e67d40cc22" + integrity sha512-P3+Ep4TkvUclx2rsOeDMTMRVs/r5dHumGtUqt8AScQ8CSQ8JhvdUuFY8enM//T9J2VjwFK/rOLgxvmfDWFifqg== + dependencies: + lesspass-entropy "9.0.0" + lesspass-fingerprint "9.0.0" + lesspass-render-password "9.0.0" + leven@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/leven/-/leven-2.1.0.tgz#c2e7a9f772094dee9d34202ae8acce4687875580"