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

Install github release as created by CI #132

Closed
nbenn opened this issue May 18, 2018 · 6 comments
Closed

Install github release as created by CI #132

nbenn opened this issue May 18, 2018 · 6 comments

Comments

@nbenn
Copy link

nbenn commented May 18, 2018

I'm sorry if I'm missing something here, but wouldn't it be nice if there was a way to directly install packages as prepared for example by travis using something like

deploy:
  provider: releases
  api_key: $GITHUB_TOKEN
  file_glob: true
  file: pkg_name*.t*gz
  skip_cleanup: true
  on:
    tags: true

This would make it possible to distribute binary packages via github, or bundle vignettes without checking them into git, etc.

Currently, remotes::install_github("user/repo@*release") fetches the full source code of the repo for the latest release ref and there seems to be no way of specifying a specific release file to be used instead.

@gaborcsardi
Copy link
Member

gaborcsardi commented May 18, 2018

You don't need remotes for that, you can get the URL of the released file via the GH API (https://developer.github.com/v3/repos/releases/#get-a-single-release), and then just install from the URL with install.packages(url, type = "souce", repos = NULL).

@nbenn
Copy link
Author

nbenn commented May 18, 2018

Sure, but to me there is still some stuff that could be automated by remotes. Something along the lines of

  1. get name of latest release

  2. list assets of that release

  3. if only a single archive

    • try and install that
    • if it fails, fall back to installing source

    else

    • use some file name regexps to auto-determine which release corresponds to current os
    • if nothing matches, fall back to installing source

If you don't think any of this is useful, it's fine, you can go ahead and close the issue.

@gaborcsardi
Copy link
Member

I think this makes sense. It is maybe something that pkgman / pkgdepends could support. I am reluctant to add it to remotes, pkgman is much better, and it is coming soon.

@jimhester
Copy link
Member

So devtools / remotes does have support for installing the latest release using a somewhat undocumented syntax, my/test/pkg@*release, it was added in ~2014, r-lib/devtools#475

@jimhester
Copy link
Member

Oh right, I didn't read, you want a release binary

Currently, remotes::install_github("user/repo@*release") fetches the full source code of the repo for the latest release ref and there seems to be no way of specifying a specific release file to be used instead.

@nbenn
Copy link
Author

nbenn commented May 18, 2018

@jimhester, I think this functionality of devtools you are referring to is already entirely available in remotes. I was proposing to expand this a bit to enable the use of assets associated with a release.

Like so, one could use CI to build packages, github for hosting and remotes::install_github() for installing, thereby emulating the behavior of CRAN/utils::install.packages()

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