microsoft / fastlane-plugin-appcenter

App Center fastlane integration.
MIT License
508 stars 128 forks source link

Get release url after upload to App Center #49

Closed toddgower-hiatus closed 3 months ago

toddgower-hiatus commented 5 years ago

Is it possible to retrieve the url of the release page that contains the installation link after the upload to App Center completes? Something similar to the way that Hockey sets a shared variable.

Alex-Anyvision commented 5 years ago

Yeah, we see it in log. It'd be great to get it as shared variable.

jdmunro commented 5 years ago

After you've called appcenter_upload you can access in the lane context lane_context[SharedValues::APPCENTER_DOWNLOAD_LINK].

You can see in the plugin code where this is set: https://github.com/Microsoft/fastlane-plugin-appcenter/blob/45405cc2096e5421217543dac07b7c3066d42127/lib/fastlane/plugin/appcenter/actions/appcenter_upload_action.rb#L244

Alex-Anyvision commented 5 years ago

So it's a direct link to download .ipa file and not a link to download page as it was with HockeyApp

toddgower-hiatus commented 5 years ago

@Alex-Anyvision would be nice for it to be the link to the download page but AppCenter doesn't appear to have separate pages for each release, right? They are all shown as a list on install.appcenter.ms

Alex-Anyvision commented 5 years ago

Seems like these are the first ones in the list

screen shot 2019-01-17 at 18 08 50

toddgower-hiatus commented 5 years ago

@Alex-Anyvision where did you find that list?

Alex-Anyvision commented 5 years ago

https://www.hockeyapp.net/transition/

dipree commented 5 years ago

There's a more detailed roadmap, however, the integration of the install page and portal require some major changes so don't expect it to come very soon.

davizucon commented 5 years ago

Hi, Can you point me out what is wrong ? I using fastlane-plugin-appcenter:0.2.1 , and always get

NameError: [!] uninitialized constant Fastlane::Actions::SharedValues::APPCENTER_DOWNLOAD_LINK

evkhramkov commented 5 years ago

@davizucon this is actually an issue #66

Thanks to @oklimberg it was fixed in #67 Just published release 0.2.2, please check this out https://rubygems.org/gems/fastlane-plugin-appcenter/versions/0.2.2

davizucon commented 5 years ago

Hello @evkhramkov, version 0.2.2 work like a charm ! Thanks!

orestesgaolin commented 5 years ago

Is there any update on this feature?

tjwio commented 5 years ago

For those wanting an installation link so testers can download directly from their iPhone (instead of just the direct link to the ipa), this works for me:

install_url = Actions.lane_context[Actions::SharedValues::APPCENTER_BUILD_INFORMATION]['install_url']

if you post on slack after, you'll want to append anything to the end of itms-services:// so that it'll be clickable or else slack won't recognize it as a valid url, so I do this after:

install_url = install_url.gsub("itms-services://", "itms-services://test")

Was looking for info earlier on how to get an installation link with nothing to be found so hopefully this helps someone.

vaibhavi-joshi commented 5 years ago

Hey I am not sure it's bug or feature, I am using 1.0.1 and it gives me hockey app Public URL in console without accessing any additional shared value.

Also is there any way to prevent this feature ? am trying to avoid having public URL for my apps.? Any idea? p.s all distribution groups are private

SachinCldCvr commented 5 years ago

@vaibhavi-joshi yeah, the same thing is bothering me too. Looking for a way to prevent this feature, but not found any yet.

dipree commented 5 years ago

@vaibhavi-joshi @SachinCldCvr this is currently by design but we’re working on moving this part off HockeyApp among other things like combining the App Center install page and developer portal which will add support for deep links. Once these things are done the plugin will also leverage.

avibdev commented 4 years ago

For those wanting an installation link so testers can download directly from their iPhone (instead of just the direct link to the ipa), this works for me:

install_url = Actions.lane_context[Actions::SharedValues::APPCENTER_BUILD_INFORMATION]['install_url']

if you post on slack after, you'll want to append anything to the end of itms-services:// so that it'll be clickable or else slack won't recognize it as a valid url, so I do this after:

install_url = install_url.gsub("itms-services://", "itms-services://test")

Was looking for info earlier on how to get an installation link with nothing to be found so hopefully this helps someone.

I have extracted the install_url from Lane context and here is what I got - "install_url"=>"itms-services://?action=download-manifest&url=https%3A%2F%2Fappcenter.ms%2Fapi%2Fv0.1%2Fpublic%2Fapps%2F353a9db4-9dc7-4984-99c3-1f817cf804c0%2Freleases%2F783%2Fios_manifest%3Ftoken%3Dd571cbcd67f72e635ba27e1e9eff9437a8fe11c07deff19433a7a8087a598e51",

Above shows in encoded format. I decoded it - itms-services://?action=download-manifest&url=https://appcenter.ms/api/v0.1/public/apps/353a9db4-9dc7-4984-99c3-1f817cf804c0/releases/783/ios_manifest?token=d571cbcd67f72e635ba27e1e9eff9437a8fe11c07deff19433a7a8087a598e51

However when I open the above in a mobile safari browser, it simply shows "Safari cannot open the page because the server cannot be found". Could you help me in getting the proper URL?

plugin version - 1.5.0

@derpixeldan

wayneburkett commented 4 years ago

We're building the release URL manually in our app, like this:

def build_appcenter_release_url(id)
    return "https://appcenter.ms/orgs/#{ENV["APPCENTER_OWNER_NAME"]}/apps/#{ENV["APPCENTER_APP_NAME"]}/distribute/releases/#{id}"
end

version = appcenter_fetch_version_number(
        api_token: ENV["APPCENTER_API_TOKEN"],
        owner_name: ENV["APPCENTER_OWNER_NAME"],
        app_name: ENV["APPCENTER_APP_NAME"]
        )

build_appcenter_release_url(version["id"])
jspargo commented 4 years ago

When adding the appcenter_fetch_version_number, there was a question of whether we wanted to return the version number response upon a successful upload. If there is an interest, I'd be happy to explore adding one or both of these options: 1) Return the version_number hash on successful upload - e.g. { "id" => 1, "version" => "1.0.0", "build_number" => "1234" } 2) Adding release_url to the hash returned by appcenter_fetch_version_number, in the format described by @wayneburkett above. To be clear, this is different to the download_url returned in the releases API response, which is the link directly to the download of the ipa or apk file from azureedge.net

Whilst I think part 2 of these steps is what's being requested as part of this issue, it might be worth making both of these changed together. If there's an appetite for one or both of these changes, I can look at getting a PR raised.

wayneburkett commented 4 years ago

Ideally we'd get it in the upload response, rendering the following call to appcenter_fetch_version_number unnecessary. (By the way, our use case is updating a Jira ticket with info about automated builds, which is why ipa/apk download links aren't really useful (and, since Jira won't even format a non-http URL as a link, the iTunes download link is particularly unhelpful).

theleanship commented 3 years ago

Did this progress at all? I would really like to return quick links back to the developer who ran a build so they can install it quickly but the urls returned at the moment are not useful. In the upload action output we see links generated with the release number:

[12:16:41]: Release '27' committed: https://appcenter.ms/orgs/Pollen/apps/Pollen-Dev/distribute/releases/27 This url and the release number would be handy to have in the APPCENTER_BUILD_INFORMATION returned in the lane context.

Personally I find the UI on the install page that list all releases to be quite hard to navigate for our use case so would like to link directly to a release page by number where possible, so looking to generate these urls.

DmitriyKirakosyan commented 3 months ago

As we do not have plans to add support for this feature in the next year, I'm closing the issue.