From 1dea7347b61d1efff5b02d9b8fff7f2bdae0b3dc Mon Sep 17 00:00:00 2001 From: rharkor Date: Tue, 26 Sep 2023 19:03:28 +0200 Subject: [PATCH] fix: siwtch env --- .github/workflows/release.yml | 6 ++---- scripts/runtime.ts | 16 ++++++++++++++++ 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e6cab199..6132b410 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -22,10 +22,8 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 - - name: Setup Node.js - uses: actions/setup-node@v3 - with: - node-version: "lts/*" + - name: Install bun + uses: oven-sh/setup-bun@v1 - name: Install dependencies run: bun install --frozen-lockfile - name: Verify the integrity of provenance attestations and registry signatures for installed dependencies diff --git a/scripts/runtime.ts b/scripts/runtime.ts index af16d24e..6d4a22d6 100644 --- a/scripts/runtime.ts +++ b/scripts/runtime.ts @@ -124,8 +124,24 @@ const basicFiles = [ replace: (oldRuntime: IRuntime, newRuntime: IRuntime, content: string) => { if (oldRuntime.npm === "npm" && newRuntime.npm === "bun") { content = content.replaceAll(`${oldRuntime.npm} ci`, `${newRuntime.npm} install --frozen-lockfile`) + content = content.replaceAll( + ` - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: "lts/*"`, + ` - name: Install bun + uses: oven-sh/setup-bun@v1` + ) } else if (oldRuntime.npm === "bun" && newRuntime.npm === "npm") { content = content.replaceAll(`${oldRuntime.npm} install --frozen-lockfile`, `${newRuntime.npm} ci`) + content = content.replaceAll( + ` - name: Install bun + uses: oven-sh/setup-bun@v1`, + ` - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: "lts/*"` + ) } return content.replaceAll(`${oldRuntime.npx} `, `${newRuntime.npx} `) },