Skip to content

Commit

Permalink
Release 0.0.80
Browse files Browse the repository at this point in the history
  • Loading branch information
chemzqm committed Dec 21, 2020
1 parent d3ab5e2 commit ce448a6
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 1 deletion.
12 changes: 12 additions & 0 deletions dist/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/*
* ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
* This devtool is not neither made for production nor for readable output files.
* It uses "eval()" calls to create a separate source file in the browser devtools.
* If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
* or disable the default devtool with "devtool: false".
* If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
*/
/******/ (() => { // webpackBootstrap
/******/ "use strict";
/******/ })()
;
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "coc.nvim",
"version": "0.0.79",
"version": "0.0.80",
"description": "LSP based intellisense engine for neovim & vim8.",
"main": "./lib/index.js",
"engines": {
Expand Down Expand Up @@ -47,3 +47,4 @@
"devDependencies": {},
"dependencies": {}
}

56 changes: 56 additions & 0 deletions release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#!/bin/sh

set -e
set -x

git add package.json history.md
tag=v$(json -f package.json version)
git commit -a -m "Release $tag" &> /dev/null
rm -rf build
webpack
mkdir .release
cp -r build autoload package.json plugin data Readme.md doc history.md .release
git checkout release
cp -r .release/* .
git add .
git commit -a -m "Release $tag"
git tag -a "$tag" -m "Release $tag"
git push
git push --tags
## upload assets
cd ./build
tar -zcf coc.tar.gz index.js
zip coc.zip index.js
declare -a files=("coc.zip" "coc.tar.gz")
GH_API="https://api.github.com"
GH_REPO="$GH_API/repos/neoclide/coc.nvim"
GH_TAGS="$GH_REPO/releases/tags/$tag"
AUTH="Authorization: token $GITHUB_API_TOKEN"
# Validate token.
curl -o /dev/null -sH "$AUTH" $GH_REPO || { echo "Error: Invalid repo, token or network issue!"; exit 1; }
# Create release
echo "Creating release for $tag"
curl -X POST -H "Authorization: token $GITHUB_API_TOKEN" \
-H "Content-Type: application/json" \
--data "{\"tag_name\":\"$tag\"}" \
"$GH_REPO/releases"
# Read asset tags.
response=$(curl -sH "$AUTH" $GH_TAGS)
# Get ID of the asset based on given filename.
eval $(echo "$response" | grep -m 1 "id.:" | grep -w id | tr : = | tr -cd '[[:alnum:]]=')
[ "$id" ] || { echo "Error: Failed to get release id for tag: $tag"; echo "$response" | awk 'length($0)<100' >&2; exit 1; }
# Upload asset
for filename in "${files[@]}"
do
GH_ASSET="https://uploads.github.com/repos/neoclide/coc.nvim/releases/$id/assets?name=$filename"
echo "Uploading $filename"
curl -X POST -H "Authorization: token $GITHUB_API_TOKEN" \
-H "Content-Type: application/octet-stream" \
--data-binary @"$filename" \
$GH_ASSET
done
rm coc.zip coc.tar.gz
cd ..
git checkout master
rm -rf .release
nvim -c 'helptags doc|q'

0 comments on commit ce448a6

Please sign in to comment.