diff --git a/.github/workflows/test-snap-can-build.yml b/.github/workflows/test-snap-can-build.yml index f0ea298ca8..3e6d948af8 100644 --- a/.github/workflows/test-snap-can-build.yml +++ b/.github/workflows/test-snap-can-build.yml @@ -1,4 +1,4 @@ -name: 🧪 Test snap can be built on x86_64 +name: 🧪 Snap Builds on: push: diff --git a/README.md b/README.md index 3670cede53..4b3032717e 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,18 @@ webpage for a list of **[All Supported Installations](https://fpm.fortran-lang.o The easiest installation routes are shown below. +### [Snap](https://snapcraft.io/fortran-fpm) + +[![fortran-fpm](https://snapcraft.io/fortran-fpm/badge.svg)](https://snapcraft.io/fortran-fpm) + +[![🧪 Snap Builds](https://github.com/kz6fittycent/fpm/actions/workflows/test-snap-can-build.yml/badge.svg?branch=main)](https://github.com/kz6fittycent/fpm/actions/workflows/test-snap-can-build.yml) + +**Note:** Linux only + +``` +sudo snap install fortran-fpm +``` + ### [Binary](https://github.com/fortran-lang/fpm/releases) Binaries for the latest stable release are available [to download](https://github.com/fortran-lang/fpm/releases/latest) for Windows, MacOS, and Linux. diff --git a/snap/local/fpm.png b/snap/local/fpm.png new file mode 100644 index 0000000000..1ab82e3923 Binary files /dev/null and b/snap/local/fpm.png differ diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index 3c06ea7d40..742698c3fc 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -26,14 +26,20 @@ description: | Website: https://fpm.fortran-lang.org/ license: MIT +source-code: https://github.com/fortran-lang/fpm +issues: https://github.com/kz6fittycent/fpm/issues +contact: https://github.com/kz6fittycent/fpm +icon: snap/local/fpm.png -base: core20 +base: core24 grade: stable confinement: strict compression: lzo -architectures: - - build-on: amd64 +platforms: + amd64: + build-on: [amd64] + build-for: [amd64] apps: fortran-fpm: @@ -56,12 +62,12 @@ parts: LATEST=$(curl -s https://api.github.com/repos/fortran-lang/fpm/releases/latest | grep '"tag_name":' | cut -d ":" -f2 | sed -E 's/.*"([^"]+)".*/\1/' | sed -E 's/^v//') ################################ - mkdir -p $SNAPCRAFT_PART_INSTALL/usr/bin/ - cd $SNAPCRAFT_PART_INSTALL/usr/bin/ + mkdir -p $CRAFT_PART_INSTALL/usr/bin/ + cd $CRAFT_PART_INSTALL/usr/bin/ wget -O fpm "https://github.com/fortran-lang/fpm/releases/download/v${LATEST}/fpm-${LATEST}-linux-x86_64" chmod a+x fpm override-pull: | - snapcraftctl pull - snapcraftctl set-version "$(curl -s https://api.github.com/repos/fortran-lang/fpm/releases/latest | grep '"tag_name":' | cut -d ":" -f2 | sed -E 's/.*"([^"]+)".*/\1/' | sed -E 's/^v//')" + craftctl default + craftctl set version="$(curl -s https://api.github.com/repos/fortran-lang/fpm/releases/latest | grep '"tag_name":' | cut -d ":" -f2 | sed -E 's/.*"([^"]+)".*/\1/' | sed -E 's/^v//')"