uploadRelease
    :: ByteString
    -> ByteString
    -> ByteString
    -> ByteString
    -> [RawFilePath]
    -> IO (Either CreateFailure ())
uploadRelease token owner repo tagName paths = withSession $ \ s -> do
    r1 <- createRelease s token owner repo tagName
    case r1 >>= lookupField "upload_url" of
        Left err -> return $ Left err
        Right url -> fmap sequence_ <$> for paths $ \ path -> do
            r2 <- uploadAsset s token path url
            return $ case r2 ^. responseStatus . statusCode of
                201 -> Right ()
                401 -> Left AuthFail
                x   -> Left (CreateFailure x)
uploadRelease
    :: ByteString
    -> ByteString
    -> ByteString
    -> ByteString
    -> [RawFilePath]
    -> IO (Either CreateFailure ())
uploadRelease token owner repo tagName paths = withSession $ \ s -> do
    r1 <- createRelease s token owner repo tagName
    case r1 >>= lookupField "upload_url" of
        Left err -> return $ Left err
        Right url -> fmap sequence_ <$> for paths $ \ path -> do
            r2 <- uploadAsset s token path url
            return $ case r2 ^. responseStatus . statusCode of
                201 -> Right ()
                401 -> Left AuthFail
                x   -> Left (CreateFailure x)
uploadRelease token owner repo tagName paths = withSession $ \ s -> do
    r1 <- createRelease s token owner repo tagName
    case r1 >>= lookupField "upload_url" of
        Left err -> return $ Left err
        Right url -> fmap sequence_ <$> for paths $ \ path -> do
            r2 <- uploadAsset s token path url
            return $ case r2 ^. responseStatus . statusCode of
                201 -> Right ()
                401 -> Left AuthFail
                x   -> Left (CreateFailure x)