Skip to content

Commit

Permalink
build: Use Bun instead of pnpm
Browse files Browse the repository at this point in the history
  • Loading branch information
siketyan committed Sep 8, 2023
1 parent b47283c commit 1bea10a
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 693 deletions.
22 changes: 8 additions & 14 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,16 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v3
- uses: oven-sh/setup-bun@v1
with:
node-version: '20'

- run: corepack enable pnpm

- id: pnpm-cache
shell: bash
run: echo "path=$(pnpm store path)" >> "${GITHUB_OUTPUT}"
bun-version: '1.0.0'

- uses: actions/cache@v3
with:
path: ${{ steps.pnpm-cache.outputs.path }}
key: ${{ runner.os }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: ${{ runner.os }}-pnpm-
path: ~/.bun/install/cache
key: ${{ runner.os }}-bun-${{ hashFiles('bun.lockb') }}
restore-keys: ${{ runner.os }}-bun-

- run: pnpm install --frozen-lockfile
- run: pnpm run check
- run: pnpm run build
- run: bun install --frozen-lockfile
- run: bun run check
- run: bun run build
8 changes: 4 additions & 4 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: Release
run-name: Release ${{ inputs.version }}

on:
workflow_dispatch:
Expand All @@ -17,12 +18,11 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v3
- uses: oven-sh/setup-bun@v1
with:
node-version: '20'

- run: corepack enable pnpm
bun-version: '1.0.0'

- uses: yumemi-inc/action-release-action@v2
with:
version: '${{ inputs.version }}'
build-command: 'bun install --frozen-lockfile && bun run build'
Binary file added bun.lockb
Binary file not shown.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"readme": "README.md",
"main": "index.js",
"scripts": {
"build": "esbuild index.ts --bundle --platform=node --outfile=dist/index.js",
"build": "bun build index.ts --target=node --outfile=dist/index.js",
"check": "biome format . && biome check .",
"fix": "biome format --write . && biome check --apply-unsafe ."
},
Expand Down
Loading

0 comments on commit 1bea10a

Please sign in to comment.