Generate snapcraft.yml on the fly to contain correct version

This commit is contained in:
Ben Gotow 2017-10-05 14:10:15 -07:00
parent 36fdd024f8
commit d02dd462d2
3 changed files with 7 additions and 3 deletions

1
.gitignore vendored
View file

@ -67,3 +67,4 @@ client_secret.json
/logfile.txt
/app/dist-docs
/app/mailsync.dSYM.zip
/snap/snapcraft.yml

View file

@ -93,6 +93,9 @@ cache:
- /tmp/mailsync-build-deps
after_success:
# Grab the version number from the .deb product and update the snapcraft.yml file
- sed "s/MAILSPRING_VERSION/$(grep -E -o '([0-9]+.[0-9]+.[0-9]+)' <<< "$(find app/dist -type f -name mailspring-*.deb)")/g" snap/snapcraft.template.yaml > snap/snapcraft.yml
# Decrypt the snapcraft login information
- openssl aes-256-cbc -K $encrypted_f8421d18d2b7_key -iv $encrypted_f8421d18d2b7_iv
-in .snapcraft/travis_snapcraft.cfg -out .snapcraft/snapcraft.cfg -d
@ -103,5 +106,5 @@ deploy:
'on':
branch: master
provider: script
script: docker run --env MAILSPRING_VERSION="$(grep -E -o '([0-9]+.[0-9]+.[0-9]+)' <<< "$(find app/dist -type f -name mailspring-*.deb)")" -v $(pwd):$(pwd) -t snapcore/snapcraft sh -c "apt update -qq && cd $(pwd) && snapcraft && snapcraft push *.snap --release edge"
script: docker run -v $(pwd):$(pwd) -t snapcore/snapcraft sh -c "apt update -qq && cd $(pwd) && snapcraft && snapcraft push *.snap --release edge"
skip_cleanup: true

View file

@ -1,5 +1,5 @@
name: mailspring
version: $MAILSPRING_VERSION
version: MAILSPRING_VERSION
summary: The best email app for people and teams at work
description: |
An extensible desktop mail app built on the modern web.
@ -9,7 +9,7 @@ confinement: strict
parts:
mailspring:
plugin: dump
source: ./app/dist/mailspring-$MAILSPRING_VERSION-amd64.deb
source: ./app/dist/mailspring-MAILSPRING_VERSION-amd64.deb
source-type: deb
# Correct path to icon.
prepare: |