fastlane-plugin-pgyer 0.3.3 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +79 -114
- data/lib/fastlane/plugin/pgyer/actions/pgyer_action.rb +128 -392
- data/lib/fastlane/plugin/pgyer/helper/pgyer_client.rb +273 -0
- data/lib/fastlane/plugin/pgyer/helper/pgyer_helper.rb +157 -5
- data/lib/fastlane/plugin/pgyer/version.rb +1 -1
- metadata +36 -7
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: '0389914f123047ec85c4a31f38c27420c6097433d20e965addea61f2c1d62a5c'
|
|
4
|
+
data.tar.gz: 291a474d9007ad4d7a44717e4fccd11f1a56a013f70746fb1f130af5140b2558
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9eb2ad5fe30685261724c4a9970cf47068c8b92b3f0b645ed10bf1034647d4f210d3fbfb7c57506beaa6b54e17bd983d40d44ca18ec9b2db6d89a78e5e22d0fc
|
|
7
|
+
data.tar.gz: 430a4d603ba279cbc1868e6ef73e5c12e2fd769fbeff902a6f489958f788d8ce0542e1ce9ea2229088780773d75781d55a4f0b682d4e1c94b6c80bc8609accaf
|
data/README.md
CHANGED
|
@@ -1,168 +1,133 @@
|
|
|
1
1
|
# pgyer plugin
|
|
2
2
|
|
|
3
3
|
[](https://rubygems.org/gems/fastlane-plugin-pgyer)
|
|
4
|
-
## Important Notifications
|
|
5
4
|
|
|
6
|
-
|
|
5
|
+
Upload `.ipa`, `.apk` and HarmonyOS `.hap` builds to [PGYER](https://www.pgyer.com) from your [fastlane](https://github.com/fastlane/fastlane) lanes.
|
|
7
6
|
|
|
8
7
|
## Getting Started
|
|
9
8
|
|
|
10
|
-
This project is a [fastlane](https://github.com/fastlane/fastlane) plugin. To get started with `fastlane-plugin-pgyer`, add it to your project by running:
|
|
11
|
-
|
|
12
9
|
```bash
|
|
13
10
|
fastlane add_plugin pgyer
|
|
14
11
|
```
|
|
15
12
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
This pluginin allow you distribute app automatically to [pgyer beta testing service](https://www.pgyer.com) in fastlane workflow.
|
|
19
|
-
|
|
20
|
-
## How to update pgyer plugin to the latest version
|
|
21
|
-
|
|
22
|
-
**Due to the adjustment of the API interface, please ensure that the plugin version is at least `0.2.4`**
|
|
23
|
-
|
|
24
|
-
Plan A: update all plguins (Recommended)
|
|
25
|
-
|
|
13
|
+
Get your API key at <https://www.pgyer.com/account/api> and make it available as the `PGYER_API_KEY` environment variable (for example as a CI secret), so it stays out of your Fastfile:
|
|
26
14
|
|
|
27
15
|
```bash
|
|
28
|
-
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
Plan B: update pgyer plugin only
|
|
32
|
-
|
|
33
|
-
modify `fastlane/Pluginfile`, update the following line:
|
|
34
|
-
|
|
35
|
-
```ruby
|
|
36
|
-
gem 'fastlane-plugin-pgyer', ">= 0.2.4" # ensure plugin version >= 0.2.4
|
|
16
|
+
export PGYER_API_KEY=your_api_key
|
|
37
17
|
```
|
|
38
18
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
## Plugin avaliable options
|
|
42
|
-
|
|
43
|
-
please visit [https://github.com/shishirui/fastlane-plugin-pgyer/blob/master/lib/fastlane/plugin/pgyer/actions/pgyer_action.rb#L135-L205](https://github.com/shishirui/fastlane-plugin-pgyer/blob/master/lib/fastlane/plugin/pgyer/actions/pgyer_action.rb#L135-L205) to know the options.
|
|
44
|
-
|
|
19
|
+
You can also pass it as `pgyer(api_key: ...)`.
|
|
45
20
|
|
|
46
|
-
##
|
|
21
|
+
## Examples
|
|
47
22
|
|
|
48
|
-
|
|
23
|
+
Android, uploading the APK built by `gradle` in the same lane:
|
|
49
24
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
```
|
|
25
|
+
```ruby
|
|
53
26
|
lane :beta do
|
|
54
|
-
|
|
55
|
-
pgyer(
|
|
27
|
+
gradle(task: "assembleRelease")
|
|
28
|
+
pgyer(update_description: "Fixed the login crash")
|
|
56
29
|
end
|
|
57
30
|
```
|
|
58
31
|
|
|
59
|
-
|
|
32
|
+
iOS, uploading the IPA built by `gym`, protected with an install password:
|
|
60
33
|
|
|
61
|
-
```
|
|
62
|
-
lane :beta do
|
|
63
|
-
gym
|
|
64
|
-
pgyer(api_key: "7f15xxxxxxxxxxxxxxxxxx141", password: "123456", install_type: "2")
|
|
65
|
-
end
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
Set a version update description for App:
|
|
69
|
-
acd88a1a52f0818dc7923150c4d86f08
|
|
70
|
-
```
|
|
34
|
+
```ruby
|
|
71
35
|
lane :beta do
|
|
72
|
-
gym
|
|
73
|
-
pgyer(
|
|
36
|
+
gym(export_method: "ad-hoc")
|
|
37
|
+
pgyer(password: "123456", update_description: "Fixed the login crash")
|
|
74
38
|
end
|
|
75
39
|
```
|
|
76
40
|
|
|
77
|
-
|
|
78
|
-
If the upload is successful, you will get information about the app after it is uploaded, which is returned from the API interface app/buildinfo . You can pass it to other plugins, or export it to the terminal for use by other scripts:
|
|
41
|
+
HarmonyOS, uploading a signed `.hap` (build it first, for example with `hvigorw assembleHap`):
|
|
79
42
|
|
|
80
43
|
```ruby
|
|
81
|
-
lane :
|
|
82
|
-
|
|
83
|
-
answer = pgyer(api_key: "xxxxxx")
|
|
84
|
-
puts answer
|
|
85
|
-
# terminal outputs like this if uploaded successfully
|
|
86
|
-
# {"buildKey"=>"xxxx", "buildType"=>"2", "buildIsFirst"=>"0", "buildIsLastest"=>"1", "buildFileKey"=>"xxx.apk", "buildFileName"=>"", "buildFileSize"=>"111111", "buildName"=>"testApk", "buildVersion"=>"0.11.0", "buildVersionNo"=>"13", "buildBuildVersion"=>"10", "buildIdentifier"=>"com.pgyer.testapk", "buildIcon"=>"xxxx", "buildDescription"=>"", "buildUpdateDescription"=>"", "buildScreenshots"=>"", "buildShortcutUrl"=>"xxxxxxx", "buildCreated"=>"2023-04-04 11:33:24", "buildUpdated"=>"2023-04-04 11:33:24", "buildQRCodeURL"=>"https://www.pgyer.com/app/qrcodeHistory/xxxxxx", "fastlaneAddedWholeVisitUrl"=>"https://www.pgyer.com/xxxxxx"}
|
|
87
|
-
puts "url = #{answer["fastlaneAddedWholeVisitUrl"]}"
|
|
88
|
-
|
|
89
|
-
# terminal outputs like this if uploaded successfully
|
|
90
|
-
# url = https://www.pgyer.com/xxxxxx
|
|
91
|
-
|
|
92
|
-
# More information please visit https://www.pgyer.com/doc/view/api#fastUploadApp to check API "https://www.pgyer.com/apiv2/app/buildInfo"
|
|
93
|
-
|
|
44
|
+
lane :beta_harmony do
|
|
45
|
+
pgyer(hap: "entry/build/default/outputs/default/entry-default-signed.hap", update_description: "Fixed the login crash")
|
|
94
46
|
end
|
|
95
47
|
```
|
|
96
48
|
|
|
49
|
+
From the command line:
|
|
97
50
|
|
|
98
|
-
HAP file upload
|
|
99
|
-
|
|
100
|
-
pgyer supports hap file to upload, use params hap to specify the absolute file path.
|
|
101
|
-
|
|
102
|
-
```ruby
|
|
103
|
-
lane :beta do
|
|
104
|
-
gym
|
|
105
|
-
pgyer(api_key: "7f15xxxxxxxxxxxxxxxxxx141", hap: "xxxx")
|
|
106
|
-
end
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
or in bash
|
|
110
51
|
```bash
|
|
111
|
-
fastlane run pgyer
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
And more params
|
|
117
|
-
|
|
52
|
+
fastlane run pgyer hap:entry/build/default/outputs/default/entry-default-signed.hap
|
|
118
53
|
```
|
|
119
54
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
update_description: Set update description for app.
|
|
123
|
-
|
|
124
|
-
install_type: Set install type for app (1=public, 2=password, 3=invite), Please set as a string.
|
|
125
|
-
|
|
126
|
-
install_date: Set install type for app (1=Set valid time, 2=Long-term effective, other=Do not modify the last setting), Please set as a string.
|
|
55
|
+
## Options
|
|
127
56
|
|
|
128
|
-
|
|
57
|
+
| Option | Environment variable | Description |
|
|
58
|
+
| --- | --- | --- |
|
|
59
|
+
| `api_key` | `PGYER_API_KEY` | **Required.** API key of your PGYER account |
|
|
60
|
+
| `apk`, `ipa`, `hap` | `PGYER_APK`, `PGYER_IPA`, `PGYER_HAP` | File to upload; set at most one. Without one, the output of `gym`, `gradle` or hvigor in the same lane is used (checked in that order: ipa, apk, hap). The type comes from the file extension; `~` is expanded |
|
|
61
|
+
| `update_description` | `PGYER_UPDATE_DESCRIPTION` | Release notes of this version |
|
|
62
|
+
| `description` | `PGYER_DESCRIPTION` | App description |
|
|
63
|
+
| `install_type` | `PGYER_INSTALL_TYPE` | `1` public, `2` password, `3` invitation only. Unset keeps the setting of the previous version, or uses `2` when `password` is set |
|
|
64
|
+
| `password` | `PGYER_PASSWORD` | Install password |
|
|
65
|
+
| `install_date` | `PGYER_INSTALL_DATE` | `1` installable between the two dates below, `2` no time limit. Unset keeps the previous setting, or uses `1` when both dates are set |
|
|
66
|
+
| `install_start_date`, `install_end_date` | `PGYER_INSTALL_START_DATE`, `PGYER_INSTALL_END_DATE` | Install period, such as `2026-01-01`. Set both or neither |
|
|
67
|
+
| `channel` | `PGYER_SPECIFIED_CHANNEL` | Short link of one existing download channel to update, such as `ABCD` |
|
|
68
|
+
| `user_download_file_name` | `PGYER_USER_DOWNLOAD_FILE_NAME` (`USER_DOWNLOAD_FILE_NAME` still works) | File name testers download, such as `demo.apk`. Plain ASCII only. Defaults to the name of the uploaded file |
|
|
69
|
+
| `oversea` | `PGYER_OVERSEA` | Upload storage: `true` overseas, `false` mainland China. Unset: chosen by your IP address. `1`, `2` and `0` (unset) still work |
|
|
70
|
+
| `processing_timeout` | `PGYER_PROCESSING_TIMEOUT` | Seconds to wait for PGYER to process the build after the upload. Default `600` |
|
|
71
|
+
| `save_uploaded_info_json` | `PGYER_SAVE_UPLOADED_INFO_JSON` | `true` also writes the result to `pgyer-fastlane-uploaded-app-info.json`. Default `false` |
|
|
72
|
+
| `doh` | `PGYER_DOH` | `true` looks up the PGYER API servers with DNS over HTTPS (Alibaba Cloud public DNS) instead of the system DNS. Certificates are still verified. Needs Ruby 2.7 or later. Default `false` |
|
|
129
73
|
|
|
130
|
-
|
|
74
|
+
Run `fastlane action pgyer` to see them in your terminal.
|
|
131
75
|
|
|
132
|
-
|
|
76
|
+
## Outputs
|
|
133
77
|
|
|
134
|
-
|
|
78
|
+
`pgyer` returns a Hash with the build information from PGYER's [buildInfo API](https://www.pgyer.com/doc/view/api_upload) (`buildKey`, `buildName`, `buildVersion`, `buildVersionNo`, `buildShortcutUrl`, `buildQRCodeURL`, ...) plus:
|
|
135
79
|
|
|
136
|
-
|
|
80
|
+
| Key | Value |
|
|
81
|
+
| --- | --- |
|
|
82
|
+
| `appPgyerURL` | Download page, such as `https://www.pgyer.com/abcd` |
|
|
83
|
+
| `appBuildURL` | Page of this exact build, `https://www.pgyer.com/<buildKey>` |
|
|
84
|
+
| `appQRCodeURL` | QR code image of the download page (same as `buildQRCodeURL`) |
|
|
85
|
+
| `fastlaneAddedWholeVisitUrl` | Same as `appPgyerURL`, kept for earlier versions |
|
|
137
86
|
|
|
87
|
+
The same values are stored in the lane context:
|
|
138
88
|
|
|
89
|
+
| `lane_context` key | Value |
|
|
90
|
+
| --- | --- |
|
|
91
|
+
| `SharedValues::PGYER_OUTPUT` | The Hash above |
|
|
92
|
+
| `SharedValues::PGYER_DOWNLOAD_URL` | Download page |
|
|
93
|
+
| `SharedValues::PGYER_QRCODE_URL` | QR code image URL |
|
|
139
94
|
|
|
140
|
-
```
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
rake
|
|
95
|
+
```ruby
|
|
96
|
+
lane :beta do
|
|
97
|
+
gym(export_method: "ad-hoc")
|
|
98
|
+
result = pgyer(update_description: "Fixed the login crash")
|
|
99
|
+
slack(message: "New beta: #{result['appPgyerURL']}")
|
|
100
|
+
end
|
|
147
101
|
```
|
|
148
102
|
|
|
149
|
-
|
|
150
|
-
```
|
|
151
|
-
rubocop -a
|
|
152
|
-
```
|
|
103
|
+
## Troubleshooting
|
|
153
104
|
|
|
154
|
-
|
|
105
|
+
- **`Error loading plugin 'fastlane-plugin-pgyer'` / `Unable to activate faraday_middleware` / "No actions found"**: plugin 0.3.x needs Faraday 1 and does not load on fastlane 2.238.0 or later. Upgrade the plugin with `bundle update fastlane-plugin-pgyer` (or `fastlane update_plugins`), and make sure `fastlane/Pluginfile` does not pin an old version.
|
|
106
|
+
- **API errors** (wrong API key, sub-account key, missing real-name verification, uploads disabled, storage full) are printed with the PGYER error code and a hint on how to fix them.
|
|
107
|
+
- **`PGYER is still processing the build after 600 seconds`**: the upload finished, so the build may still appear in your app list. Raise `processing_timeout` for very large builds.
|
|
108
|
+
- **`None of the PGYER API servers could be reached`**: the plugin tries `www.pgyer.com`, `www.xcxwo.com` and `www.pgyerapp.com` in turn. Check your network and proxy (`HTTPS_PROXY` is honoured), or try `doh: true` if your DNS blocks these domains.
|
|
109
|
+
- **The wrong file was uploaded**: pass the file explicitly with `apk`, `ipa` or `hap`.
|
|
155
110
|
|
|
156
|
-
|
|
111
|
+
See also the fastlane [Plugins Troubleshooting](https://docs.fastlane.tools/plugins/plugins-troubleshooting/) guide.
|
|
157
112
|
|
|
158
|
-
##
|
|
113
|
+
## Changelog
|
|
159
114
|
|
|
160
|
-
|
|
115
|
+
### 0.5.0
|
|
161
116
|
|
|
162
|
-
|
|
117
|
+
- An `apk`, `ipa` or `hap` option now always wins over builds in the lane context, and the build type comes from the file extension. `~` in paths is expanded.
|
|
118
|
+
- `install_type` is only sent when you set it. Earlier versions sent `1` (public) on every upload without it, which made password-protected apps public.
|
|
119
|
+
- Waiting for PGYER is limited by `processing_timeout` (default 600 seconds) and survives short network errors.
|
|
120
|
+
- `oversea` accepts `true`/`false` and works from `PGYER_OVERSEA`.
|
|
121
|
+
- The fallback servers are only tried on network errors; API errors stop at once and include a hint.
|
|
122
|
+
- Request parameters and credentials are no longer printed, and `doh` mode no longer turns off TLS certificate verification.
|
|
123
|
+
- The name of the uploaded file is sent as the download file name unless `user_download_file_name` is set.
|
|
124
|
+
- New: `description` and `processing_timeout` options, `PGYER_OUTPUT`, `PGYER_DOWNLOAD_URL` and `PGYER_QRCODE_URL` outputs, `PGYER_USER_DOWNLOAD_FILE_NAME`.
|
|
163
125
|
|
|
164
|
-
|
|
126
|
+
## Development
|
|
165
127
|
|
|
166
|
-
|
|
128
|
+
```bash
|
|
129
|
+
bundle install
|
|
130
|
+
bundle exec rake # specs and RuboCop
|
|
131
|
+
```
|
|
167
132
|
|
|
168
|
-
|
|
133
|
+
Issues and pull requests are welcome at <https://github.com/PGYER/fastlane-plugin-pgyer>.
|