From f28fabda471457e92c6d670f25f721e992ade578 Mon Sep 17 00:00:00 2001 From: Federico Terzi Date: Mon, 2 Mar 2020 18:55:32 +0100 Subject: [PATCH] Remove SNAP from CI packaging as it has to be built on snapcraft servers --- .gitignore | 3 +- azure-pipelines.yml | 6 --- ci/build-snap.yml | 37 ------------------- packager.py | 21 ----------- .../snapcraft-template.yaml => snapcraft.yaml | 2 +- 5 files changed, 2 insertions(+), 67 deletions(-) delete mode 100644 ci/build-snap.yml rename packager/linux/snapcraft-template.yaml => snapcraft.yaml (96%) diff --git a/.gitignore b/.gitignore index e9ac133..f4ff355 100644 --- a/.gitignore +++ b/.gitignore @@ -35,5 +35,4 @@ DerivedData *.snap -venv/ -snapcraft.yaml \ No newline at end of file +venv/ \ No newline at end of file diff --git a/azure-pipelines.yml b/azure-pipelines.yml index d7827d9..70e8c3b 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -29,12 +29,6 @@ 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 deleted file mode 100644 index 96fae02..0000000 --- a/ci/build-snap.yml +++ /dev/null @@ -1,37 +0,0 @@ -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 diff --git a/packager.py b/packager.py index 8cf1726..b558e47 100644 --- a/packager.py +++ b/packager.py @@ -57,8 +57,6 @@ def build(skipcargo): build_windows(package_info) elif TARGET_OS == "macos": build_mac(package_info) - elif TARGET_OS == "linux": - build_snap(package_info) def build_windows(package_info): @@ -193,25 +191,6 @@ def build_mac(package_info): print("Done!") -def build_snap(package_info): - print("Starting packaging process for Snap package...") - - print("Rendering snapcraft template...") - with open("packager/linux/snapcraft-template.yaml", "r") as snapcraft_template: - content = snapcraft_template.read() - - # Replace variables - content = content.replace("{{{app_version}}}", package_info.version) - - with open("snapcraft.yaml", "w") as output_file: - output_file.write(content) - - print("Starting snapcraft packaging process...") - subprocess.run(["snapcraft"]) - - print("Done!") - - if __name__ == '__main__': print("[[ espanso packager ]]") diff --git a/packager/linux/snapcraft-template.yaml b/snapcraft.yaml similarity index 96% rename from packager/linux/snapcraft-template.yaml rename to snapcraft.yaml index b85e222..bd492b3 100644 --- a/packager/linux/snapcraft-template.yaml +++ b/snapcraft.yaml @@ -1,5 +1,5 @@ name: espanso -version: {{{app_version}}} +version: 0.5.1 summary: A Cross-platform Text Expander written in Rust description: | espanso is a Cross-platform, Text Expander written in Rust.