github-release 1.1.5 → 1.1.6
raw patch · 5 files changed
+59/−30 lines, 5 filesdep ~aesondep ~basedep ~bytestringsetup-changedPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: aeson, base, bytestring, http-client, http-types, mime-types, optparse-generic, unordered-containers, uri-templater
API changes (from Hackage documentation)
Files
- Setup.hs +2/−2
- executables/Main.hs +5/−0
- executables/github-release.hs +0/−5
- github-release.cabal +29/−15
- library/GitHubRelease.hs +23/−8
Setup.hs view
@@ -1,4 +1,4 @@-import qualified Distribution.Simple+import qualified Distribution.Simple as Cabal main :: IO ()-main = Distribution.Simple.defaultMain+main = Cabal.defaultMain
+ executables/Main.hs view
@@ -0,0 +1,5 @@+module Main+ ( module GitHubRelease+ ) where++import GitHubRelease (main)
− executables/github-release.hs
@@ -1,5 +0,0 @@-module Main- ( module GitHubRelease- ) where--import GitHubRelease (main)
github-release.cabal view
@@ -2,10 +2,10 @@ -- -- see: https://github.com/sol/hpack ----- hash: cdab9d5c85ce5685e7b141f22bf3ab59ea223f39771b6b87775a1e68cffd463f+-- hash: 6c10f0a19692a85cbc12e772a291d66576e1848c8286945cb0d5bd86884dc3e4 name: github-release-version: 1.1.5+version: 1.1.6 synopsis: Upload files to GitHub releases. description: GitHub Release uploads files to GitHub releases. category: Utility@@ -24,19 +24,21 @@ library hs-source-dirs: library- ghc-options: -Wall+ ghc-options: -Weverything -Wno-implicit-prelude -Wno-safe -Wno-unsafe build-depends:- aeson >=0.9 && <1.4- , base >=4.8.2 && <4.11- , bytestring >=0.10.6 && <0.11- , http-client >=0.4.30 && <0.6+ aeson >=0.11.2 && <0.12 || >=1.0.2 && <1.3+ , base >=4.9.0 && <4.12+ , bytestring >=0.10.8 && <0.11+ , http-client >=0.4.31 && <0.6 , http-client-tls >=0.2.4 && <0.4- , http-types >=0.9 && <0.13- , mime-types >=0.1 && <0.2- , optparse-generic >=1.1 && <1.4+ , http-types >=0.9.1 && <0.13+ , mime-types >=0.1.0 && <0.2+ , optparse-generic >=1.1.1 && <1.4 , text >=1.2.2 && <1.3- , unordered-containers >=0.2.5 && <0.3- , uri-templater >=0.2 && <0.4+ , unordered-containers >=0.2.7 && <0.3+ , uri-templater >=0.2.1 && <0.4+ if impl(ghc >= 8.4)+ ghc-options: -Wno-partial-fields exposed-modules: GitHubRelease other-modules:@@ -44,13 +46,25 @@ default-language: Haskell2010 executable github-release- main-is: github-release.hs+ main-is: Main.hs hs-source-dirs: executables- ghc-options: -Wall -rtsopts -threaded -with-rtsopts=-N+ ghc-options: -Weverything -Wno-implicit-prelude -Wno-safe -Wno-unsafe -rtsopts -threaded build-depends:- base >=4.8.2 && <4.11+ aeson >=0.11.2 && <0.12 || >=1.0.2 && <1.3+ , base >=4.9.0 && <4.12+ , bytestring >=0.10.8 && <0.11 , github-release+ , http-client >=0.4.31 && <0.6+ , http-client-tls >=0.2.4 && <0.4+ , http-types >=0.9.1 && <0.13+ , mime-types >=0.1.0 && <0.2+ , 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 other-modules: Paths_github_release default-language: Haskell2010
library/GitHubRelease.hs view
@@ -3,7 +3,20 @@ {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeOperators #-} -module GitHubRelease where+module GitHubRelease+ ( Command(..)+ , main+ , runCommand+ , upload+ , getUploadUrl+ , getTag+ , authorizationHeader+ , userAgentHeader+ , userAgent+ , versionString+ , uploadFile+ , uploadBody+ ) where import Options.Generic (type (<?>)) @@ -104,15 +117,16 @@ Just _ -> IO.hPutStrLn IO.stderr "Ignoring --owner option." pure (anOwner, drop 1 aRepo) let format = "https://api.github.com/repos/%s/%s/releases/tags/%s"- let url = Printf.printf format anOwner aRepo aTag+ let+ url :: String+ url = Printf.printf format anOwner aRepo aTag initialRequest <- Client.parseRequest url let request = initialRequest {Client.requestHeaders = [authorizationHeader aToken, userAgentHeader]} response <- Client.httpLbs request manager let body = Client.responseBody response- let json = Aeson.eitherDecode body- return json+ return (Aeson.eitherDecode body) authorizationHeader :: String -> HTTP.Header authorizationHeader aToken =@@ -147,10 +161,11 @@ -> String -> IO (Client.Response BSL.ByteString) uploadBody manager template aToken body aName = do- let url =- Template.render- template- [("name", Template.WrappedValue (Template.Single aName))]+ let+ url :: String+ url = Template.render+ template+ [("name", Template.WrappedValue (Template.Single aName))] initialRequest <- Client.parseRequest url let request = initialRequest