snap: Build snaps on Travis without remote-build & drop i386 + armhf

Snapcraft's remote-build does not fit the requirements of CI,
so replace it with builds running directly on Travis:

1. Builds on Travis can run independently, whereas remote-build
competes for the same resource (Launchpad) and will potentially
block if multiple commits require building in succession.
2. Snapcrafts CLI for remote-build is not designed to be easily
scriptable.
3. Travis recently introduced building on arm64, so builds for
arm64 are now very fast and don't require emulation.

We do not build for armhf and i386 any more because they are
of little relevance on the desktop.
pull/548/head
Maximilian Federle 2020-02-08 15:42:01 +01:00 committed by whitequark
parent 3ed1719de2
commit 65ab59503a
3 changed files with 12 additions and 19 deletions

View File

@ -25,14 +25,16 @@ jobs:
on: on:
repo: solvespace/solvespace repo: solvespace/solvespace
tags: true tags: true
- stage: deploy - &deploy-snap
name: "Snap" stage: deploy
name: Snap amd64
os: linux os: linux
arch: amd64
dist: bionic dist: bionic
addons: addons:
snaps: snaps:
- name: snapcraft - name: snapcraft
confinement: classic confinement: classic
script: ./.travis/build-snap.sh script: ./.travis/build-snap.sh
deploy: deploy:
- provider: script - provider: script
@ -47,4 +49,6 @@ jobs:
on: on:
branch: master branch: master
tags: true tags: true
- <<: *deploy-snap
name: Snap arm64
arch: arm64

View File

@ -1,15 +1,4 @@
#!/bin/sh -xe #!/bin/sh -xe
lp_data_dir="$HOME/.local/share/snapcraft/provider/launchpad" sudo apt-get update
lp_credentials="$lp_data_dir/credentials" sudo ./pkg/snap/build.sh --destructive-mode
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.