Add SNAP packaging to CI

This commit is contained in:
Federico Terzi 2020-02-29 19:42:33 +01:00
parent 75a210fd1e
commit 17fae78c8d
2 changed files with 43 additions and 0 deletions

View File

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

37
ci/build-snap.yml Normal file
View File

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