diff --git a/.travis.yml b/.travis.yml index fb2a8ca0b..1280318a4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,7 +27,7 @@ cache: before_install: - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then ./packaging/travis/setup_osx.sh; fi - mkdir -p lbrynet/resources/ui - - if [[ -z "$TRAVIS_TAG" ]]; then ./packaging/travis/setup_qa.sh; fi + - ./packaging/travis/setup_qa.sh install: - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then ./packaging/travis/install_dependencies_and_run_tests.sh; fi diff --git a/packaging/travis/setup_qa.sh b/packaging/travis/setup_qa.sh index 83bbc92df..1192521a2 100755 --- a/packaging/travis/setup_qa.sh +++ b/packaging/travis/setup_qa.sh @@ -6,10 +6,19 @@ set -euo pipefail set -o xtrace +# changes to this script also need to be added to build.ps1 for windows +add_ui() { + wget https://s3.amazonaws.com/lbry-ui/development/dist.zip -O dist.zip + unzip -oq dist.zip -d lbrynet/resources/ui + wget https://s3.amazonaws.com/lbry-ui/development/data.json -O lbrynet/resources/ui/data.json +} -# changes here also need to be added to build.ps1 for windows -python packaging/append_sha_to_version.py lbrynet/__init__.py ${TRAVIS_COMMIT} +IS_RC_REGEX="v[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+-rc[[:digit:]]+" -wget https://s3.amazonaws.com/lbry-ui/development/dist.zip -O dist.zip -unzip -oq dist.zip -d lbrynet/resources/ui -wget https://s3.amazonaws.com/lbry-ui/development/data.json -O lbrynet/resources/ui/data.json +if [[ -z "$TRAVIS_TAG" ]]; then + python packaging/append_sha_to_version.py lbrynet/__init__.py "${TRAVIS_COMMIT}" + add_ui +elif [[ "$TRAVIS_TAG" =~ $IS_RC_REGEX ]]; then + # If the tag looks like v0.7.6-rc0 then this is a tagged release candidate. + add_ui +fi diff --git a/packaging/windows/build.ps1 b/packaging/windows/build.ps1 index 859022a99..d57631927 100644 --- a/packaging/windows/build.ps1 +++ b/packaging/windows/build.ps1 @@ -1,13 +1,24 @@ # this is a port of setup_qa.sh used for the unix platforms + +function AddUi { + wget https://s3.amazonaws.com/lbry-ui/development/dist.zip -OutFile dist.zip + if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) } + + Expand-Archive dist.zip -dest lbrynet\resources\ui + if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) } + + wget https://s3.amazonaws.com/lbry-ui/development/data.json -OutFile lbrynet\resources\ui\data.json + if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) } +} + If (${Env:APPVEYOR_REPO_TAG} -NotMatch "true") { C:\Python27\python.exe packaging\append_sha_to_version.py lbrynet\__init__.py ${Env:APPVEYOR_REPO_COMMIT} if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) } - wget https://s3.amazonaws.com/lbry-ui/development/dist.zip -OutFile dist.zip - if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) } - Expand-Archive dist.zip -dest lbrynet\resources\ui - if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) } - wget https://s3.amazonaws.com/lbry-ui/development/data.json -OutFile lbrynet\resources\ui\data.json - if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) } + + AddUi +} +ElseIf (${Env:APPVEYOR_REPO_TAG_NAME} -Match "v\d+.\d+.\d+-rc\d+") { + AddUi } C:\Python27\python.exe setup.py build bdist_msi