diff --git a/.gitignore b/.gitignore index 5a1ca4cc6..541ff7c46 100644 --- a/.gitignore +++ b/.gitignore @@ -67,3 +67,4 @@ client_secret.json /logfile.txt /app/dist-docs /app/mailsync.dSYM.zip +/snap/snapcraft.yml diff --git a/.travis.yml b/.travis.yml index e1cefef83..111d6c69d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 diff --git a/snap/snapcraft.yaml b/snap/snapcraft.template.yaml similarity index 93% rename from snap/snapcraft.yaml rename to snap/snapcraft.template.yaml index aefcf3ac1..6ec3eda41 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.template.yaml @@ -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: |