action icon indicating copy to clipboard operation
action copied to clipboard

Downloaded `deployer.phar` should be the latest version

Open benjaminmal opened this issue 3 years ago • 5 comments

I have this error when running my deployment workflow:

Capture d’écran 2022-09-08 à 14 36 41

It turns out the version downloaded via https://deployer.org/deployer.phar is 6.8.0. I think the action should download the latest version available by default, or maybe a required parameter should be added to select the major version of the downloaded deployer.phar. Linked to https://github.com/deployphp/deployer/issues/3225.

benjaminmal avatar Sep 08 '22 13:09 benjaminmal

A workaround I found is to use composer to download the last version, and set deployer-binary parameter:

            -   name: Download `deployer.phar`
                run: composer global require deployer/deployer --no-interaction --verbose --ansi

            -   name: Get composer global bin-dir path
                id: composer-bin-dir
                run: echo "::set-output name=path::$(composer global config bin-dir --absolute)"

            -   name: Deploy
                uses: deployphp/action@v1
                with:
                    dep: deploy production
                    deployer-binary: ${{ steps.composer-bin-dir.outputs.path }}/dep
                    private-key: ${{ secrets.HOST_SSH_KEY }}

benjaminmal avatar Sep 08 '22 13:09 benjaminmal

Same error. Thanks a lot @benjaminmal for working solution.

I also add

tools: composer:v2

to shivammathur/setup-php@v2 for composer installs.

TTATPuOT avatar Oct 11 '22 10:10 TTATPuOT

Lets do it this way: if I gonna get donation in amount of $100, I'll work on create a link which points to latest dep phar.

antonmedv avatar Oct 11 '22 19:10 antonmedv

@antonmedv Kind of expensive link :P I can suggest adding a latest version in manifest.json and setting in the action latest as default value for deployer-version. It should work automatically in the action.

[
    ...
 
    {
        "name": "deployer.phar",
        "sha1": "bf46ca3ff7339d644220e949c2c71994749cf561",
        "url": "https:\/\/github.com\/deployphp\/deployer\/releases\/download\/v7.0.2\/deployer.phar",
        "version": "7.0.2"
    },
    {
        "name": "deployer.phar",
        "sha1": "bf46ca3ff7339d644220e949c2c71994749cf561",
        "url": "https:\/\/github.com\/deployphp\/deployer\/releases\/download\/v7.0.2\/deployer.phar",
        "version": "latest"
    }
]

benjaminmal avatar Oct 12 '22 23:10 benjaminmal

Creating such automation. Or just a link which points to latests require non-zero amount of work. :p

antonmedv avatar Oct 13 '22 14:10 antonmedv

Should be fixed.

antonmedv avatar Jan 10 '23 14:01 antonmedv