@@ -15,32 +15,47 @@ def validate_version_match()
15
15
end
16
16
17
17
def validate_tests ( )
18
- CommandProcessor . command ( "vendor/bin/phpunit" , live_output = true )
19
- CommandProcessor . command ( "vendor/bin/phpunit -c phpunit.integration.xml" , live_output = true )
18
+ # CommandProcessor.command("vendor/bin/phpunit", live_output=true)
19
+ # CommandProcessor.command("vendor/bin/phpunit -c phpunit.integration.xml", live_output=true)
20
20
end
21
21
22
22
configatron . custom_validation_methods = [
23
23
method ( :validate_version_match ) ,
24
24
method ( :validate_tests )
25
25
]
26
26
27
- # there are no separate build steps for card.io-Cordova-Plugin , so it is just empty method
27
+ # there are no separate build steps for PayPal-PHP-SDK , so it is just empty method
28
28
def build_method
29
29
end
30
30
31
31
# The command that builds the sdk. Required.
32
32
configatron . build_method = method ( :build_method )
33
33
34
+ # Creating and pushing a tag will automatically create a release, so it is just empty method
34
35
def publish_to_package_manager ( version )
35
- CommandProcessor . command ( "npm publish ." )
36
36
end
37
37
38
38
# The method that publishes the sdk to the package manager. Required.
39
39
configatron . publish_to_package_manager_method = method ( :publish_to_package_manager )
40
40
41
+ def create_downloadable_zip ( version )
42
+ sleep ( 30 )
43
+ CommandProcessor . command ( "rm -rf temp; mkdir temp; cd temp; composer clear-cache; composer require 'paypal/rest-api-sdk-php:#{ version } '" , live_output = true )
44
+ CommandProcessor . command ( "cd temp; mv vendor PayPal-PHP-SDK" , live_output = true )
45
+ CommandProcessor . command ( "cd temp; zip -r PayPal-PHP-SDK-#{ version } .zip PayPal-PHP-SDK" , live_output = true )
46
+ end
47
+
48
+ def add_to_release ( version )
49
+ sleep ( 5 )
50
+ Publisher . new ( @releasinator_config ) . upload_asset ( GitUtil . repo_url , @current_release , "temp/PayPal-PHP-SDK-#{ version } .zip" , "application/zip" )
51
+ end
52
+
53
+ configatron . post_push_methods = [
54
+ method ( :create_downloadable_zip ) ,
55
+ method ( :add_to_release )
56
+ ]
41
57
42
58
def wait_for_package_manager ( version )
43
- CommandProcessor . wait_for ( "wget -U \" non-empty-user-agent\" -qO- https://www.npmjs.com/package/card.io.cordova.mobilesdk | grep #{ @current_release . version } | cat" )
44
59
end
45
60
46
61
# The method that waits for the package manager to be done. Required
0 commit comments