Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a static URL for the fastlane download URL #9

Closed
cbowns opened this issue Jan 26, 2016 · 9 comments
Closed

Create a static URL for the fastlane download URL #9

cbowns opened this issue Jan 26, 2016 · 9 comments
Assignees

Comments

@cbowns
Copy link

cbowns commented Jan 26, 2016

Can you make a designated/static URL for downloading the latest release of FixCode? The version hardcoding here seems bad:

lane :xcode do
  install_xcode_plugin(
    url: "https://github.com/fastlane/FixCode/releases/download/0.2.0/FixCode.xcplugin.zip"
  )
end
@KrauseFx
Copy link
Member

Agreed, that would be awesome. However is there a GitHub API to get the URL to the latest release?

@cbowns
Copy link
Author

cbowns commented Jan 27, 2016

@neonichu
Copy link
Member

Probably would make sense to add that as a feature to fastlane's install_xcode_plugin action.

@neonichu neonichu self-assigned this Jan 27, 2016
@KrauseFx
Copy link
Member

Yes please! * inserts obligatory 👍 *

@cbowns
Copy link
Author

cbowns commented Mar 30, 2016

curling the latest release with the GitHub API:

% curl https://api.github.com/repos/neonichu/FixCode/releases/latest

{
  "url": "https://api.github.com/repos/neonichu/FixCode/releases/2605664",
  "assets_url": "https://api.github.com/repos/neonichu/FixCode/releases/2605664/assets",
  "upload_url": "https://uploads.github.com/repos/neonichu/FixCode/releases/2605664/assets{?name,label}",
  "html_url": "https://github.com/neonichu/FixCode/releases/tag/0.3.0",
  "id": 2605664,
  "tag_name": "0.3.0",
  "target_commitish": "master",
  "name": "FixCode 0.3.0",
  "draft": false,
  "author": {
    "login": "neonichu",
    "id": 118992,
    "avatar_url": "https://avatars.githubusercontent.com/u/118992?v=3",
    "gravatar_id": "",
    "url": "https://api.github.com/users/neonichu",
    "html_url": "https://github.com/neonichu",
    "followers_url": "https://api.github.com/users/neonichu/followers",
    "following_url": "https://api.github.com/users/neonichu/following{/other_user}",
    "gists_url": "https://api.github.com/users/neonichu/gists{/gist_id}",
    "starred_url": "https://api.github.com/users/neonichu/starred{/owner}{/repo}",
    "subscriptions_url": "https://api.github.com/users/neonichu/subscriptions",
    "organizations_url": "https://api.github.com/users/neonichu/orgs",
    "repos_url": "https://api.github.com/users/neonichu/repos",
    "events_url": "https://api.github.com/users/neonichu/events{/privacy}",
    "received_events_url": "https://api.github.com/users/neonichu/received_events",
    "type": "User",
    "site_admin": false
  },
  "prerelease": false,
  "created_at": "2016-02-12T20:25:30Z",
  "published_at": "2016-02-12T20:42:54Z",
  "assets": [
    {
      "url": "https://api.github.com/repos/neonichu/FixCode/releases/assets/1306248",
      "id": 1306248,
      "name": "FixCode.xcplugin.zip",
      "label": null,
      "uploader": {
        "login": "neonichu",
        "id": 118992,
        "avatar_url": "https://avatars.githubusercontent.com/u/118992?v=3",
        "gravatar_id": "",
        "url": "https://api.github.com/users/neonichu",
        "html_url": "https://github.com/neonichu",
        "followers_url": "https://api.github.com/users/neonichu/followers",
        "following_url": "https://api.github.com/users/neonichu/following{/other_user}",
        "gists_url": "https://api.github.com/users/neonichu/gists{/gist_id}",
        "starred_url": "https://api.github.com/users/neonichu/starred{/owner}{/repo}",
        "subscriptions_url": "https://api.github.com/users/neonichu/subscriptions",
        "organizations_url": "https://api.github.com/users/neonichu/orgs",
        "repos_url": "https://api.github.com/users/neonichu/repos",
        "events_url": "https://api.github.com/users/neonichu/events{/privacy}",
        "received_events_url": "https://api.github.com/users/neonichu/received_events",
        "type": "User",
        "site_admin": false
      },
      "content_type": "application/zip",
      "state": "uploaded",
      "size": 47478,
      "download_count": 347,
      "created_at": "2016-02-12T20:43:15Z",
      "updated_at": "2016-02-12T20:43:17Z",
      "browser_download_url": "https://github.com/neonichu/FixCode/releases/download/0.3.0/FixCode.xcplugin.zip"
    }
  ],
  "tarball_url": "https://api.github.com/repos/neonichu/FixCode/tarball/0.3.0",
  "zipball_url": "https://api.github.com/repos/neonichu/FixCode/zipball/0.3.0",
  "body": "Bugfixes and performance improvements :trollface: \r\n\r\nThanks for using FixCode! To make our Xcode plugin better for you, we bring updates every 2 weeks."
}

The JSON path assets/browser_download_url is what we want: "browser_download_url": "https://github.com/neonichu/FixCode/releases/download/0.3.0/FixCode.xcplugin.zip"

@neonichu
Copy link
Member

neonichu commented Jun 2, 2016

This has been implemented in fastlane/fastlane#4911

@neonichu neonichu closed this as completed Jun 2, 2016
@neonichu
Copy link
Member

neonichu commented Jun 2, 2016

Thanks a lot for the suggestion @cbowns 🎉

@KrauseFx
Copy link
Member

KrauseFx commented Jun 2, 2016

Yeah 🚀

@cbowns
Copy link
Author

cbowns commented Jun 3, 2016

🤘

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants