From d5351c48e3460550ebcbaa810ce45063c1dbea32 Mon Sep 17 00:00:00 2001 From: Maximilian Federle Date: Sat, 23 Nov 2019 21:45:32 +0100 Subject: [PATCH] snap: build snaps on Travis via remote-build. We invoke builds on Launchpad in stage "deploy" and release it into the edge channel of the Snap Store. The deploy stage is blocked on fails of the test stage, so we don't release snaps with failing tests. --- .travis.yml | 25 +++++++++++++++++++++++++ .travis/build-snap.sh | 15 +++++++++++++++ .travis/launchpad-credentials.enc | Bin 0 -> 224 bytes 3 files changed, 40 insertions(+) create mode 100755 .travis/build-snap.sh create mode 100644 .travis/launchpad-credentials.enc diff --git a/.travis.yml b/.travis.yml index 9dbf0369..1544ef3d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -25,3 +25,28 @@ jobs: on: repo: solvespace/solvespace tags: true + - stage: deploy + name: "Snap" + os: linux + dist: bionic + addons: + snaps: + - name: snapcraft + confinement: classic + script: ./.travis/build-snap.sh + deploy: + - provider: snap + skip_cleanup: true + snap: pkg/snap/*.snap + channel: edge + on: + branch: master + tags: false + - provider: snap + skip_cleanup: true + snap: pkg/snap/*.snap + channel: edge,beta + on: + branch: master + tags: true + diff --git a/.travis/build-snap.sh b/.travis/build-snap.sh new file mode 100755 index 00000000..d824b383 --- /dev/null +++ b/.travis/build-snap.sh @@ -0,0 +1,15 @@ +#!/bin/sh -xe + +lp_data_dir="$HOME/.local/share/snapcraft/provider/launchpad" +lp_credentials="$lp_data_dir/credentials" + +mkdir -p "$lp_data_dir" +openssl aes-256-cbc -K $encrypted_c4bc81f026a2_key -iv $encrypted_c4bc81f026a2_iv \ + -in .travis/launchpad-credentials.enc \ + -out "$lp_credentials" -d +chmod 600 "$lp_credentials" + +./pkg/snap/build.sh remote-build \ + --launchpad-user solvespace \ + --launchpad-accept-public-upload \ + --build-on=amd64,arm64,armhf,i386 diff --git a/.travis/launchpad-credentials.enc b/.travis/launchpad-credentials.enc new file mode 100644 index 0000000000000000000000000000000000000000..5eba3cca8d33bb4a74b3ba3e16e2ba9386aed6af GIT binary patch literal 224 zcmV<603ZKgph6-3zoy0tXgIY!>i6M+dUZj*-`(E?wsYF>r!Bz8^PiU?4`vw|Q}>Z;pZ8$`R6EG`(BcE13d zh~XeM$}hlxwwL6)TL{i;WIzkkOi?;2=>tTznXKORAsBjGLMdj$%@Q+W413Zvex?me zZB6|=cmIC>y%bkY2?aB?;W7Ia&uE#hM1y^ST?Es&E!tbbfi?|+K>b$RcBNIOnt