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.
pull/543/head
Maximilian Federle 2019-11-23 21:45:32 +01:00 committed by whitequark
parent 16c5fa6889
commit d5351c48e3
3 changed files with 40 additions and 0 deletions

View File

@ -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

15
.travis/build-snap.sh Executable file
View File

@ -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

Binary file not shown.