mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-03 15:24:34 -04:00
Change self host releases from zip to tar
This commit is contained in:
parent
7f951b94ef
commit
704f9ff9c5
5
.github/workflows/release.yml
vendored
5
.github/workflows/release.yml
vendored
@ -65,8 +65,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Build project
|
- name: Build project
|
||||||
run: |
|
run: |
|
||||||
zip -r ./invoiceninja.zip .* -x "../*"
|
tar --exclude='../*' --exclude='.htaccess' -zcvf ./invoiceninja.tar .*
|
||||||
|
|
||||||
- name: Release
|
- name: Release
|
||||||
uses: softprops/action-gh-release@v1
|
uses: softprops/action-gh-release@v1
|
||||||
if: startsWith(github.ref, 'refs/tags/')
|
if: startsWith(github.ref, 'refs/tags/')
|
||||||
@ -74,4 +73,4 @@ jobs:
|
|||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
with:
|
with:
|
||||||
files: |
|
files: |
|
||||||
invoiceninja.zip
|
invoiceninja.tar
|
||||||
|
@ -39,35 +39,6 @@ class SelfUpdateController extends BaseController
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @OA\Post(
|
|
||||||
* path="/api/v1/self-update",
|
|
||||||
* operationId="selfUpdate",
|
|
||||||
* tags={"update"},
|
|
||||||
* summary="Performs a system update",
|
|
||||||
* description="Performs a system update",
|
|
||||||
* @OA\Parameter(ref="#/components/parameters/X-API-TOKEN"),
|
|
||||||
* @OA\Parameter(ref="#/components/parameters/X-API-PASSWORD"),
|
|
||||||
* @OA\Parameter(ref="#/components/parameters/X-Requested-With"),
|
|
||||||
* @OA\Parameter(ref="#/components/parameters/include"),
|
|
||||||
* @OA\Response(
|
|
||||||
* response=200,
|
|
||||||
* description="Success/failure response"
|
|
||||||
* ),
|
|
||||||
* @OA\Response(
|
|
||||||
* response=422,
|
|
||||||
* description="Validation error",
|
|
||||||
* @OA\JsonContent(ref="#/components/schemas/ValidationError"),
|
|
||||||
*
|
|
||||||
* ),
|
|
||||||
* @OA\Response(
|
|
||||||
* response="default",
|
|
||||||
* description="Unexpected Error",
|
|
||||||
* @OA\JsonContent(ref="#/components/schemas/Error"),
|
|
||||||
* ),
|
|
||||||
* )
|
|
||||||
*/
|
|
||||||
|
|
||||||
public function update()
|
public function update()
|
||||||
{
|
{
|
||||||
set_time_limit(0);
|
set_time_limit(0);
|
||||||
@ -87,7 +58,8 @@ class SelfUpdateController extends BaseController
|
|||||||
|
|
||||||
nlog('copying release file');
|
nlog('copying release file');
|
||||||
|
|
||||||
if (copy($this->getDownloadUrl(), storage_path('app/invoiceninja.zip'))) {
|
// if (copy($this->getDownloadUrl(), storage_path('app/invoiceninja.zip'))) {
|
||||||
|
if (copy($this->getDownloadUrl(), storage_path('app/invoiceninja.tar'))) {
|
||||||
nlog('Copied file from URL');
|
nlog('Copied file from URL');
|
||||||
} else {
|
} else {
|
||||||
return response()->json(['message' => 'Download not yet available. Please try again shortly.'], 410);
|
return response()->json(['message' => 'Download not yet available. Please try again shortly.'], 410);
|
||||||
@ -95,24 +67,22 @@ class SelfUpdateController extends BaseController
|
|||||||
|
|
||||||
nlog('Finished copying');
|
nlog('Finished copying');
|
||||||
|
|
||||||
$file = Storage::disk('local')->path('invoiceninja.zip');
|
// $file = Storage::disk('local')->path('invoiceninja.zip');
|
||||||
|
$file = Storage::disk('local')->path('invoiceninja.tar');
|
||||||
|
|
||||||
nlog('Extracting zip');
|
nlog('Extracting zip');
|
||||||
|
|
||||||
$zipFile = new \PhpZip\ZipFile();
|
// $zipFile = new \PhpZip\ZipFile();
|
||||||
|
// $zipFile->openFile($file);
|
||||||
$zipFile->openFile($file);
|
// $zipFile->deleteFromName(".htaccess");
|
||||||
|
// $zipFile->rewrite();
|
||||||
$zipFile->deleteFromName(".htaccess");
|
// $zipFile->extractTo(base_path());
|
||||||
|
// $zipFile->close();
|
||||||
|
// $zipFile = null;
|
||||||
|
|
||||||
$zipFile->rewrite();
|
$phar = new \PharData($file);
|
||||||
|
$phar->extractTo(base_path());
|
||||||
|
|
||||||
$zipFile->extractTo(base_path());
|
|
||||||
|
|
||||||
$zipFile->close();
|
|
||||||
|
|
||||||
$zipFile = null;
|
|
||||||
|
|
||||||
nlog('Finished extracting files');
|
nlog('Finished extracting files');
|
||||||
|
|
||||||
unlink($file);
|
unlink($file);
|
||||||
@ -218,6 +188,7 @@ class SelfUpdateController extends BaseController
|
|||||||
{
|
{
|
||||||
$version = $this->checkVersion();
|
$version = $this->checkVersion();
|
||||||
|
|
||||||
|
return "https://github.com/invoiceninja/invoiceninja/releases/download/v{$version}/invoiceninja.tar";
|
||||||
return "https://github.com/invoiceninja/invoiceninja/releases/download/v{$version}/invoiceninja.zip";
|
return "https://github.com/invoiceninja/invoiceninja/releases/download/v{$version}/invoiceninja.zip";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user