Skip to content
This repository was archived by the owner on Mar 23, 2022. It is now read-only.

Commit 5f2c4ea

Browse files
committed
Update build and release scripts
1 parent 9c376c7 commit 5f2c4ea

File tree

2 files changed

+41
-3
lines changed

2 files changed

+41
-3
lines changed

build.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22
set -e
33
set -u
44

5-
if [ -f che-editor-plugin.tar.gz ]; then
6-
rm che-editor-plugin.tar.gz
5+
if [ -f ./build/che-editor-plugin.tar.gz ]; then
6+
rm -rf ./build
77
fi
88

99
cd etc
10-
tar zcvf ../che-editor-plugin.tar.gz .
10+
mkdir -p ../build
11+
tar zcf ../build/che-editor-plugin.tar.gz .
1112

release.sh

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#!/bin/sh
2+
set -e
3+
set -u
4+
5+
6+
7+
./build.sh
8+
9+
version=che-editor-gwt-ide-$(date +'%F_%k%M-%S')
10+
git tag $version
11+
git push --tags
12+
text="Release of Che Editor Gwt IDE"
13+
branch=master
14+
repo_full_name=eclipse/che-editor-gwt-ide
15+
token=$GITHUB_RELEASE_TOKEN
16+
generate_post_data()
17+
{
18+
cat <<EOF
19+
{
20+
"tag_name": "$version",
21+
"target_commitish": "master",
22+
"name": "$version",
23+
"body": "Description of the release",
24+
"draft": false,
25+
"prerelease": false
26+
}
27+
EOF
28+
}
29+
30+
echo "Create release $version for repo: $repo_full_name branch: $branch"
31+
rel_id=$(curl -s --data "$(generate_post_data)" "https://api.github.com/repos/$repo_full_name/releases?access_token=$token"| jq -r .id)
32+
echo "Uploading file build/che-editor-plugin.tar.gz"
33+
download_ulr=$(curl -s -X POST "https://uploads.github.com/repos/$repo_full_name/releases/${rel_id}/assets?name=che-editor-plugin.tar.gz&access_token=$token" \
34+
--header 'Content-Type: text/javascript ' --upload-file build/che-editor-plugin.tar.gz | jq -r .browser_download_url)
35+
echo "Download url $download_ulr"
36+
37+
rm build/che-editor-plugin.tar.gz

0 commit comments

Comments
 (0)