diff options
author | Johannes Lötzsch <git@johannesloetzsch.de> | 2021-02-24 21:48:14 +0100 |
---|---|---|
committer | Johannes Lötzsch <git@johannesloetzsch.de> | 2021-02-24 23:07:01 +0100 |
commit | e54471af8607e306f3da55fd3abd0f5295d6fac9 (patch) | |
tree | 90bad88bfd66edf9cf53bbf80f1e42fb836a7c79 /pkgs/development/tools/github | |
parent | 05f5a8dfad2137adb43bc4fc05f9a6dc4c705fa4 (diff) |
github-release: 0.7.2 -> 0.10.0
v0.7.2 was using a for security reasons deprecated api. The current version is using post instead of get requests to prevent the leakage of secrets.
Diffstat (limited to 'pkgs/development/tools/github')
-rw-r--r-- | pkgs/development/tools/github/github-release/default.nix | 47 |
1 files changed, 12 insertions, 35 deletions
diff --git a/pkgs/development/tools/github/github-release/default.nix b/pkgs/development/tools/github/github-release/default.nix index 81b125ac05858..4326d4bf71ca1 100644 --- a/pkgs/development/tools/github/github-release/default.nix +++ b/pkgs/development/tools/github/github-release/default.nix @@ -1,40 +1,17 @@ -{ lib, stdenv, system, fetchurl }: +{ buildGoPackage, fetchFromGitHub, lib }: -let - linuxPredicate = system == "x86_64-linux"; - bsdPredicate = system == "x86_64-freebsd"; - darwinPredicate = system == "x86_64-darwin"; - metadata = assert linuxPredicate || bsdPredicate || darwinPredicate; - if linuxPredicate then - { arch = "linux-amd64"; - sha256 = "0p0qj911nmmdj0r7wx3363gid8g4bm3my6mj3d6s4mwgh9lfisiz"; - archiveBinaryPath = "linux/amd64"; } - else if bsdPredicate then - { arch = "freebsd-amd64"; - sha256 = "0g618y9n39j11l1cbhyhwlbl2gv5a2a122c1dps3m2wmv7yzq5hk"; - archiveBinaryPath = "freebsd/amd64"; } - else - { arch = "darwin-amd64"; - sha256 = "0l623fgnsix0y3f960bwx3dgnrqaxs21w5652kvaaal7dhnlgmwj"; - archiveBinaryPath = "darwin/amd64"; }; -in stdenv.mkDerivation rec { - shortname = "github-release"; - name = "${shortname}-${version}"; - version = "0.7.2"; +buildGoPackage rec { + pname = "github-release"; + version = "0.10.0"; - src = fetchurl { - url = "https://github.com/aktau/github-release/releases/download/v${version}/${metadata.arch}-${shortname}.tar.bz2"; - sha256 = metadata.sha256; + src = fetchFromGitHub { + owner = "github-release"; + repo = "github-release"; + rev = "v${version}"; + sha256 = "sha256-J5Y0Kvon7DstTueCsoYvw6x4cOH/C1IaVArE0bXtZts="; }; - buildInputs = [ ]; - - phases = [ "unpackPhase" "installPhase" ]; - - installPhase = '' - mkdir -p "$out/bin" - cp "${metadata.archiveBinaryPath}/github-release" "$out/bin/" - ''; + goPackagePath = "github.com/github-release/github-release"; meta = with lib; { description = "Commandline app to create and edit releases on Github (and upload artifacts)"; @@ -45,8 +22,8 @@ in stdenv.mkDerivation rec { ''; license = licenses.mit; - homepage = "https://github.com/aktau/github-release"; - maintainers = with maintainers; [ ardumont ]; + homepage = "https://github.com/github-release/github-release"; + maintainers = with maintainers; [ ardumont j03 ]; platforms = with platforms; unix; }; } |