1
1
mirror of https://github.com/qvacua/vimr.git synced 2024-11-28 02:54:31 +03:00
This commit is contained in:
Tae Won Ha 2016-10-14 12:15:32 +02:00
parent 1394029d40
commit 79c82ac458
No known key found for this signature in database
GPG Key ID: E40743465B5B8B44
11 changed files with 198 additions and 114 deletions

View File

@ -1,102 +0,0 @@
#!/bin/bash
# prerequisites:
# brew install github-release
# echo ${GITHUB_QVACUA_RELEASE_ACCESS_TOKEN} > ~/.config/github.qvacua.release.token
# chmod 700 ~/.config/github.qvacua.release.token
set -e
export PATH=/usr/local/bin:$PATH
CUR_MARKETING_VERSION=$(./bin/current_marketing_version.sh)
CUR_BUNDLE_VERSION=$(./bin/current_bundle_version.sh)
RELEASE_VERSION="$CUR_MARKETING_VERSION-$CUR_BUNDLE_VERSION"
SNAPSHOT_DATE=$(date +%Y%m%d.%H%M)
TAG_NAME=snapshot/${SNAPSHOT_DATE}-${CUR_BUNDLE_VERSION}
# delete all (local) tags
git tag | xargs git tag -d
# delete all (local) branches
git for-each-ref --format="%(refname:strip=2)" refs/heads/ | xargs git branch -D
git checkout -b build_snapshot
# delete previously built VimR
xcodebuild clean
rm -rf build
git submodule update --init --force
# Build NeoVim
# 0. Delete previously built things
# 1. Build normally to get the full runtime folder and copy it to the neovim's project root
# 2. Delete the build folder to re-configure
# 3. Build libnvim
pushd neovim
ln -f -s ../local.mk .
make distclean
make CMAKE_FLAGS="-DCUSTOM_UI=0"
make CMAKE_FLAGS="-DCMAKE_INSTALL_PREFIX=/tmp/nvim" install
cp -r /tmp/nvim/share/nvim/runtime .
make clean
rm -rf build
echo "### Building neovim"
make libnvim
echo "### Tagging neovim"
git tag -a -m "$CUR_MARKETING_VERSION ($CUR_BUNDLE_VERSION)" snapshot/${SNAPSHOT_DATE}-${CUR_BUNDLE_VERSION}
echo "### Pushing tag to neovim repository"
git push origin ${TAG_NAME}
popd
echo "### Updating carthage"
carthage update --platform osx
./bin/bump_bundle_version.sh
./bin/set_snapshot_date.sh
echo "### Building VimR"
xcodebuild CODE_SIGN_IDENTITY="Developer ID Application: Tae Won Ha (H96Q2NKTQH)" -configuration Release -target VimR
echo "### Committing version bump"
git commit -am "Set snapshot version: $RELEASE_VERSION"
echo "### Tagging VimR"
git tag -a -m "$CUR_MARKETING_VERSION ($CUR_BUNDLE_VERSION)" snapshot/${SNAPSHOT_DATE}-${CUR_BUNDLE_VERSION}
pushd build/Release
VIMR_FILE_NAME="VimR-${RELEASE_VERSION}.tar.bz2"
tar cjf ${VIMR_FILE_NAME} VimR.app
tar cjf SwiftNeoVim.framework-${RELEASE_VERSION}.tar.bz2 SwiftNeoVim.framework
echo ${RELEASE_VERSION} > "$RELEASE_VERSION"
echo "### Pushing commit and tag to vimr repository"
git push origin HEAD:${BRANCH}
git push origin ${TAG_NAME}
echo "### Creating release"
GITHUB_TOKEN=$(cat ~/.config/github.qvacua.release.token) github-release release \
--user qvacua \
--repo vimr \
--tag "$TAG_NAME" \
--name "$RELEASE_VERSION" \
--description "$RELEASE_NOTES" \
--pre-release
echo "### Uploading build"
GITHUB_TOKEN=$(cat ~/.config/github.qvacua.release.token) github-release upload \
--user qvacua \
--repo vimr \
--tag "$TAG_NAME" \
--name "$VIMR_FILE_NAME" \
--file "$VIMR_FILE_NAME"

36
bin/build_vimr.sh Executable file
View File

@ -0,0 +1,36 @@
#!/bin/bash
echo "### Building VimR"
# Build NeoVim
# 0. Delete previously built things
# 1. Build normally to get the full runtime folder and copy it to the neovim's project root
# 2. Delete the build folder to re-configure
# 3. Build libnvim
pushd neovim
ln -f -s ../local.mk .
rm -rf build
make distclean
echo "### Building nvim to get the runtime folder"
make CMAKE_FLAGS="-DCUSTOM_UI=0"
make CMAKE_FLAGS="-DCMAKE_INSTALL_PREFIX=/tmp/nvim" install
cp -r /tmp/nvim/share/nvim/runtime .
make clean
rm -rf build
echo "### Building libnvim"
make libnvim
popd
echo "### Updating carthage"
carthage update --platform osx
echo "### Building vimr target"
xcodebuild CODE_SIGN_IDENTITY="Developer ID Application: Tae Won Ha (H96Q2NKTQH)" -configuration Release -target VimR
echo "### Built VimR"

View File

@ -1,4 +0,0 @@
#!/bin/bash
agvtool bump -all

15
bin/clean_old_builds.sh Executable file
View File

@ -0,0 +1,15 @@
#!/bin/bash
echo "### Cleaning old builds"
# ## delete previously built VimR
rm -rf build
xcodebuild clean
# ## delete previously built neovim
pushd neovim
rm -rf build
make distclean
popd
echo "### Cleaned old builds"

25
bin/commit_and_push_tags.sh Executable file
View File

@ -0,0 +1,25 @@
#!/bin/bash
BRANCH=$1
TAG_NAME=$2
RELEASE_VERSION=$3
echo "### Committing version bump"
git commit -am "Bump version: ${RELEASE_VERSION}"
echo "### Tagging VimR"
git tag -a -m "${MARKETING_VERSION} (${BUNDLE_VERSION})" "${TAG_NAME}"
echo "### Pushing commit and tag to vimr repository"
echo git push origin HEAD:${BRANCH}
echo git push origin ${TAG_NAME}
pushd neovim
echo "### Tagging neovim"
git tag -a -m "${MARKETING_VERSION} (${BUNDLE_VERSION})" "${TAG_NAME}"
echo "### Pushing tag to neovim repository"
echo git push origin ${TAG_NAME}
popd neovim

View File

@ -1,4 +0,0 @@
#!/bin/bash
agvtool what-version | sed '2q;d' | sed -E 's/ +(.+)/\1/'

View File

@ -1,4 +0,0 @@
#!/bin/bash
agvtool what-marketing-version | tail -n 1 | sed -E 's/.*of "(.*)" in.*/\1/'

91
bin/new.sh Executable file
View File

@ -0,0 +1,91 @@
#!/bin/bash
set -e
export PATH=/usr/local/bin:$PATH
# # parameters
IS_SNAPSHOT=true
MARKETING_VERSION=$1
# ./bin/prepare_repositories.sh
# ./bin/clean_old_builds.sh
# ./bin/set_new_versions.sh
BUNDLE_VERSION=$(agvtool what-version | sed '2q;d' | sed -E 's/ +(.+)/\1/')
MARKETING_VERSION=$(agvtool what-marketing-version | tail -n 1 | sed -E 's/.*of "(.*)" in.*/\1/')
#./bin/build_vimr.sh
# push neovim tag
# commit and push vimr tag
exit 0
# TODO: should be params
MARKETING_VERSION=$(./bin/current_marketing_version.sh)
BUNDLE_VERSION=$(./bin/current_bundle_version.sh)
RELEASE_VERSION="${MARKETING_VERSION}-${BUNDLE_VERSION}"
CURRENT_DATE=$(date +%Y%m%d.%H%M)
TAG_NAME="snapshot/${CURRENT_DATE}-${BUNDLE_VERSION}"
# delete all (local) tags
git tag | xargs git tag -d
# delete all (local) branches
git for-each-ref --format="%(refname:strip=2)" refs/heads/ | xargs git branch -D
git checkout -b for_build
# delete previously built VimR
xcodebuild clean
rm -rf build
git submodule update --init --force
# Build NeoVim
# 0. Delete previously built things
# 1. Build normally to get the full runtime folder and copy it to the neovim's project root
# 2. Delete the build folder to re-configure
# 3. Build libnvim
pushd neovim
ln -f -s ../local.mk .
make distclean
make CMAKE_FLAGS="-DCUSTOM_UI=0"
make CMAKE_FLAGS="-DCMAKE_INSTALL_PREFIX=/tmp/nvim" install
cp -r /tmp/nvim/share/nvim/runtime .
make clean
rm -rf build
echo "### Building neovim"
make libnvim
echo "### Tagging neovim"
git tag -a -m "${MARKETING_VERSION} (${BUNDLE_VERSION})" "${TAG_NAME}"
popd
echo "### Updating carthage"
carthage update --platform osx
./bin/bump_bundle_version.sh
./bin/set_snapshot_date.sh
echo "### Building VimR"
xcodebuild CODE_SIGN_IDENTITY="Developer ID Application: Tae Won Ha (H96Q2NKTQH)" -configuration Release -target VimR
echo "### Committing version bump"
git commit -am "Set version: ${RELEASE_VERSION}"
echo "### Tagging VimR"
git tag -a -m "${MARKETING_VERSION} (${BUNDLE_VERSION})" "${TAG_NAME}"
pushd build/Release
VIMR_FILE_NAME="VimR-${RELEASE_VERSION}.tar.bz2"
tar cjf "${VIMR_FILE_NAME}" VimR.app

15
bin/prepare_repositories.sh Executable file
View File

@ -0,0 +1,15 @@
#!/bin/bash
echo "### Preparing repositories"
# ## delete all (local) tags
git tag | xargs git tag -d
# ## delete all (local) branches
git for-each-ref --format="%(refname:strip=2)" refs/heads/ | xargs git branch -D
git checkout -b for_build
# ## update neovim
git submodule update --init --force
echo "### Prepared repositories"

2
bin/release.py Executable file
View File

@ -0,0 +1,2 @@
#!/usr/bin/python2.7

14
bin/set_new_versions.sh Executable file
View File

@ -0,0 +1,14 @@
#!/bin/bash
echo "### Setting versions of VimR"
# ## bundle version
agvtool bump -all
# ## marketing version
if [ ${IS_SNAPSHOT} = true ] ; then
MARKETING_VERSION=$(agvtool what-marketing-version | tail -n 1 | sed -E 's/.*of "(.*)" in.*/\1/' | sed -E "s/(.*)-SNAPSHOT-.*/\1-SNAPSHOT-$(date +%Y%m%d.%H%M)/")
fi
agvtool new-marketing-version ${MARKETING_VERSION}
echo "### Set versions of VimR"