nixpkgs/pkgs/development/tools/github/github-release/default.nix

53 lines
1.7 KiB
Nix
Raw Normal View History

2019-06-18 18:13:25 +01:00
{ stdenv, system, fetchurl }:
2015-09-07 18:35:21 +01:00
let
2019-06-18 18:13:25 +01:00
linuxPredicate = system == "x86_64-linux";
bsdPredicate = system == "x86_64-freebsd";
darwinPredicate = system == "x86_64-darwin";
2015-09-07 18:35:21 +01:00
metadata = assert linuxPredicate || bsdPredicate || darwinPredicate;
if linuxPredicate then
{ arch = "linux-amd64";
2019-06-18 18:13:25 +01:00
sha256 = "0p0qj911nmmdj0r7wx3363gid8g4bm3my6mj3d6s4mwgh9lfisiz";
2015-09-07 18:35:21 +01:00
archiveBinaryPath = "linux/amd64"; }
else if bsdPredicate then
{ arch = "freebsd-amd64";
2019-06-18 18:13:25 +01:00
sha256 = "0g618y9n39j11l1cbhyhwlbl2gv5a2a122c1dps3m2wmv7yzq5hk";
2015-09-07 18:35:21 +01:00
archiveBinaryPath = "freebsd/amd64"; }
else
{ arch = "darwin-amd64";
2019-06-18 18:13:25 +01:00
sha256 = "0l623fgnsix0y3f960bwx3dgnrqaxs21w5652kvaaal7dhnlgmwj";
2015-09-07 18:35:21 +01:00
archiveBinaryPath = "darwin/amd64"; };
in stdenv.mkDerivation rec {
shortname = "github-release";
name = "${shortname}-${version}";
2019-06-18 18:13:25 +01:00
version = "0.7.2";
2015-09-07 18:35:21 +01:00
src = fetchurl {
url = "https://github.com/aktau/github-release/releases/download/v${version}/${metadata.arch}-${shortname}.tar.bz2";
sha256 = metadata.sha256;
};
buildInputs = [ ];
phases = [ "unpackPhase" "installPhase" ];
installPhase = ''
mkdir -p "$out/bin"
cp "${metadata.archiveBinaryPath}/github-release" "$out/bin/"
'';
meta = with stdenv.lib; {
description = "Commandline app to create and edit releases on Github (and upload artifacts)";
longDescription = ''
A small commandline app written in Go that allows you to easily create and
delete releases of your projects on Github.
In addition it allows you to attach files to those releases.
'';
license = licenses.mit;
homepage = "https://github.com/aktau/github-release";
2015-09-07 18:35:21 +01:00
maintainers = with maintainers; [ ardumont ];
platforms = with platforms; unix;
2015-09-07 18:35:21 +01:00
};
}