From 17fae78c8d539285168434ce360e3866af67d01a Mon Sep 17 00:00:00 2001 From: Federico Terzi Date: Sat, 29 Feb 2020 19:42:33 +0100 Subject: [PATCH] Add SNAP packaging to CI --- azure-pipelines.yml | 6 ++++++ ci/build-snap.yml | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 ci/build-snap.yml diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 70e8c3b..d7827d9 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -29,6 +29,12 @@ jobs: displayName: Setting up docker - template: ci/deploy.yml + - job: UbuntuSNAP + pool: + vmImage: 'ubuntu-latest' + steps: + - template: ci/build-snap.yml + - job: macOS pool: vmImage: 'macOS-10.14' diff --git a/ci/build-snap.yml b/ci/build-snap.yml new file mode 100644 index 0000000..96fae02 --- /dev/null +++ b/ci/build-snap.yml @@ -0,0 +1,37 @@ +steps: + - task: UsePythonVersion@0 + inputs: + versionSpec: '3.7' + addToPath: true + + - script: | + python --version + python -m pip install toml click + displayName: Installing python dependencies + + - script: | + sudo snap install snapcraft + displayName: Setting up snapcraft + + - script: | + set -e + python packager.py build --skipcargo + displayName: "Building the SNAP" + + - task: DownloadSecureFile@1 + name: snapcraftlogin + displayName: "Downloading snapcraft login" + inputs: + secureFile: snapcraft.login + + - script: | + set -e + mkdir .snapcraft + cp $(snapcraftlogin.secureFilePath) .snapcraft/snapcraft.cfg + displayName: "Installing SNAP credentials" + + - script: | + set -e + test -f *.snap + snapcraft push espanso*.snap --release stable + displayName: "Publishing snap to the store" \ No newline at end of file