-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c9d9ce9
commit 878d2d2
Showing
6 changed files
with
62 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
/build/artifacts/ | ||
/build/stage-1/ | ||
/build/stage-2/ | ||
/build/svn/ | ||
|
||
# Composer | ||
/vendor/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
|
||
function escape_sequence( $code ) { | ||
return "\e[" . $code . 'm'; | ||
} | ||
|
||
function format_command( $value ) { | ||
return escape_sequence( '36' ) . $value . escape_sequence( '0' ); | ||
} | ||
|
||
function format_error( $value ) { | ||
return escape_sequence( '31' ) . escape_sequence( '1' ) . 'Error:' . escape_sequence( '0' ) . ' ' . $value; | ||
} | ||
|
||
function run_command( $command, $expected_result_code = 0 ) { | ||
echo format_command( $command ), PHP_EOL; | ||
|
||
passthru( $command, $result_code ); | ||
|
||
if ( null !== $expected_result_code && $expected_result_code !== $result_code ) { | ||
exit( $result_code ); | ||
} | ||
|
||
return $result_code; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
|
||
require_once __DIR__ . '/functions.php'; | ||
|
||
$slug = 'pronamic-pay-with-rabo-smart-pay-for-woocommerce'; | ||
$version = '1.0.0'; | ||
|
||
$zip_file_path = realpath( __DIR__ . "/../artifacts/$slug.$version.zip" ); | ||
|
||
run_command( "gh release create v$version --title $version $zip_file_path" ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
|
||
require_once __DIR__ . '/functions.php'; | ||
|
||
$slug = 'pronamic-pay-with-rabo-smart-pay-for-woocommerce'; | ||
$version = '1.0.0'; | ||
|
||
$gcloud_bucket_name = 'gs://wp.pronamic.download/plugins/' . $slug; | ||
|
||
$zip_filename_version = "$slug.$version.zip"; | ||
|
||
$zip_filename = "$slug.zip"; | ||
|
||
$zip_file_path = realpath( __DIR__ . '/../artifacts/' . $zip_filename_version ); | ||
|
||
run_command( "gcloud storage cp $zip_file_path $gcloud_bucket_name/$zip_file_path" ); | ||
|
||
run_command( "gcloud storage cp $gcloud_bucket_name/$zip_file_path $gcloud_bucket_name/$zip_filename" ); | ||
|
||
$pronamic_url = 'https://wp.pronamic.directory/wp-json/pronamic-wp-extensions/v1/plugins/' . $slug; | ||
|
||
run_command( "curl --netrc --data version=$version --request PATCH $pronamic_url" ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters