Skip to content
This repository was archived by the owner on Sep 29, 2023. It is now read-only.

Commit d3031fc

Browse files
author
Jay Patel
committed
Minor Releasinator changes
1 parent 80dc4e4 commit d3031fc

File tree

1 file changed

+20
-5
lines changed

1 file changed

+20
-5
lines changed

.releasinator.rb

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,32 +15,47 @@ def validate_version_match()
1515
end
1616

1717
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)
2020
end
2121

2222
configatron.custom_validation_methods = [
2323
method(:validate_version_match),
2424
method(:validate_tests)
2525
]
2626

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
2828
def build_method
2929
end
3030

3131
# The command that builds the sdk. Required.
3232
configatron.build_method = method(:build_method)
3333

34+
# Creating and pushing a tag will automatically create a release, so it is just empty method
3435
def publish_to_package_manager(version)
35-
CommandProcessor.command("npm publish .")
3636
end
3737

3838
# The method that publishes the sdk to the package manager. Required.
3939
configatron.publish_to_package_manager_method = method(:publish_to_package_manager)
4040

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+
]
4157

4258
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")
4459
end
4560

4661
# The method that waits for the package manager to be done. Required

0 commit comments

Comments
 (0)