Skip to content

Commit

Permalink
chore: change pnpm
Browse files Browse the repository at this point in the history
  • Loading branch information
naporin0624 committed Oct 15, 2024
1 parent a6ef72c commit 959a7a0
Show file tree
Hide file tree
Showing 6 changed files with 84 additions and 41 deletions.
68 changes: 48 additions & 20 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ on:
required: true
default: "main"

env:
PNPM_VERSION: 9.12.1

jobs:
setup:
runs-on: ubuntu-latest
Expand All @@ -21,16 +24,21 @@ jobs:
with:
ref: ${{ github.head_ref || github.event.inputs.branch }}

- name: Set up Bun
uses: oven-sh/setup-bun@v2
- uses: actions/setup-node@v4
with:
node-version-file: package.json

- uses: pnpm/action-setup@v4
with:
version: ${{ env.PNPM_VERSION }}

- name: Cache node_modules
uses: ./.github/actions/cache-node-modules
with:
path: "**/node_modules"

- name: Install dependencies
run: bun install
run: pnpm install

test:
runs-on: ubuntu-latest
Expand All @@ -40,19 +48,24 @@ jobs:
with:
ref: ${{ github.head_ref || github.event.inputs.branch }}

- name: Set up Bun
uses: oven-sh/setup-bun@v2
- uses: actions/setup-node@v4
with:
node-version-file: package.json

- uses: pnpm/action-setup@v4
with:
version: ${{ env.PNPM_VERSION }}

- name: Cache node_modules
uses: ./.github/actions/cache-node-modules
with:
path: "**/node_modules"

- name: Install dependencies
run: bun install
run: pnpm install

- name: Run tests
run: bun run test
run: pnpm run test

lint:
runs-on: ubuntu-latest
Expand All @@ -62,19 +75,24 @@ jobs:
with:
ref: ${{ github.head_ref || github.event.inputs.branch }}

- name: Set up Bun
uses: oven-sh/setup-bun@v2
- uses: actions/setup-node@v4
with:
node-version-file: package.json

- uses: pnpm/action-setup@v4
with:
version: ${{ env.PNPM_VERSION }}

- name: Cache node_modules
uses: ./.github/actions/cache-node-modules
with:
path: "**/node_modules"

- name: Install dependencies
run: bun install
run: pnpm install

- name: Run linter
run: bun run lint
run: pnpm run lint

typecheck:
runs-on: ubuntu-latest
Expand All @@ -84,19 +102,24 @@ jobs:
with:
ref: ${{ github.head_ref || github.event.inputs.branch }}

- name: Set up Bun
uses: oven-sh/setup-bun@v2
- uses: actions/setup-node@v4
with:
node-version-file: package.json

- uses: pnpm/action-setup@v4
with:
version: ${{ env.PNPM_VERSION }}

- name: Cache node_modules
uses: ./.github/actions/cache-node-modules
with:
path: "**/node_modules"

- name: Install dependencies
run: bun install
run: pnpm install

- name: Run typecheck
run: bun run typecheck
run: pnpm run typecheck

build:
runs-on: ubuntu-latest
Expand All @@ -106,18 +129,23 @@ jobs:
with:
ref: ${{ github.head_ref || github.event.inputs.branch }}

- name: Set up Bun
uses: oven-sh/setup-bun@v2
- uses: actions/setup-node@v4
with:
node-version-file: package.json

- uses: pnpm/action-setup@v4
with:
version: ${{ env.PNPM_VERSION }}

- name: Cache node_modules
uses: ./.github/actions/cache-node-modules
with:
path: "**/node_modules"

- name: Install dependencies
run: bun install
run: pnpm install

- name: Build
run: |
bun run build
bunx publint
pnpm run build
pnpx publint
14 changes: 10 additions & 4 deletions .github/workflows/package-size.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
PNPM_VERSION: 9.12.1

jobs:
pkg-size-report:
name: Package Size Report
Expand All @@ -16,10 +19,13 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
- uses: actions/setup-node@v4
with:
node-version-file: package.json

- uses: pnpm/action-setup@v4
with:
node-version: "20.x"
version: ${{ env.PNPM_VERSION }}

- name: Set up Bun
uses: oven-sh/setup-bun@v2
Expand All @@ -32,7 +38,7 @@ jobs:
- name: Package size report
uses: preactjs/compressed-size-action@v2
with:
install-script: "bun install"
install-script: "pnpm install"
build-script: "build"
pattern: "./dist/**/*.{js}"
exclude: "{**/*.map,**/node_modules/**}"
17 changes: 10 additions & 7 deletions .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
PNPM_VERSION: 9.12.1

jobs:
pre-release:
runs-on: ubuntu-latest
Expand All @@ -14,23 +17,23 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

- run: corepack enable
- uses: actions/setup-node@v4
with:
node-version: "20.x"
node-version-file: package.json

- name: Set up Bun
uses: oven-sh/setup-bun@v2
- uses: pnpm/action-setup@v4
with:
version: ${{ env.PNPM_VERSION }}

- name: Cache node_modules
uses: ./.github/actions/cache-node-modules
with:
path: "**/node_modules"

- name: Install dependencies
run: bun install
run: pnpm install

- name: Build
run: bun run build
run: pnpm run build

- run: bunx pkg-pr-new publish
- run: pnpx pkg-pr-new publish
21 changes: 12 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
PNPM_VERSION: 9.12.1

jobs:
release:
name: Release
Expand All @@ -18,32 +21,32 @@ jobs:
- name: Checkout Repo
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
- uses: actions/setup-node@v4
with:
node-version: "20.x"
node-version-file: package.json

- name: Set up Bun
uses: oven-sh/setup-bun@v2
- uses: pnpm/action-setup@v4
with:
version: ${{ env.PNPM_VERSION }}

- name: Cache node_modules
uses: ./.github/actions/cache-node-modules
with:
path: "**/node_modules"

- name: Install dependencies
run: bun install
run: pnpm install

- name: Build
run: |
bun run build
bunx publint
pnpm run build
pnpx publint
- name: Create Release Pull Request
id: changesets
uses: changesets/action@v1
with:
publish: bun run release
publish: pnpm run release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
2 changes: 2 additions & 0 deletions .mise.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[tools]
pnpm = "9.12.1"
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,5 +78,6 @@
"dependencies": {
"@hono/zod-validator": "^0.2.2",
"zod": "^3.23.8"
}
},
"packageManager": "pnpm@9.12.1"
}

0 comments on commit 959a7a0

Please sign in to comment.