Skip to content

Commit 7f705ed

Browse files
committed
Merge branch 'master' into dev
2 parents f483075 + 91dc147 commit 7f705ed

File tree

9 files changed

+136
-45
lines changed

9 files changed

+136
-45
lines changed

Cargo.lock

+7-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "librespot"
3-
version = "0.1.3"
3+
version = "0.1.5"
44
authors = ["Librespot Org"]
55
license = "MIT"
66
description = "An open source client library for Spotify, with support for Spotify Connect"
@@ -22,22 +22,22 @@ doc = false
2222

2323
[dependencies.librespot-audio]
2424
path = "audio"
25-
version = "0.1.3"
25+
version = "0.1.5"
2626
[dependencies.librespot-connect]
2727
path = "connect"
28-
version = "0.1.3"
28+
version = "0.1.5"
2929
[dependencies.librespot-core]
3030
path = "core"
31-
version = "0.1.3"
31+
version = "0.1.5"
3232
[dependencies.librespot-metadata]
3333
path = "metadata"
34-
version = "0.1.3"
34+
version = "0.1.5"
3535
[dependencies.librespot-playback]
3636
path = "playback"
37-
version = "0.1.3"
37+
version = "0.1.5"
3838
[dependencies.librespot-protocol]
3939
path = "protocol"
40-
version = "0.1.3"
40+
version = "0.1.5"
4141

4242
[dependencies]
4343
base64 = "0.13"

audio/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
[package]
22
name = "librespot-audio"
3-
version = "0.1.3"
3+
version = "0.1.5"
44
authors = ["Paul Lietar <paul@lietar.net>"]
55
description="The audio fetching and processing logic for librespot"
66
license="MIT"
77
edition = "2018"
88

99
[dependencies.librespot-core]
1010
path = "../core"
11-
version = "0.1.3"
11+
version = "0.1.5"
1212

1313
[dependencies]
1414
bit-set = "0.5"

connect/Cargo.toml

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "librespot-connect"
3-
version = "0.1.3"
3+
version = "0.1.5"
44
authors = ["Paul Lietar <paul@lietar.net>"]
55
description = "The discovery and Spotify Connect logic for librespot"
66
license = "MIT"
@@ -9,13 +9,13 @@ edition = "2018"
99

1010
[dependencies.librespot-core]
1111
path = "../core"
12-
version = "0.1.3"
12+
version = "0.1.5"
1313
[dependencies.librespot-playback]
1414
path = "../playback"
15-
version = "0.1.3"
15+
version = "0.1.5"
1616
[dependencies.librespot-protocol]
1717
path = "../protocol"
18-
version = "0.1.3"
18+
version = "0.1.5"
1919

2020
[dependencies]
2121
base64 = "0.13"

core/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "librespot-core"
3-
version = "0.1.3"
3+
version = "0.1.5"
44
authors = ["Paul Lietar <paul@lietar.net>"]
55
build = "build.rs"
66
description = "The core functionality provided by librespot"
@@ -10,7 +10,7 @@ edition = "2018"
1010

1111
[dependencies.librespot-protocol]
1212
path = "../protocol"
13-
version = "0.1.3"
13+
version = "0.1.5"
1414

1515
[dependencies]
1616
base64 = "0.13"

metadata/Cargo.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "librespot-metadata"
3-
version = "0.1.3"
3+
version = "0.1.5"
44
authors = ["Paul Lietar <paul@lietar.net>"]
55
description = "The metadata logic for librespot"
66
license = "MIT"
@@ -16,7 +16,7 @@ log = "0.4"
1616

1717
[dependencies.librespot-core]
1818
path = "../core"
19-
version = "0.1.3"
19+
version = "0.1.5"
2020
[dependencies.librespot-protocol]
2121
path = "../protocol"
22-
version = "0.1.3"
22+
version = "0.1.5"

playback/Cargo.toml

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "librespot-playback"
3-
version = "0.1.3"
3+
version = "0.1.5"
44
authors = ["Sasha Hilton <sashahilton00@gmail.com>"]
55
description = "The audio playback logic for librespot"
66
license = "MIT"
@@ -9,13 +9,13 @@ edition = "2018"
99

1010
[dependencies.librespot-audio]
1111
path = "../audio"
12-
version = "0.1.3"
12+
version = "0.1.5"
1313
[dependencies.librespot-core]
1414
path = "../core"
15-
version = "0.1.3"
15+
version = "0.1.5"
1616
[dependencies.librespot-metadata]
1717
path = "../metadata"
18-
version = "0.1.3"
18+
version = "0.1.5"
1919

2020
[dependencies]
2121
futures = "0.1"

protocol/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "librespot-protocol"
3-
version = "0.1.3"
3+
version = "0.1.5"
44
authors = ["Paul Liétar <paul@lietar.net>"]
55
build = "build.rs"
66
description = "The protobuf logic for communicating with Spotify servers"

publish.sh

+106-15
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,25 @@
11
#!/bin/bash
22

3+
SKIP_MERGE='false'
4+
DRY_RUN='false'
5+
36
WORKINGDIR="$( cd "$(dirname "$0")" ; pwd -P )"
47
cd $WORKINGDIR
58

69
crates=( "protocol" "core" "audio" "metadata" "playback" "connect" "librespot" )
710

811
function switchBranch {
9-
# You are expected to have committed/stashed your changes before running this.
10-
echo "Switching to master branch and merging development."
11-
git checkout master
12-
git pull
13-
git merge dev
12+
if [ "$SKIP_MERGE" = 'false' ] ; then
13+
# You are expected to have committed/stashed your changes before running this.
14+
echo "Switching to master branch and merging development."
15+
git checkout master
16+
git pull
17+
if [ "$DRY_RUN" = 'true' ] ; then
18+
git merge --no-commit --no-ff dev
19+
else
20+
git merge dev
21+
fi
22+
fi
1423
}
1524

1625
function updateVersion {
@@ -26,15 +35,25 @@ function updateVersion {
2635
echo "Path is $crate_path"
2736
if [ "$CRATE" = "librespot" ]
2837
then
29-
cargo update
30-
git add . && git commit -a -m "Update Cargo.lock"
38+
if [ "$DRY_RUN" = 'true' ] ; then
39+
cargo update --dry-run
40+
git add . && git commit --dry-run -a -m "Update Cargo.lock"
41+
else
42+
cargo update
43+
git add . && git commit -a -m "Update Cargo.lock"
44+
fi
3145
fi
3246
done
3347
}
3448

3549
function commitAndTag {
36-
git commit -a -m "Update version numbers to $1"
37-
git tag "v$1" -a -m "Update to version $1"
50+
if [ "$DRY_RUN" = 'true' ] ; then
51+
# Skip tagging on dry run.
52+
git commit --dry-run -a -m "Update version numbers to $1"
53+
else
54+
git commit -a -m "Update version numbers to $1"
55+
git tag "v$1" -a -m "Update to version $1"
56+
fi
3857
}
3958

4059
function get_crate_name {
@@ -72,9 +91,17 @@ function publishCrates {
7291
if [ "$CRATE" == "protocol" ]
7392
then
7493
# Protocol crate needs --no-verify option due to build.rs modification.
75-
cargo publish --no-verify
94+
if [ "$DRY_RUN" = 'true' ] ; then
95+
cargo publish --no-verify --dry-run
96+
else
97+
cargo publish --no-verify
98+
fi
7699
else
77-
cargo publish
100+
if [ "$DRY_RUN" = 'true' ] ; then
101+
cargo publish --dry-run
102+
else
103+
cargo publish
104+
fi
78105
fi
79106
echo "Successfully published $crate_name to crates.io"
80107
remoteWait 30 $crate_name
@@ -83,10 +110,32 @@ function publishCrates {
83110

84111
function updateRepo {
85112
cd $WORKINGDIR
86-
echo "Pushing to master branch of repo."
87-
git push origin master
88-
echo "Pushing v$1 tag to master branch of repo."
89-
git push origin v$1
113+
if [ "$DRY_RUN" = 'true' ] ; then
114+
echo "Pushing to master branch of repo. [DRY RUN]"
115+
git push --dry-run origin master
116+
echo "Pushing v$1 tag to master branch of repo. [DRY RUN]"
117+
git push --dry-run origin v$1
118+
119+
# Cancels any merges in progress
120+
git merge --abort
121+
122+
git checkout dev
123+
git merge --no-commit --no-ff master
124+
125+
# Cancels above merge
126+
git merge --abort
127+
128+
git push --dry-run
129+
else
130+
echo "Pushing to master branch of repo."
131+
git push origin master
132+
echo "Pushing v$1 tag to master branch of repo."
133+
git push origin v$1
134+
# Update the dev repo with latest version commit
135+
git checkout dev
136+
git merge master
137+
git push
138+
fi
90139
}
91140

92141
function rebaseDev {
@@ -105,5 +154,47 @@ function run {
105154
echo "Successfully published v$1 to crates.io and uploaded changes to repo."
106155
}
107156

157+
#Set Script Name variable
158+
SCRIPT=`basename ${BASH_SOURCE[0]}`
159+
160+
print_usage () {
161+
local l_MSG=$1
162+
if [ ! -z "${l_MSG}" ]; then
163+
echo "Usage Error: $l_MSG"
164+
fi
165+
echo "Usage: $SCRIPT <args> <version>"
166+
echo " where <version> specifies the version number in semver format, eg. 1.0.1"
167+
echo "Recognized optional command line arguments"
168+
echo "--dry-run -- Test the script before making live changes"
169+
echo "--skip-merge -- Skip merging dev into master before publishing"
170+
exit 1
171+
}
172+
173+
### check number of command line arguments
174+
NUMARGS=$#
175+
if [ $NUMARGS -eq 0 ]; then
176+
print_usage 'No command line arguments specified'
177+
fi
178+
179+
while test $# -gt 0; do
180+
case "$1" in
181+
-h|--help)
182+
print_usage
183+
exit 0
184+
;;
185+
--dry-run)
186+
DRY_RUN='true'
187+
shift
188+
;;
189+
--skip-merge)
190+
SKIP_MERGE='true'
191+
shift
192+
;;
193+
*)
194+
break
195+
;;
196+
esac
197+
done
198+
108199
# First argument is new version number.
109200
run $1

0 commit comments

Comments
 (0)