github-release 1.2.5 → 1.2.6
raw patch · 3 files changed
+17/−18 lines, 3 filesdep +burritodep −uri-templaterdep ~base
Dependencies added: burrito
Dependencies removed: uri-templater
Dependency ranges changed: base
Files
- LICENSE.markdown +1/−1
- github-release.cabal +7/−7
- library/GitHubRelease.hs +9/−10
LICENSE.markdown view
@@ -1,6 +1,6 @@ MIT License -Copyright (c) 2018 Taylor Fausak+Copyright (c) 2020 Taylor Fausak Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal
github-release.cabal view
@@ -1,13 +1,13 @@ cabal-version: 1.12 --- This file has been generated from package.yaml by hpack version 0.31.0.+-- This file has been generated from package.yaml by hpack version 0.33.0. -- -- see: https://github.com/sol/hpack ----- hash: 9419b8e057b343f1468d097cc2d93fc73794949eb759490d2066954ca1d9bd50+-- hash: 0c4d86aac76bfa8e5e35f0952319b765c787a2aec5166991188b5a9b96e9d189 name: github-release-version: 1.2.5+version: 1.2.6 synopsis: Upload files to GitHub releases. description: GitHub Release uploads files to GitHub releases. category: Utility@@ -32,7 +32,8 @@ ghc-options: -Weverything -Wno-implicit-prelude -Wno-safe -Wno-unsafe build-depends: aeson >=0.11.2 && <0.12 || >=1.0.2 && <1.5- , base >=4.9.0 && <4.14+ , base >=4.9.0 && <4.15+ , burrito >=1.0.0 && <1.1 , bytestring >=0.10.8 && <0.11 , http-client >=0.4.31 && <0.7 , http-client-tls >=0.2.4 && <0.4@@ -41,7 +42,6 @@ , optparse-generic >=1.1.1 && <1.4 , text >=1.2.2 && <1.3 , unordered-containers >=0.2.7 && <0.3- , uri-templater >=0.2.1 && <0.4 if impl(ghc >= 8.4) ghc-options: -Wno-partial-fields if impl(ghc >= 8.8.1)@@ -57,7 +57,8 @@ ghc-options: -Weverything -Wno-implicit-prelude -Wno-safe -Wno-unsafe -rtsopts -threaded build-depends: aeson >=0.11.2 && <0.12 || >=1.0.2 && <1.5- , base >=4.9.0 && <4.14+ , base >=4.9.0 && <4.15+ , burrito >=1.0.0 && <1.1 , bytestring >=0.10.8 && <0.11 , github-release , http-client >=0.4.31 && <0.7@@ -67,7 +68,6 @@ , optparse-generic >=1.1.1 && <1.4 , text >=1.2.2 && <1.3 , unordered-containers >=0.2.7 && <0.3- , uri-templater >=0.2.1 && <0.4 if impl(ghc >= 8.4) ghc-options: -Wno-partial-fields if impl(ghc >= 8.8.1)
library/GitHubRelease.hs view
@@ -21,6 +21,7 @@ import Options.Generic (type (<?>)) +import qualified Burrito import Data.Aeson (object, (.=)) import qualified Data.Aeson as Aeson import qualified Data.ByteString.Char8 as BS8@@ -33,8 +34,6 @@ import qualified Network.HTTP.Client.TLS as TLS import qualified Network.HTTP.Types as HTTP import qualified Network.Mime as MIME-import qualified Network.URI.Template as Template-import qualified Network.URI.Template.Types as Template import qualified Options.Generic as Options import qualified Paths_github_release as This import qualified System.IO as IO@@ -119,7 +118,7 @@ -> Maybe String -> String -> String- -> IO Template.UriTemplate+ -> IO Burrito.Template getUploadUrl manager aToken anOwner aRepo aTag = do json <- do result <- getTag manager aToken anOwner aRepo aTag@@ -130,9 +129,9 @@ Just (Aeson.String text) -> pure text _ -> fail ("Failed to get upload URL: " ++ show json) let uploadUrl = Text.unpack text- template <- case Template.parseTemplate uploadUrl of- Left problem -> fail ("Failed to parse URL template: " ++ show problem)- Right template -> pure template+ template <- case Burrito.parse uploadUrl of+ Nothing -> fail ("Failed to parse URL template: " ++ show uploadUrl)+ Just template -> pure template pure template getOwnerRepo :: Maybe String -> String -> IO ((String, String))@@ -184,7 +183,7 @@ uploadFile :: Client.Manager- -> Template.UriTemplate+ -> Burrito.Template -> String -> FilePath -> String@@ -196,7 +195,7 @@ uploadBody :: Client.Manager- -> Template.UriTemplate+ -> Burrito.Template -> String -> Client.RequestBody -> String@@ -204,9 +203,9 @@ uploadBody manager template aToken body aName = do let url :: String- url = Template.render+ url = Burrito.expand+ [("name", Burrito.stringValue aName)] template- [("name", Template.WrappedValue (Template.Single aName))] initialRequest <- Client.parseRequest url let request = initialRequest