forked from streamlink/streamlink
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbintrayconfig.sh
More file actions
executable file
·56 lines (46 loc) · 1.85 KB
/
Copy pathbintrayconfig.sh
File metadata and controls
executable file
·56 lines (46 loc) · 1.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/usr/bin/env bash
#
# Script to generate bintray config for nightly builds
#
build_dir="$(pwd)/build"
nsis_dir="${build_dir}/nsis"
# get the dist directory from an environment variable, but default to the build/nsis directory
dist_dir="${STREAMLINK_INSTALLER_DIST_DIR:-$nsis_dir}"
# TODO: extract this common version detection code in to a separate function
# For travis nightly builds generate a version number with commit hash
STREAMLINK_VERSION=$(python setup.py --version)
STREAMLINK_VERSION_PLAIN="${STREAMLINK_VERSION%%+*}"
STREAMLINK_INSTALLER="streamlink-${STREAMLINK_VERSION/\+/_}"
cat > "${build_dir}/bintray-nightly.json" <<EOF
{
"package": {
"subject": "streamlink",
"repo": "streamlink-nightly",
"name": "streamlink"
},
"version": {
"name": "$(date +'%Y.%m.%d')",
"released": "$(date +'%Y-%m-%d')",
"desc": "Streamlink Nightly based on ${STREAMLINK_VERSION}"
},
"files": [
{
"includePattern": "${dist_dir}/${STREAMLINK_INSTALLER}.exe",
"uploadPattern": "streamlink-${STREAMLINK_VERSION_PLAIN}-$(date +'%Y%m%d').exe",
"matrixParams": {
"override": 1,
"publish": 1
}
}
],
"publish": true
}
EOF
echo "Wrote Bintray config to: ${build_dir}/bintray-nightly.json"
# update repo to full clone and get the tags
git fetch --unshallow
git fetch --tags
latest_tag=$(git describe --tags --abbrev=0)
tag_changes_json=$(git log ${latest_tag}..HEAD --no-merges --pretty=format:" * [\`%h\`](https://github.com/streamlink/streamlink/commit/%H) %s" | sed ':a;N;$!ba;s/\n/\\n/g' | sed 's/"/\\"/g')
echo "{\"bintray\": {\"content\": \"**This build includes the following changes since [v${latest_tag}](https://github.com/streamlink/streamlink/releases/tag/${latest_tag})**\n\n${tag_changes_json}\"}}" > "${build_dir}/bintray-changelog.json"
echo "Wrote changelog to ${build_dir}/bintray-changelog.json"