def upload(*args)
      arguments(args, required: [:owner, :repo, :id, :filepath]) do
        permit VALID_ASSET_PARAM_NAMES
      end
      params = arguments.params

      unless type = params['content_type']
        type = infer_media(arguments.filepath)
      end

      file = Faraday::UploadIO.new(arguments.filepath, type)
      options = {
        headers: { content_type: type },
        endpoint: upload_endpoint,
        query: {'name' => params['name']}
      }
      params['data']    = file.read
      params['options'] = options

      post_request("/repos/#{arguments.owner}/#{arguments.repo}/releases/#{arguments.id}/assets", params)
    ensure
      file.close if file
    end
def upload(*args)
      arguments(args, required: [:owner, :repo, :id, :filepath]) do
        permit VALID_ASSET_PARAM_NAMES
      end
      params = arguments.params

      unless type = params['content_type']
        type = infer_media(arguments.filepath)
      end

      file = Faraday::UploadIO.new(arguments.filepath, type)
      options = {
        headers: { content_type: type },
        endpoint: upload_endpoint,
        query: {'name' => params['name']}
      }
      params['data']    = file.read
      params['options'] = options

      post_request("/repos/#{arguments.owner}/#{arguments.repo}/releases/#{arguments.id}/assets", params)
    ensure
      file.close if file
    end
Upload a release asset

 @param [Hash] params
 @input params [String] :name
   Required string. The file name of the asset
 @input params [String] :content_type
   Required string. The content type of the asset.
   Example: “application/zip”.

 @example
   github = Github.new
   github.repos.releases.assets.upload 'owner', 'repo', 'id', 'file-path'
     name: "batman.jpg",
     content_type: "application/octet-stream"

 @api public