action-setup icon indicating copy to clipboard operation
action-setup copied to clipboard

Install the self-contained binary version of pnpm

Open zkochan opened this issue 3 years ago • 3 comments

This is a breaking change because the binary version of pnpm is only available from v6.17.1. Also, it doesn't ship pnpx.

close #18

zkochan avatar Feb 09 '22 23:02 zkochan

Amendment:

You intend to drop support for pnpm versions without self-contained binary, correct? If that's the case, why even bother running the self-installer and install it via the npm registry at all? Why not just download the binary directly from GitHub release?

GitHub Release does not support version ranges (e.g. ^6.17.1), so we must resolve to the correct version ourselves. Or just fallback to npm. Or drop support for version ranges entirely.

KSXGitHub avatar Feb 10 '22 03:02 KSXGitHub

@zkochan When will you resolve my requests for change in this PR?

KSXGitHub avatar Feb 21 '22 03:02 KSXGitHub

I have to think about it. Not soon.

zkochan avatar Feb 21 '22 09:02 zkochan

Curious if this would be easier to move forward with if it's opt-in via an option (eg. binary: true)?

privatenumber avatar Oct 19 '22 02:10 privatenumber

I agree with @privatenumber . Since this branch is very old and differs significantly from the latest master, I forked this action and implemented an option to install a self-contained binary.

I will post another PR after I add the test and update the readme.

tksst avatar Mar 30 '23 03:03 tksst

Good job @tksst .

I think adding a node-version option, detect it and auto switch pnpm@version to @pnpm/exe@version is better.

e.g.

jobs:
  build:
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        node-version: [14.x, 16.x, 18.x]
        os: [ubuntu-latest, windows-latest]
    steps:
      - name: Install pnpm
        uses: pnpm/[email protected]
        with:
          # in the node 14.x env, we auto install `@pnpm/exe` instead of `pnpm`
          # refer: https://pnpm.io/installation#compatibility
          node-version: ${{ matrix.node-version }}
          version: 8

      - name: Use Node.js ${{ matrix.node-version }}
        uses: actions/setup-node@v3
        with:
          node-version: ${{ matrix.node-version }}
          cache: 'pnpm'

fz6m avatar Apr 01 '23 09:04 fz6m

@fz6m

I think adding a node-version option, detect it and auto switch pnpm@version to @pnpm/exe@version is better.

That is a nice feature, but a bit complicated.
I may try to implement it when I have time.

tksst avatar Apr 02 '23 05:04 tksst

After thinking about how to implement this feature, I gave up trying to implement it. The node-version option of setup-node can take various values. For example, "^18.0.0", ">=18.0.0", "lts/*", etc. I need to implement the same logic to determine the version as actions/setup-node. This is difficult.

tksst avatar Apr 04 '23 14:04 tksst