mirror of
https://github.com/dani-garcia/bw_web_builds.git
synced 2025-01-12 20:57:18 +03:00
Create and upload new release automatically
This commit is contained in:
parent
d3c08a554f
commit
e55e7985de
4 changed files with 42 additions and 9 deletions
7
.gitignore
vendored
7
.gitignore
vendored
|
@ -1,4 +1,5 @@
|
|||
build/
|
||||
src/
|
||||
builds/
|
||||
web-vault/
|
||||
|
||||
*.tar.gz
|
||||
*.tar.gz
|
||||
*.tar.gz.text
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
#!/bin/bash
|
||||
|
||||
export UPLOAD_VAULT="n"
|
||||
|
||||
export WEB_REF="v2.5.0"
|
||||
sh package_web_vault.sh
|
||||
|
||||
|
@ -7,4 +9,10 @@ export WEB_REF="v2.6.0"
|
|||
sh package_web_vault.sh
|
||||
|
||||
export WEB_REF="v2.6.1"
|
||||
sh package_web_vault.sh
|
||||
sh package_web_vault.sh
|
||||
|
||||
export WEB_REF="v2.7.0"
|
||||
sh package_web_vault.sh
|
||||
|
||||
export WEB_REF="v2.7.1"
|
||||
sh package_web_vault.sh
|
||||
|
|
|
@ -13,12 +13,18 @@ if [[ -z $WEB_REF ]]; then
|
|||
WEB_REF=$input
|
||||
fi
|
||||
|
||||
# Ask if the result will be uploaded to github releases
|
||||
if [[ -z $UPLOAD_VAULT ]]; then
|
||||
read -p "Upload the result to GitHub Releases? (y/n): " input
|
||||
UPLOAD_VAULT=$input
|
||||
fi
|
||||
|
||||
# If a patch was not provided, try to choose one
|
||||
if [[ -z $PATCH_NAME ]]; then
|
||||
# If a patch with the same name as the ref exists, use it
|
||||
if [ -f patches/$WEB_REF.patch ]; then
|
||||
echo "Patch file found, using that"
|
||||
PATCH_NAME=$WEB_REF".patch"
|
||||
PATCH_NAME=$WEB_REF.patch
|
||||
else
|
||||
echo "Patch file not found, using latest"
|
||||
# If not, use the latest one
|
||||
|
@ -29,12 +35,18 @@ fi
|
|||
echo "Building git ref: " $WEB_REF
|
||||
echo "Using patch: " $PATCH_NAME
|
||||
|
||||
VAULT_FOLDER=web-vault
|
||||
OUTPUT_FOLDER=builds
|
||||
OUTPUT_NAME=$OUTPUT_FOLDER/bw_web_$WEB_REF.tar.gz
|
||||
OUTPUT_MSG=$OUTPUT_NAME.text
|
||||
|
||||
# If this is the first time, clone the project
|
||||
if [ ! -d src ]; then
|
||||
git clone https://github.com/bitwarden/web.git src
|
||||
if [ ! -d $VAULT_FOLDER ]; then
|
||||
git clone https://github.com/bitwarden/web.git $VAULT_FOLDER
|
||||
mkdir OUTPUT_FOLDER
|
||||
fi
|
||||
|
||||
cd src
|
||||
cd $VAULT_FOLDER
|
||||
|
||||
# Clean
|
||||
git checkout .
|
||||
|
@ -66,4 +78,13 @@ find build -name "*.map" -delete
|
|||
|
||||
# Prepare the final archives
|
||||
cd build
|
||||
tar -czvf ../../bw_web_$WEB_REF.tar.gz *
|
||||
tar -czvf ../../$OUTPUT_NAME *
|
||||
|
||||
cd ../..
|
||||
|
||||
if [[ $UPLOAD_VAULT =~ ^[Yy]$ ]]
|
||||
then
|
||||
sed "s/<VERSION>/$WEB_REF/g" release_template.md > $OUTPUT_MSG
|
||||
# Install from here: https://hub.github.com/
|
||||
hub release create -o -a $OUTPUT_NAME -F $OUTPUT_MSG $WEB_REF
|
||||
fi
|
||||
|
|
3
release_template.md
Normal file
3
release_template.md
Normal file
|
@ -0,0 +1,3 @@
|
|||
<VERSION>
|
||||
|
||||
https://github.com/bitwarden/web/releases/tag/<VERSION>
|
Loading…
Reference in a new issue