Dist-Zilla-Plugin-GitHub-UploadRelease

 view release on metacpan or  search on metacpan

lib/Dist/Zilla/Plugin/GitHub/UploadRelease.pm  view on Meta::CPAN


sub _api_request {
    my ($self, $method, $path, $payload, $headers) = @_;

    my $url = $path =~ m{^https?://}i ? $path :  $self->api . $path;

    $self->log_debug("$method $url");

    $headers //= {};

    my ($login, $pass, $otp) = $self->_get_credentials(0);

    if ($pass) {
        my $basic = encode_base64("$login:$pass", '');
        $headers->{Authorization} = "Basic $basic";
    }

    if ($self->prompt_2fa) {
        $headers->{'X-GitHub-OTP'} = $otp;
        $self->log("Using two-factor authentication");
    }

lib/Dist/Zilla/Plugin/GitHub/UploadRelease.pm  view on Meta::CPAN


    return $result;
}


sub after_release {
    my ($self, $archive) = @_;

    my $dist_name = $self->zilla->name;

    my ($login) = $self->_get_credentials(1);
    return unless $login;

    my $repo_name = $self->_get_repo_name($login);

    my $git_tag_plugin = $self->zilla->plugin_named('Git::Tag') // $self->log_fatal('Plugin Git::Tag not found');

    my $tag = $git_tag_plugin->tag;

    my ($result, $status);

lib/Dist/Zilla/Plugin/GitHub/UploadRelease.pm  view on Meta::CPAN

=head1 NAME

Dist::Zilla::Plugin::GitHub::UploadRelease - Upload the package to GitHub after release

=head1 VERSION

version 0.002

=head1 SYNOPSIS

Configure git with your GitHub credentials:

    git config --global github.user LoginName
    git config --global github.password GitHubPassword

Alternatively you can install L<Config::Identity> and write your credentials in the (optionally GPG-encrypted) C<~/.github> file as follows:

    login LoginName
    password GitHubpassword

(if only the login name is set, the password will be asked interactively)
then, in your F<dist.ini>:

    [GitHub::UploadRelease]

=head1 DESCRIPTION



( run in 0.485 second using v1.01-cache-2.11-cpan-4d50c553e7e )