diff options
-rw-r--r-- | .travis.yml | 27 | ||||
-rwxr-xr-x | ci/snap/after_success.sh | 19 | ||||
-rwxr-xr-x | ci/snap/deploy.sh | 21 | ||||
-rwxr-xr-x | ci/snap/install.sh | 10 | ||||
-rwxr-xr-x | ci/snap/script.sh | 8 |
5 files changed, 85 insertions, 0 deletions
diff --git a/.travis.yml b/.travis.yml index d8a1d2ddf0..9302fb573d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -145,6 +145,33 @@ jobs: env: - CLANG_SANITIZER=TSAN - *common-job-env + - if: type != pull + name: snap + os: linux + env: + - LC_ALL: C.UTF-8 + - LANG: C.UTF-8 + - SNAPCRAFT_ENABLE_SILENT_REPORT: y + - SNAPCRAFT_ENABLE_DEVELOPER_DEBUG: y + addons: + snaps: + - name: snapcraft + channel: stable + classic: true + - name: http + - name: transfer + - name: lxd + channel: stable + before_install: /bin/true + install: ci/snap/install.sh + before_script: echo "Building snap..." + script: ci/snap/script.sh + after_success: ci/snap/after_success.sh + before_cache: /bin/true + deploy: + skip_cleanup: true + provider: script + script: ci/snap/deploy.sh fast_finish: true before_install: ci/before_install.sh diff --git a/ci/snap/after_success.sh b/ci/snap/after_success.sh new file mode 100755 index 0000000000..92a3e72036 --- /dev/null +++ b/ci/snap/after_success.sh @@ -0,0 +1,19 @@ +#!/usr/bin/env bash + +set -e +set -o pipefail + + +RESULT_SNAP=$(find ./ -name "*.snap") + +sudo snap install "$RESULT_SNAP" --dangerous --classic + +/snap/bin/nvim --version + +SHA256=$(sha256sum "$RESULT_SNAP") +echo "SHA256: ${SHA256} ." + +timeout 240 /snap/bin/transfer "$RESULT_SNAP" + +travis_retry bash "${ROOT_PATH}/scripts/services/0x0.st.sh" "${RESULT_SNAP}" + diff --git a/ci/snap/deploy.sh b/ci/snap/deploy.sh new file mode 100755 index 0000000000..9f556b9eb8 --- /dev/null +++ b/ci/snap/deploy.sh @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +set -e +set -o pipefail + +# not a tagged release, abort +[[ "$TRAVIS_TAG" != "$TRAVIS_BRANCH" ]] && exit 0 + +openssl aes-256-cbc -K $encrypted_0a6446eb3ae3_key \ + -iv $encrypted_0a6446eb3ae3_iv \ + -in .snapcraft/travis_snapcraft.cfg \ + -out .snapcraft/snapcraft.cfg -d + +SNAP=$(find ./ -name "*.snap") + +if [[ "$SNAP" =~ "dirty" || "$SNAP" =~ "nightly" ]]; then + snapcraft push "$SNAP" --release edge +else + snapcraft push "$SNAP" --release candidate +fi + diff --git a/ci/snap/install.sh b/ci/snap/install.sh new file mode 100755 index 0000000000..23e0bc5eb8 --- /dev/null +++ b/ci/snap/install.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +set -e +set -o pipefail + +sudo apt update +sudo /snap/bin/lxd.migrate -yes +sudo /snap/bin/lxd waitready +sudo /snap/bin/lxd init --auto + diff --git a/ci/snap/script.sh b/ci/snap/script.sh new file mode 100755 index 0000000000..647cda4874 --- /dev/null +++ b/ci/snap/script.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +set -e +set -o pipefail + +mkdir -p "$TRAVIS_BUILD_DIR/snaps-cache" +sudo snapcraft --use-lxd + |