Skip to content
This repository has been archived by the owner on Jul 1, 2023. It is now read-only.

Host .phar version #74

Open
realityking opened this issue Jul 11, 2016 · 17 comments
Open

Host .phar version #74

realityking opened this issue Jul 11, 2016 · 17 comments

Comments

@realityking
Copy link

Hi there,

parallel-lint is awesome! It's just a tiny bit painful to integrate it into my CI flow. I'd be happy to help you set up a small gh-pages site to host it. Would you be able to keep it updated?

Cheers,
Rouven

@bbashy
Copy link

bbashy commented Oct 4, 2016

Any reason why it's hard to integrate into CI?

@grogy
Copy link
Contributor

grogy commented Oct 4, 2016

Do you use Composer?

@glensc
Copy link
Contributor

glensc commented Oct 5, 2016

@JakubOnderka
Copy link
Owner

I agree with glensc that automatic deploy by Travis is good solution and gh-page can only link to latest release.

@glensc
Copy link
Contributor

glensc commented Oct 17, 2016

perhaps upload the .phar manually to each github releases until it is automated

and use some "fixed" name like "parallel-lint.phar" not "parallel-lint-1.3.1.phar", so you could use in docs such link:

i'm not sure which one works as there is no .phar, but such "latest" link redirects properly:

@glensc
Copy link
Contributor

glensc commented Oct 17, 2016

oh and parallel-lint.phar is not good name (too generic), or do you plan linting other languages too than PHP?

@TomasVotruba
Copy link

PHAR usually requires a great maintenance overhead and different approach to code and debugging itself.

What would be the added value over this?

@Wirone
Copy link

Wirone commented Sep 15, 2017

@TomasVotruba added value is that your dev dependencies don't pollute your app's real dependencies, so there is less possibility of conflicts between low-level dependencies.

Yesterday I wanted to add PHPStan to project based on Laravel 4.2 which our team took over and I was unable to do that because of conflict on nikic/php-parser (PHPStan requires ~3.0 while Laravel's dependencies locked it with ~1.0). With Phar I can download dev tool with all its dependencies without need to worry about conflicts with libraries used by application.

Today I learned there is https://github.com/tommy-muehle/tooly-composer-script which automates downloading PHAR files for development, so I wanted to check if there is one for parallel lint - so here I am :-)

@jtojnar
Copy link

jtojnar commented Dec 6, 2017

Apparently, this is already set up, only there has not been a new release yet. @JakubOnderka Could you please make a dummy release so we could use the PHAR?

@gsdevme
Copy link

gsdevme commented Feb 8, 2018

I feel there is a natural move towards phar files for dev tools happening in the PHP space, its often for the reason of not having your dev deps clash with your non-dev though as @Wirone stated. You can quickly end up in a situation where either you want to move forward and the tool hasn't.. or the other way around.

If there is automated stuff for this then Id assume the extra work load is minimal? seems like @jtojnar is suggesting all that is required is a release.

@glensc
Copy link
Contributor

glensc commented Oct 1, 2018

also should integrate with https://phar.io/

@glensc
Copy link
Contributor

glensc commented Oct 1, 2018

the travis integrfation to build phar on git tag was done in 2016 October:

which means 1.0.0 tag has the integration present.

so i looked travis build log for 1.0.0 tag:

@JakubOnderka seems your travis key setup is incorrect:

Preparing deploy
/home/travis/.rvm/gems/ruby-2.2.6/gems/octokit-4.6.2/lib/octokit/response/raise_error.rb:16:in `on_complete': GET https://api.github.com/user: 401 - Bad credentials // See: https://developer.github.com/v3 (Octokit::Unauthorized)
...
failed to deploy

so, please recheck what's there wrong and tag 1.0.1 (from the same tag for example)

@sebastianbergmann
Copy link

Please provide PHARs for your releases and make them installable with Phive.

@jakzal
Copy link

jakzal commented Apr 23, 2019

While doing this please also consider migrating to https://github.com/humbug/box, which is a maintained version of box, that is not only fast but provides some additional features.

@szepeviktor
Copy link

Modern PHP tools tend to be distributed in PHAR files.
Please consider distributing using PHIVE

@jrfnl
Copy link

jrfnl commented Feb 17, 2022

Just FYI - as of version 1.3.0, the PHAR is part of the release assets.
See: https://github.com/php-parallel-lint/PHP-Parallel-Lint/releases

Adding support for Phive is on the roadmap to be addressed in the near future: php-parallel-lint/PHP-Parallel-Lint#75

@pereorga
Copy link

pereorga commented Feb 7, 2023

Posting this just in case it's useful to anybody else, I automated downloading the latest released phar file with the following bash function:

##############################################################################
# Downloads a phar file from the latest release of a GitHub project.
# Arguments:
#   A github.com project url (e.g. "https://github.com/php-parallel-lint/PHP-Parallel-Lint")
##############################################################################
download_phar_release_github() {
    local -r github_url="$1"
    local api_url download_url phar_filename phar_path
    api_url=$(echo "${github_url}" | sed -e "s|github.com|api.github.com/repos|g")/releases/latest
    download_url=$(curl -s "${api_url}" | grep -m 1 "browser_download_url.*phar" | cut -d : -f 2,3 | xargs)
    phar_filename=$(basename "${download_url}")
    phar_path="tools/${phar_filename%.*}"

    echo "Downloading ${download_url} to ${phar_path}..."
    curl -s -L -o "${phar_path}" "${download_url}"
    chmod u+x "${phar_path}"
}

download_phar_release_github https://github.com/php-parallel-lint/PHP-Parallel-Lint

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

No branches or pull requests