Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
srefgeqfeqrfg
arduino-esp32
提交
b855eb23
A
arduino-esp32
项目概览
srefgeqfeqrfg
/
arduino-esp32
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
A
arduino-esp32
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
b855eb23
编写于
6月 29, 2018
作者:
P
pacucha42
提交者:
Me No Dev
6月 29, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
* arduino-esp32 release mgmt. update (#1557)
上级
eb4e8913
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
24 addition
and
15 deletion
+24
-15
tools/build-release.sh
tools/build-release.sh
+18
-12
tools/deploy.sh
tools/deploy.sh
+6
-3
未找到文件。
tools/build-release.sh
浏览文件 @
b855eb23
...
...
@@ -162,10 +162,10 @@ shopt -u nocasematch
echo
"Package version:
$ver
"
echo
"Git branch name:
$branch_name
"
echo
"Git revision number
(short)
:
$verx
"
echo
"Git revision number:
$verx
"
echo
"Package name extension:
$extent
"
echo
"Travis CI tag:
$TRAVIS_TAG
"
echo
"Release package name
(unzipped)
:
$package_name
"
echo
"Release package name:
$package_name
"
# Set REMOTE_URL environment variable to the address where the package will be
# available for download. This gets written into package json file.
...
...
@@ -191,7 +191,6 @@ echo "Package build processing:"
echo
"========================="
echo
echo
"Prepare files for the package main archive:"
echo
"-------------------------------------------"
echo
" - copying neccessary files from current Git repository..."
# <PACKAGE ROOT>
...
...
@@ -257,14 +256,14 @@ pushd $releaseDir >/dev/null
zip
-qr
$package_name_zip
$package_name
if
[
$?
-ne
0
]
;
then
echo
"
!error: failed to create
${
package_name_zip
}
(ZIP errno:
$?
) => aborting"
echo
"
!error: failed to create
${
package_name_zip
}
(ZIP errno:
$?
) => aborting"
exit
1
fi
# Calculate SHA sum and size of ZIP archive
sha
=
`
shasum
-a
256
$package_name_zip
|
cut
-f
1
-d
' '
`
size
=
`
/bin/ls
-l
$package_name_zip
|
awk
'{print $5}'
`
echo
"
${
package_name_zip
}
creation OK (size:
$size
B
, sha2:
$sha
)"
echo
"
${
package_name_zip
}
creation OK (size:
$size
, sha2:
$sha
)"
echo
echo
"Making
$package_name
JSON definition file(s):"
...
...
@@ -293,23 +292,30 @@ rm -rf $outdir
# Get all previously released versions
echo
" - fetching previous (pre)release versions from GitHub..."
set
+e
releasesJson
=
$releaseDir
/releases.json
curl
-sH
"Authorization: token
$curlAuth
"
https://api.github.com/repos/
$TRAVIS_REPO_SLUG
/releases
>
$releasesJson
set
+e
# Previous final release (prerelase == false)
prev_release
=
$(
jq
-e
-r
'. | map(select(.draft == false and .prerelease == false)) | sort_by(.created_at | - fromdateiso8601) | .[0].tag_name'
${
releasesJson
}
)
# Previous release (possibly a pre-release)
prev_any_release
=
$(
jq
-e
-r
'. | map(select(.draft == false)) | sort_by(.created_at | - fromdateiso8601) | .[0].tag_name'
${
releasesJson
}
)
# Previous pre-release
prev_pre_release
=
$(
jq
-e
-r
'. | map(select(.draft == false and .prerelease == true)) | sort_by(.created_at | - fromdateiso8601) | .[0].tag_name'
${
releasesJson
}
)
shopt
-s
nocasematch
if
[
"
$prev_any_release
"
==
"
$TRAVIS_TAG
"
]
;
then
prev_release
=
$(
jq
-e
-r
'. | map(select(.draft == false and .prerelease == false)) | sort_by(.created_at | - fromdateiso8601) | .[1].tag_name'
${
releasesJson
}
)
prev_any_release
=
$(
jq
-e
-r
'. | map(select(.draft == false)) | sort_by(.created_at | - fromdateiso8601) | .[1].tag_name'
${
releasesJson
}
)
prev_pre_release
=
$(
jq
-e
-r
'. | map(select(.draft == false and .prerelease == true)) | sort_by(.created_at | - fromdateiso8601) | .[1].tag_name'
${
releasesJson
}
)
fi
shopt
-u
nocasematch
set
-e
rm
-f
"
$releasesJson
"
echo
"
--
previous Release:
$prev_release
"
echo
"
--
previous (?Pre-)release:
$prev_any_release
"
echo
"
--
previous Pre-release:
$prev_pre_release
"
echo
"
previous Release:
$prev_release
"
echo
"
previous (?Pre-)release:
$prev_any_release
"
echo
"
previous Pre-release:
$prev_pre_release
"
# add generated items to JSON package-definition contents
jq_arg
=
".packages[0].platforms[0].version =
\"
$ver
\"
|
\
...
...
tools/deploy.sh
浏览文件 @
b855eb23
...
...
@@ -119,21 +119,24 @@ fi
releaseNotes
=
$(
perl
-pe
's/\r?\n/\\n/'
<<<
${
releaseNotes
}
)
# Check possibly existing release for current tag
echo
"Checking for possible releases of current tag
$varTagName
..."
# (eg build invoked by Create New Release GHUI button -> GH default release pack created immediatelly including default assests)
HTTP_RESPONSE
=
$(
curl
-L
--silent
--write-out
"HTTPSTATUS:%{http_code}"
https://api.github.com/repos/
$varRepoSlug
/releases/tags/
$varTagName
)
HTTP_RESPONSE
=
$(
curl
-L
--silent
--write-out
"HTTPSTATUS:%{http_code}"
https://api.github.com/repos/
$varRepoSlug
/releases/tags/
$varTagName
?access_token
=
$varAccessToken
)
HTTP_BODY
=
$(
echo
$HTTP_RESPONSE
|
sed
-e
's/HTTPSTATUS\:.*//g'
)
HTTP_STATUS
=
$(
echo
$HTTP_RESPONSE
|
tr
-d
'\n'
|
sed
-e
's/.*HTTPSTATUS://'
)
echo
" HTTP server response code:
$HTTP_STATUS
"
# if the release exists, append/update recent files to its assets vector
if
[
$HTTP_STATUS
-eq
200
]
;
then
releaseId
=
$(
echo
$HTTP_BODY
| jq
-r
'.id'
)
echo
"
GH release exists for current
$varTagName
tag
(id
$releaseId
)"
echo
"
-
$varTagName
release found
(id
$releaseId
)"
#... or create a new release record
else
curlData
=
"{
\"
tag_name
\"
:
\"
$varTagName
\"
,
\"
target_commitish
\"
:
\"
master
\"
,
\"
name
\"
:
\"
v
$varTagName
\"
,
\"
body
\"
:
\"
$releaseNotes
\"
,
\"
draft
\"
: false,
\"
prerelease
\"
:
$varPrerelease
}"
#echo "DEBUG: curl --data \"${curlData}\" https://api.github.com/repos/${varRepoSlug}/releases?access_token=$varAccessToken | jq -r '.id'"
releaseId
=
$(
curl
--data
"
$curlData
"
https://api.github.com/repos/
$varRepoSlug
/releases?access_token
=
$varAccessToken
| jq
-r
'.id'
)
echo
"
New GH release created for
$varTagName
tag
(id
$releaseId
)"
echo
"
- new release created for
$varTagName
(id
$releaseId
)"
fi
# Assets defined by dir contents
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录