소스 검색

Create web extensions release script

pull/447/head
Guillaume Vincent 5 년 전
부모
커밋
9d850c7956
1개의 변경된 파일53개의 추가작업 그리고 0개의 파일을 삭제
  1. +53
    -0
      bin/release_web_extensions

+ 53
- 0
bin/release_web_extensions 파일 보기

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

set +o errexit

function check_branch_is_master {
BRANCH_NAME=$(git branch | grep \* | cut -d ' ' -f2)
if [ $BRANCH_NAME != "master" ]
then
echo >&2 "Current branch is not master. Aborting."
exit 1
fi
}

function check_tag_is_present {
git describe --exact-match --tags
if [ $? != 0 ]
then
echo >&2 "Current revision is not tagged. Aborting."
exit 1
fi
}

function check_repository_is_clean {
git diff-index --quiet HEAD
if [ $? == 1 ]
then
echo >&2 "Git repository not clean. Aborting."
exit 1
fi
}

function check_lesspass_pure_built_files_are_updated {
yarn workspace lesspass-pure run build
check_repository_is_clean
}

function check_lesspass_pure_built_files_are_updated {
yarn workspace lesspass-web-extension run build
check_repository_is_clean
}

check_branch_is_master
check_tag_is_present
check_lesspass_web_extension_built_files_are_updated
check_lesspass_pure_built_files_are_updated

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

yarn workspace lesspass-web-extension run release
VERSION=$(grep -Po '(?<="version": ")[^"]*' package.json)
echo "See the new release on https://github.com/lesspass/lesspass/releases/tag/${VERSION}"

불러오는 중...
취소
저장