Skip to content

Commit

Permalink
✨ add pnpm ci cache (#385)
Browse files Browse the repository at this point in the history
* ✨  add pnpm ci cache

* 📝  about pnpm/actions-setup
  • Loading branch information
JiangWeixian committed Jul 15, 2023
1 parent 7deccc1 commit 236e74c
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 6 deletions.
5 changes: 5 additions & 0 deletions .changeset/thirty-bears-doubt.md
@@ -0,0 +1,5 @@
---
"@aiou/generator-pnpm-ci": minor
---

add pnpm ci cache
3 changes: 3 additions & 0 deletions packages/generators/pnpm-ci/README.md
Expand Up @@ -10,6 +10,9 @@ neo run @aiou/generator-pnpm-ci

prepack follow parts into your project

> **💡 NOTE**
CI workflows will automatic choose pnpm version and cache `.pnpm-store` via <https://github.com/pnpm/action-setup>.
- `release.yml` - publish package with `changeset`
- `snapshot-release.yml` - publish prerelease package with `changeset`
- `husky`
Expand Down
19 changes: 17 additions & 2 deletions packages/generators/pnpm-ci/assets/workflows/ci.yml
Expand Up @@ -23,8 +23,23 @@ jobs:
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Install pnpm
run: npm i pnpm@7.32.1 -g
- uses: pnpm/action-setup@v2
name: Install pnpm
id: pnpm-install
with:
run_install: false
- name: get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
name: setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install
run: |
pnpm install --frozen-lockfile=false
Expand Down
19 changes: 17 additions & 2 deletions packages/generators/pnpm-ci/assets/workflows/release.yml
Expand Up @@ -27,8 +27,23 @@ jobs:
uses: actions/setup-node@v2
with:
node-version: 14
- name: install pnpm
run: npm i pnpm@7.32.1 -g
- uses: pnpm/action-setup@v2
name: Install pnpm
id: pnpm-install
with:
run_install: false
- name: get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
name: setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: install dependencies
run: pnpm install --frozen-lockfile=false
- name: create and publish versions
Expand Down
19 changes: 17 additions & 2 deletions packages/generators/pnpm-ci/assets/workflows/snapshot-release.yml
Expand Up @@ -25,8 +25,23 @@ jobs:
uses: actions/setup-node@v2
with:
node-version: 14
- name: install pnpm
run: npm i pnpm@7.32.1 -g
- uses: pnpm/action-setup@v2
name: Install pnpm
id: pnpm-install
with:
run_install: false
- name: get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
name: setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: install dependencies
run: pnpm install --frozen-lockfile=false
- name: create and publish versions
Expand Down

0 comments on commit 236e74c

Please sign in to comment.