Skip to content

Commit

Permalink
Merge branch 'master' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
sashahilton00 committed Feb 20, 2021
2 parents f483075 + 91dc147 commit 7f705ed
Show file tree
Hide file tree
Showing 9 changed files with 136 additions and 45 deletions.
14 changes: 7 additions & 7 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "librespot"
version = "0.1.3"
version = "0.1.5"
authors = ["Librespot Org"]
license = "MIT"
description = "An open source client library for Spotify, with support for Spotify Connect"
Expand All @@ -22,22 +22,22 @@ doc = false

[dependencies.librespot-audio]
path = "audio"
version = "0.1.3"
version = "0.1.5"
[dependencies.librespot-connect]
path = "connect"
version = "0.1.3"
version = "0.1.5"
[dependencies.librespot-core]
path = "core"
version = "0.1.3"
version = "0.1.5"
[dependencies.librespot-metadata]
path = "metadata"
version = "0.1.3"
version = "0.1.5"
[dependencies.librespot-playback]
path = "playback"
version = "0.1.3"
version = "0.1.5"
[dependencies.librespot-protocol]
path = "protocol"
version = "0.1.3"
version = "0.1.5"

[dependencies]
base64 = "0.13"
Expand Down
4 changes: 2 additions & 2 deletions audio/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
[package]
name = "librespot-audio"
version = "0.1.3"
version = "0.1.5"
authors = ["Paul Lietar <[email protected]>"]
description="The audio fetching and processing logic for librespot"
license="MIT"
edition = "2018"

[dependencies.librespot-core]
path = "../core"
version = "0.1.3"
version = "0.1.5"

[dependencies]
bit-set = "0.5"
Expand Down
8 changes: 4 additions & 4 deletions connect/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "librespot-connect"
version = "0.1.3"
version = "0.1.5"
authors = ["Paul Lietar <[email protected]>"]
description = "The discovery and Spotify Connect logic for librespot"
license = "MIT"
Expand All @@ -9,13 +9,13 @@ edition = "2018"

[dependencies.librespot-core]
path = "../core"
version = "0.1.3"
version = "0.1.5"
[dependencies.librespot-playback]
path = "../playback"
version = "0.1.3"
version = "0.1.5"
[dependencies.librespot-protocol]
path = "../protocol"
version = "0.1.3"
version = "0.1.5"

[dependencies]
base64 = "0.13"
Expand Down
4 changes: 2 additions & 2 deletions core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "librespot-core"
version = "0.1.3"
version = "0.1.5"
authors = ["Paul Lietar <[email protected]>"]
build = "build.rs"
description = "The core functionality provided by librespot"
Expand All @@ -10,7 +10,7 @@ edition = "2018"

[dependencies.librespot-protocol]
path = "../protocol"
version = "0.1.3"
version = "0.1.5"

[dependencies]
base64 = "0.13"
Expand Down
6 changes: 3 additions & 3 deletions metadata/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "librespot-metadata"
version = "0.1.3"
version = "0.1.5"
authors = ["Paul Lietar <[email protected]>"]
description = "The metadata logic for librespot"
license = "MIT"
Expand All @@ -16,7 +16,7 @@ log = "0.4"

[dependencies.librespot-core]
path = "../core"
version = "0.1.3"
version = "0.1.5"
[dependencies.librespot-protocol]
path = "../protocol"
version = "0.1.3"
version = "0.1.5"
8 changes: 4 additions & 4 deletions playback/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "librespot-playback"
version = "0.1.3"
version = "0.1.5"
authors = ["Sasha Hilton <[email protected]>"]
description = "The audio playback logic for librespot"
license = "MIT"
Expand All @@ -9,13 +9,13 @@ edition = "2018"

[dependencies.librespot-audio]
path = "../audio"
version = "0.1.3"
version = "0.1.5"
[dependencies.librespot-core]
path = "../core"
version = "0.1.3"
version = "0.1.5"
[dependencies.librespot-metadata]
path = "../metadata"
version = "0.1.3"
version = "0.1.5"

[dependencies]
futures = "0.1"
Expand Down
2 changes: 1 addition & 1 deletion protocol/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "librespot-protocol"
version = "0.1.3"
version = "0.1.5"
authors = ["Paul Liétar <[email protected]>"]
build = "build.rs"
description = "The protobuf logic for communicating with Spotify servers"
Expand Down
121 changes: 106 additions & 15 deletions publish.sh
Original file line number Diff line number Diff line change
@@ -1,16 +1,25 @@
#!/bin/bash

SKIP_MERGE='false'
DRY_RUN='false'

WORKINGDIR="$( cd "$(dirname "$0")" ; pwd -P )"
cd $WORKINGDIR

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

function switchBranch {
# You are expected to have committed/stashed your changes before running this.
echo "Switching to master branch and merging development."
git checkout master
git pull
git merge dev
if [ "$SKIP_MERGE" = 'false' ] ; then
# You are expected to have committed/stashed your changes before running this.
echo "Switching to master branch and merging development."
git checkout master
git pull
if [ "$DRY_RUN" = 'true' ] ; then
git merge --no-commit --no-ff dev
else
git merge dev
fi
fi
}

function updateVersion {
Expand All @@ -26,15 +35,25 @@ function updateVersion {
echo "Path is $crate_path"
if [ "$CRATE" = "librespot" ]
then
cargo update
git add . && git commit -a -m "Update Cargo.lock"
if [ "$DRY_RUN" = 'true' ] ; then
cargo update --dry-run
git add . && git commit --dry-run -a -m "Update Cargo.lock"
else
cargo update
git add . && git commit -a -m "Update Cargo.lock"
fi
fi
done
}

function commitAndTag {
git commit -a -m "Update version numbers to $1"
git tag "v$1" -a -m "Update to version $1"
if [ "$DRY_RUN" = 'true' ] ; then
# Skip tagging on dry run.
git commit --dry-run -a -m "Update version numbers to $1"
else
git commit -a -m "Update version numbers to $1"
git tag "v$1" -a -m "Update to version $1"
fi
}

function get_crate_name {
Expand Down Expand Up @@ -72,9 +91,17 @@ function publishCrates {
if [ "$CRATE" == "protocol" ]
then
# Protocol crate needs --no-verify option due to build.rs modification.
cargo publish --no-verify
if [ "$DRY_RUN" = 'true' ] ; then
cargo publish --no-verify --dry-run
else
cargo publish --no-verify
fi
else
cargo publish
if [ "$DRY_RUN" = 'true' ] ; then
cargo publish --dry-run
else
cargo publish
fi
fi
echo "Successfully published $crate_name to crates.io"
remoteWait 30 $crate_name
Expand All @@ -83,10 +110,32 @@ function publishCrates {

function updateRepo {
cd $WORKINGDIR
echo "Pushing to master branch of repo."
git push origin master
echo "Pushing v$1 tag to master branch of repo."
git push origin v$1
if [ "$DRY_RUN" = 'true' ] ; then
echo "Pushing to master branch of repo. [DRY RUN]"
git push --dry-run origin master
echo "Pushing v$1 tag to master branch of repo. [DRY RUN]"
git push --dry-run origin v$1

# Cancels any merges in progress
git merge --abort

git checkout dev
git merge --no-commit --no-ff master

# Cancels above merge
git merge --abort

git push --dry-run
else
echo "Pushing to master branch of repo."
git push origin master
echo "Pushing v$1 tag to master branch of repo."
git push origin v$1
# Update the dev repo with latest version commit
git checkout dev
git merge master
git push
fi
}

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

#Set Script Name variable
SCRIPT=`basename ${BASH_SOURCE[0]}`

print_usage () {
local l_MSG=$1
if [ ! -z "${l_MSG}" ]; then
echo "Usage Error: $l_MSG"
fi
echo "Usage: $SCRIPT <args> <version>"
echo " where <version> specifies the version number in semver format, eg. 1.0.1"
echo "Recognized optional command line arguments"
echo "--dry-run -- Test the script before making live changes"
echo "--skip-merge -- Skip merging dev into master before publishing"
exit 1
}

### check number of command line arguments
NUMARGS=$#
if [ $NUMARGS -eq 0 ]; then
print_usage 'No command line arguments specified'
fi

while test $# -gt 0; do
case "$1" in
-h|--help)
print_usage
exit 0
;;
--dry-run)
DRY_RUN='true'
shift
;;
--skip-merge)
SKIP_MERGE='true'
shift
;;
*)
break
;;
esac
done

# First argument is new version number.
run $1

0 comments on commit 7f705ed

Please sign in to comment.