summary refs log tree commit diff
path: root/pkgs/development/tools/github/github-release/default.nix
blob: f7e95503d06318d378f90cc890d9d67c3e25efff (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
{ stdenv, fetchurl }:

let
  linuxPredicate = stdenv.system == "x86_64-linux";
  bsdPredicate = stdenv.system == "x86_64-freebsd";
  darwinPredicate = stdenv.system == "x86_64-darwin";
  metadata = assert linuxPredicate || bsdPredicate || darwinPredicate;
    if linuxPredicate then
      { arch = "linux-amd64";
        sha256 = "0b3h0d0qsrjx99kcd2cf71xijh44wm5rpm2sr54snh3f7macj2p1";
        archiveBinaryPath = "linux/amd64"; }
    else if bsdPredicate then
      { arch = "freebsd-amd64";
        sha256 = "1yydm4ndkh80phiwk41kcf6pizvwrfhsfk3jwrrgr42wsnkkgj0q";
        archiveBinaryPath = "freebsd/amd64"; }
    else
      { arch = "darwin-amd64";
        sha256 = "1dj74cf1ahihia2dr9ii9ky0cpmywn42z2iq1vkbrrcggjvyrnlf";
        archiveBinaryPath = "darwin/amd64"; };
in stdenv.mkDerivation rec {
  shortname = "github-release";
  name = "${shortname}-${version}";
  version = "0.6.2";

  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;
    maintainers = with maintainers; [ ardumont ];
  };
}