From e00f83b3c24c1770a058f47908e76a63da8af688 Mon Sep 17 00:00:00 2001 From: Morten Midtgaard Rasmussen Date: Wed, 4 Jan 2023 11:59:10 +0100 Subject: [PATCH] fix: lookup pnpm store path (#51) * fix: lookup pnpm store path * build: bump package version Co-authored-by: James Henry --- .github/workflows/nx-cloud-agents.yml | 7 ++++++- .github/workflows/nx-cloud-main.yml | 7 ++++++- README.md | 12 ++++++------ package.json | 2 +- 4 files changed, 19 insertions(+), 9 deletions(-) diff --git a/.github/workflows/nx-cloud-agents.yml b/.github/workflows/nx-cloud-agents.yml index 404f9b8..5664420 100644 --- a/.github/workflows/nx-cloud-agents.yml +++ b/.github/workflows/nx-cloud-agents.yml @@ -123,11 +123,16 @@ jobs: restore-keys: | ${{ runner.os }}-node-${{ steps.versions.outputs.node_version }}- + - name: Get pnpm cache directory path + if: steps.package_manager.outputs.name == 'pnpm' + id: pnpm-cache-dir-path + run: echo "dir=$(pnpm store path)" >> $GITHUB_OUTPUT + - name: Use the node_modules cache if available [pnpm] if: steps.package_manager.outputs.name == 'pnpm' uses: actions/cache@v3 with: - path: ~/.pnpm-store + path: ${{ steps.pnpm-cache-dir-path.outputs.dir }} key: ${{ runner.os }}-node-${{ steps.versions.outputs.node_version }}-${{ hashFiles('**/pnpm-lock.yaml') }} restore-keys: | ${{ runner.os }}-node-${{ steps.versions.outputs.node_version }}- diff --git a/.github/workflows/nx-cloud-main.yml b/.github/workflows/nx-cloud-main.yml index 562179f..7353fb5 100644 --- a/.github/workflows/nx-cloud-main.yml +++ b/.github/workflows/nx-cloud-main.yml @@ -150,11 +150,16 @@ jobs: restore-keys: | ${{ runner.os }}-node-${{ steps.versions.outputs.node_version }}- + - name: Get pnpm cache directory path + if: steps.package_manager.outputs.name == 'pnpm' + id: pnpm-cache-dir-path + run: echo "dir=$(pnpm store path)" >> $GITHUB_OUTPUT + - name: Use the node_modules cache if available [pnpm] if: steps.package_manager.outputs.name == 'pnpm' uses: actions/cache@v3 with: - path: ~/.pnpm-store + path: ${{ steps.pnpm-cache-dir-path.outputs.dir }} key: ${{ runner.os }}-node-${{ steps.versions.outputs.node_version }}-${{ hashFiles('**/pnpm-lock.yaml') }} restore-keys: | ${{ runner.os }}-node-${{ steps.versions.outputs.node_version }}- diff --git a/README.md b/README.md index b430e78..5cc5f16 100644 --- a/README.md +++ b/README.md @@ -60,7 +60,7 @@ concurrency: jobs: main: name: Nx Cloud - Main Job - uses: nrwl/ci/.github/workflows/nx-cloud-main.yml@v0.11.1 + uses: nrwl/ci/.github/workflows/nx-cloud-main.yml@v0.11.2 with: # NOTE: Here we are using the special `nx-cloud record` command to ensure that any commands we run that do not go through the cloud task runner natively # (i.e. anything that starts with `nx run`/`nx run-many`/`nx affected --target`), are still captured in the Nx Cloud UI and Github App comment for @@ -75,7 +75,7 @@ jobs: agents: name: Nx Cloud - Agents - uses: nrwl/ci/.github/workflows/nx-cloud-agents.yml@v0.11.1 + uses: nrwl/ci/.github/workflows/nx-cloud-agents.yml@v0.11.2 with: number-of-agents: 3 ``` @@ -110,7 +110,7 @@ concurrency: jobs: main: name: Nx Cloud - Main Job - uses: nrwl/ci/.github/workflows/nx-cloud-main.yml@v0.11.1 + uses: nrwl/ci/.github/workflows/nx-cloud-main.yml@v0.11.2 secrets: NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }} NX_CLOUD_AUTH_TOKEN: ${{ secrets.NX_CLOUD_AUTH_TOKEN }} @@ -118,7 +118,7 @@ jobs: agents: name: Nx Cloud - Agents - uses: nrwl/ci/.github/workflows/nx-cloud-agents.yml@v0.11.1 + uses: nrwl/ci/.github/workflows/nx-cloud-agents.yml@v0.11.2 secrets: NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }} NX_CLOUD_AUTH_TOKEN: ${{ secrets.NX_CLOUD_AUTH_TOKEN }} @@ -134,7 +134,7 @@ See the annotated configuration below for all explicitly supported secret values ```yaml -- uses: nrwl/ci/.github/workflows/nx-cloud-main.yml@v0.11.1 +- uses: nrwl/ci/.github/workflows/nx-cloud-main.yml@v0.11.2 # [OPTIONAL] Explicitly supported secret values which can be passed into the workflow from your outer workflow run. # # NOTE: You cannot access values from ${{ secrets }} beyond what is explicitly specified here because of the limitations of reusable Github workflows @@ -249,7 +249,7 @@ See the annotated configuration below for all explicitly supported secret values ```yaml -- uses: nrwl/ci/.github/workflows/nx-cloud-agents.yml@v0.11.1 +- uses: nrwl/ci/.github/workflows/nx-cloud-agents.yml@v0.11.2 # [OPTIONAL] Explicitly supported secret values which can be passed into the workflow from your outer workflow run. # # NOTE: You cannot access values from ${{ secrets }} beyond what is explicitly specified here because of the limitations of reusable Github workflows diff --git a/package.json b/package.json index 9df7f14..e21df9a 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { "private": true, - "version": "0.11.1", + "version": "0.11.2", "description": "This package.json is here purely to control the version of the Action, in combination with https://github.com/JamesHenry/publish-shell-action" }