perlalien / alien-build-plugin-download-github Goto Github PK
View Code? Open in Web Editor NEWAlien::Build plugin to download from GitHub
Alien::Build plugin to download from GitHub
https://gist.github.com/plicease/7cf0d4e282efe80c740e16ef6d148ef1
# Failed test 'live tests'
# at t/alien_build_plugin_download_github.t line 91.
# Caught exception in subtest: Can't use string ("[
# {
# "url": "https://api.gi"...) as an ARRAY ref while "strict refs" in use at /tmp/loop_over_bdir-7556-ioxMTR/Alien-Build-Plugin-Download-GitHub-0.02-0/blib/lib/Alien/Build/Plugin/Download/GitHub.pm line 64.
t/alien_build_plugin_download_github.t ..
Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/2 subtests
It is not correct to assume only "tar.gz" format files, because some GitHub repositories offer "zip" format files.
https://github.com/PerlAlien/Alien-Build-Plugin-Download-GitHub/blob/main/lib/Alien/Build/Plugin/Download/GitHub.pm#L135
This doesn't work:
For example with the default version regex, if the versions have a v
prefix.
Alien-Build
as of 2.40 supports sending headers via HTTP, so we should now be able to send an personal authorization token as a header to avoid at least some of the usage limits that cause test failures. Doing so would be a more robust solution that #6 which passes as an argument, and may not be supported anymore anyway. I also noticed there is a bug in #6 where I used different names for the environment variable (doh!).
Question becomes where should we go looking for the token? GitHub Actions apparently stores a PAT in secrets.GITHUB_TOKEN
so that seems to be at least one place. We should also check an environment variable dedicated to AB so that users can have a token for just that and isolate it from their "default" token. What about a file?
That mock the download negotiator and fetch plugins.
https://gist.github.com/plicease/f5464741dc69edc9c67e29988e6cfd61
# Failed test 'live tests'
# at t/alien_build_plugin_download_github.t line 91.
# Caught exception in subtest: error fetching https://api.github.com/repos/Perl5-Alien/dontpanic/releases: 403 Forbidden at /tmp/loop_over_bdir-14705-f0UB_Z/Alien-Build-1.63-0/blib/lib/Alien/Build/Plugin/Fetch/HTTPTiny.pm line 75.
t/alien_build_plugin_download_github.t ..
Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/2 subtests
For when the asset really is the thing that you need and it doesn't need to be further extracted! I think the GitLab version of this already has this.
Right now we only allow fetching the raw git tag, which might not include things like configure
etc.
use alienfile;
plugin 'PkgConfig' => ( pkg_name => 'libtcod', );
share {
plugin 'Download::GitHub' => (
github_user => 'libtcod',
github_repo => 'libtcod',
);
plugin 'Extract::ArchiveTar';
plugin 'Build::Autoconf';
};
as you can see it is not directly using the regular negotiator
git:(pu) 10:18 Alien-TCOD » carton exec af download
Alien::Build::Plugin::PkgConfig::Negotiate> Using PkgConfig plugin: PkgConfig::CommandLine
Alien::Build::Plugin::Download::Negotiate> !! WARNING !! WARNING !!
Alien::Build::Plugin::Download::Negotiate> !! WARNING !! It looks like this alien is using the regular download negotiator
Alien::Build::Plugin::Download::Negotiate> plugin on a GitHub release page. This will typically not work due to changes
Alien::Build::Plugin::Download::Negotiate> in the way GitHub release page works now. The Alien should instead be updated
Alien::Build::Plugin::Download::Negotiate> to use the Download::GitHub plugin, which uses the GitHub API to find available
Alien::Build::Plugin::Download::Negotiate> releases. See: https://metacpan.org/pod/Alien::Build::Plugin::Download::GitHub
Alien::Build::Plugin::Download::Negotiate> !! WARNING !! WARNING !!
Can't locate Mojo/DOM58.pm in @INC (you may need to install the Mojo::DOM58 module) (@INC entries checked: /Users/perigrin/dev/Alien-TCOD/local/lib/perl5/darwin-2level /Users/perigrin/dev/Alien-TCOD/local/lib/perl5 /Users/perigrin/.plenv/versions/5.38.0/lib/perl5/site_perl/5.38.0/darwin-2level /Users/perigrin/.plenv/versions/5.38.0/lib/perl5/site_perl/5.38.0 /Users/perigrin/.plenv/versions/5.38.0/lib/perl5/5.38.0/darwin-2level /Users/perigrin/.plenv/versions/5.38.0/lib/perl5/5.38.0) at /Users/perigrin/dev/Alien-TCOD/local/lib/perl5/Alien/Build.pm line 337.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.