protected function uploadToGithub($version, $githubToken, $upload_url)
	{
		$deploy  = explode(' ', $this->getJConfig()->target);
		$zipfile = $this->getExtensionName() . '-' . $this->getJConfig()->version . '.zip';

		if (in_array('package', $deploy))
		{
			$zipfile = 'pkg-' . $zipfile;
		}

		$zipfilepath = JPATH_BASE . '/dist/' . $zipfile;

		$filesize = filesize($zipfilepath);

		$this->say('Uploading the Extension package to the Github release: ' . $version);

		$uploadUrl = str_replace("{?name,label}", "?access_token=" . $githubToken . "&name=" . $zipfile . "&size=" . $filesize, $upload_url);
		$request   = curl_init($uploadUrl);

		curl_setopt($request, CURLOPT_POST, true);
		curl_setopt($request, CURLOPT_VERBOSE, true);

		curl_setopt($request, CURLOPT_HTTPHEADER, array(
			'Authorization: token ' . $githubToken,
		));

		curl_setopt($request, CURLOPT_HTTPHEADER, array('Content-type: application/zip'));
		curl_setopt($request, CURLOPT_POSTFIELDS, file_get_contents($zipfilepath));
		curl_setopt($request, CURLOPT_SSL_VERIFYHOST, 0);
		curl_setopt($request, CURLOPT_SSL_VERIFYPEER, 0);

		$result = curl_exec($request);

		curl_close($request);

		$this->say(print_r($result, true));
	}
protected function uploadToGithub($version, $githubToken, $upload_url)
	{
		$deploy  = explode(' ', $this->getJConfig()->target);
		$zipfile = $this->getExtensionName() . '-' . $this->getJConfig()->version . '.zip';

		if (in_array('package', $deploy))
		{
			$zipfile = 'pkg-' . $zipfile;
		}

		$zipfilepath = JPATH_BASE . '/dist/' . $zipfile;

		$filesize = filesize($zipfilepath);

		$this->say('Uploading the Extension package to the Github release: ' . $version);

		$uploadUrl = str_replace("{?name,label}", "?access_token=" . $githubToken . "&name=" . $zipfile . "&size=" . $filesize, $upload_url);
		$request   = curl_init($uploadUrl);

		curl_setopt($request, CURLOPT_POST, true);
		curl_setopt($request, CURLOPT_VERBOSE, true);

		curl_setopt($request, CURLOPT_HTTPHEADER, array(
			'Authorization: token ' . $githubToken,
		));

		curl_setopt($request, CURLOPT_HTTPHEADER, array('Content-type: application/zip'));
		curl_setopt($request, CURLOPT_POSTFIELDS, file_get_contents($zipfilepath));
		curl_setopt($request, CURLOPT_SSL_VERIFYHOST, 0);
		curl_setopt($request, CURLOPT_SSL_VERIFYPEER, 0);

		$result = curl_exec($request);

		curl_close($request);

		$this->say(print_r($result, true));
	}
protected function uploadToGithub ( $ version , $ githubToken , $ upload_url ) { $ deploy = explode ( ' ' , $ this -> getJConfig ( ) -> target ) ; $ zipfile = $ this -> getExtensionName ( ) . '-' . $ this -> getJConfig ( ) -> version . '.zip' ; if ( in_array ( 'package' , $ deploy ) ) { $ zipfile = 'pkg-' . $ zipfile ; } $ zipfilepath = JPATH_BASE . '/dist/' . $ zipfile ; $ filesize = filesize ( $ zipfilepath ) ; $ this -> say ( 'Uploading the Extension package to the Github release: ' . $ version ) ; $ uploadUrl = str_replace ( "{?name,label}" , "?access_token=" . $ githubToken . "&name=" . $ zipfile . "&size=" . $ filesize , $ upload_url ) ; $ request = curl_init ( $ uploadUrl ) ; curl_setopt ( $ request , CURLOPT_POST , true ) ; curl_setopt ( $ request , CURLOPT_VERBOSE , true ) ; curl_setopt ( $ request , CURLOPT_HTTPHEADER , array ( 'Authorization: token ' . $ githubToken , ) ) ; curl_setopt ( $ request , CURLOPT_HTTPHEADER , array ( 'Content-type: application/zip' ) ) ; curl_setopt ( $ request , CURLOPT_POSTFIELDS , file_get_contents ( $ zipfilepath ) ) ; curl_setopt ( $ request , CURLOPT_SSL_VERIFYHOST , 0 ) ; curl_setopt ( $ request , CURLOPT_SSL_VERIFYPEER , 0 ) ; $ result = curl_exec ( $ request ) ; curl_close ( $ request ) ; $ this -> say ( print_r ( $ result , true ) ) ; }
Upload build Zip- or Packagefile to GitHub

@param   string $version     The release version
@param   string $githubToken The github access token
@param   string $upload_url  The upload URL

@return  void

@since   1.0
Upload build Zip - or Packagefile to GitHub