From 7e5cfe9e3b90f0102fbe28e0cadf0f4ba434e318 Mon Sep 17 00:00:00 2001 From: timvisee Date: Wed, 6 Mar 2019 16:43:21 +0100 Subject: [PATCH] Enable and fix snap package release job, mention snap package in README --- .gitlab-ci.yml | 48 +++++++++++++++++++++++++---------------- README.md | 7 ++++++ pkg/snap/snapcraft.yaml | 3 +-- 3 files changed, 37 insertions(+), 21 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index fb8474a..42e726e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -155,6 +155,35 @@ crate: - echo "Publishing crate to crates.io..." - cargo publish --verbose --allow-dirty +# Snap release +snap: + image: snapcore/snapcraft:edge + stage: release + only: + - /^v(\d+\.)*\d+$/ + before_script: [] + script: + # Prepare the environment + - apt-get update -y + - cd pkg/snap + + # Update version number in snapcraft.yml + - VERSION=$(echo $CI_COMMIT_REF_NAME | cut -c 2-) + - echo "Determined binary version number 'v$VERSION', updating snapcraft.yml..." + - sed "s/^version:.*\$/version: $VERSION/" -i snapcraft.yml + - sed "s/^pkgver=.*\$/pkgver=$VERSION/" -i snapcraft.yml + + # Build the package + - echo "Building snap package..." + - snapcraft + + # TODO: test snap package + + # Publish snap package + - echo "Publishing snap package..." + - echo "$SNAP_MAIL\n&SNAP_PASSWORD" | snapcraft login + - snapcraft push --release=stable ffsend_*_amd64.snap + # Publish release binaries to as GitHub release github-release: stage: release @@ -255,23 +284,4 @@ package-aur: # - export VERSION=$(echo $CI_COMMIT_REF_NAME | cut -c 2-) # - 'curl -L -H "Content-Type: application/json" -H "Authorization: Bearer $APPVEYOR_TOKEN" -d "{\"accountName\":\"timvisee\",\"projectSlug\":\"ffsend\",\"tag\":\"$CI_COMMIT_REF_NAME\",\"environmentVariables\":{\"FFSEND_VERSION\":\"$VERSION\"}}" https://ci.appveyor.com/api/builds' -# # Snap release -# snap: -# image: snapcore/snapcraft:edge -# stage: release -# # only: -# # - /^v(\d+\.)*\d+$/ -# before_script: [] -# script: -# - echo "Building snap package..." -# - cd pkg/snap -# - snapcraft -# # TODO: See: https://docs.snapcraft.io/rust-applications/7826 -# # TODO: - login to registry -# # TODO: - test built snap -# # TODO: - push snap to snapcraft.io -# # - echo "Publishing snap package..." -# # - echo "$SNAP_USER\n&SNAP_PASS" | snapcraft login -# # - snapcraft push --release=edge ffsend_amd64.snap - # TODO: add job to test ffsend{-git} AUR packages diff --git a/README.md b/README.md index da2a9ea..f26cb87 100644 --- a/README.md +++ b/README.md @@ -152,6 +152,12 @@ available right now. It is recommended to build and install `ffsend` yourself using these fairly easy steps [below](#build). +#### Snap package +[» `ffsend`][snapcraft-ffsend] +```bash +snap install ffsend +``` + #### Arch AUR package [» `ffsend`][aur-ffsend] (binary package) [» `ffsend-git`][aur-ffsend-git] (compile from source package) @@ -433,3 +439,4 @@ Check out the [LICENSE](LICENSE) file for more information. [github-latest-release]: https://github.com/timvisee/ffsend/releases/latest [aur-ffsend]: https://aur.archlinux.org/packages/ffsend/ [aur-ffsend-git]: https://aur.archlinux.org/packages/ffsend-git/ +[snapcraft-ffsend]: https://snapcraft.io/ffsend diff --git a/pkg/snap/snapcraft.yaml b/pkg/snap/snapcraft.yaml index 37e5022..46bfb76 100644 --- a/pkg/snap/snapcraft.yaml +++ b/pkg/snap/snapcraft.yaml @@ -27,6 +27,5 @@ parts: source: ../../ plugin: rust build-attributes: [no-system-libraries] - build-packages: [make, cmake, pkg-config] - # build-packages: [g++, libudev-dev, libssl-dev, make, pkg-config] + build-packages: [make, cmake, pkg-config, libssl-dev] stage-packages: [libssl1.0.0, xclip]