|
27 | 27 | die(); |
28 | 28 | } |
29 | 29 |
|
30 | | - $deploy = $api->Api('plugins/'.$_ENV['PLUGIN_SLUG'].'/tags.json', 'GET', array( |
31 | | - 'plugin_id' => $_ENV['PLUGIN_ID'] |
32 | | - )); |
| 30 | + $deploy = $api->Api('plugins/'.$_ENV['PLUGIN_ID'].'/tags.json', 'GET'); |
33 | 31 | if ( $deploy->tags[0]->version === $version ) { |
34 | 32 | $deploy = $deploy->tags[0]; |
35 | 33 | echo '-Package already deployed on Freemius'."\n"; |
36 | 34 | } else { |
37 | 35 | // Upload the zip |
38 | | - $deploy = $api->Api('plugins/'.$_ENV['PLUGIN_SLUG'].'/tags.json', 'POST', array( |
39 | | - 'add_contributor' => false, |
40 | | - 'plugin_id' => $_ENV['PLUGIN_ID'] |
| 36 | + $deploy = $api->Api('plugins/'.$_ENV['PLUGIN_ID'].'/tags.json', 'POST', array( |
| 37 | + 'add_contributor' => false |
41 | 38 | ), array( |
42 | 39 | 'file' => $file_name |
43 | 40 | )); |
|
49 | 46 |
|
50 | 47 | echo "- Deploy done on Freemius\n"; |
51 | 48 |
|
52 | | - $is_released = $api->Api('plugins/'.$_ENV['PLUGIN_SLUG'].'/tags/'.$deploy->id.'.json', 'PUT', array( |
53 | | - 'release_mode' => $release_mode, |
54 | | - 'plugin_id' => $_ENV['PLUGIN_ID'] |
| 49 | + $is_released = $api->Api('plugins/'.$_ENV['PLUGIN_ID'].'/tags/'.$deploy->id.'.json', 'PUT', array( |
| 50 | + 'release_mode' => $release_mode |
55 | 51 | ), array()); |
56 | 52 |
|
57 | 53 | echo "- Set as released on Freemius\n"; |
|
60 | 56 | echo "- Download Freemius free version\n"; |
61 | 57 |
|
62 | 58 | // Generate url to download the zip |
63 | | - $zip_free = $api->GetSignedUrl('plugins/'.$_ENV['PLUGIN_SLUG'].'/tags/'.$deploy->id.'.zip?plugin_id='.$_ENV['PLUGIN_ID'], array()); |
| 59 | + $zip_free = $api->GetSignedUrl('plugins/'.$_ENV['PLUGIN_ID'].'/tags/'.$deploy->id.'.zip', array()); |
64 | 60 | $path = pathinfo($file_name); |
65 | 61 | $zipname_free = $path['dirname'] . '/' . basename($file_name, '.zip'); |
66 | 62 | $zipname_free .= '__free.zip'; |
|
71 | 67 | echo "::set-output name=free_version::" . $zipname_free . "\n"; |
72 | 68 |
|
73 | 69 | // Generate url to download the pro zip |
74 | | - $zip_pro = $api->GetSignedUrl('plugins/'.$_ENV['PLUGIN_SLUG'].'/tags/'.$deploy->id.'.zip?is_premium=true&plugin_id='.$_ENV['PLUGIN_ID'], array()); |
| 70 | + $zip_pro = $api->GetSignedUrl('plugins/'.$_ENV['PLUGIN_ID'].'/tags/'.$deploy->id.'.zip?is_premium=true', array()); |
75 | 71 | $path = pathinfo($file_name); |
76 | 72 | $zipname_pro = $path['dirname'] . '/' . basename($file_name, '.zip'); |
77 | 73 | $zipname_pro .= '.zip'; |
|
0 commit comments