Skip to content

Commit 0e1a48c

Browse files
SamyPessegregberge
andauthored
Upgrade bun and setup-bun, switch to text lockfile (#2651)
Co-authored-by: Greg Bergé <[email protected]>
1 parent 98245e5 commit 0e1a48c

File tree

8 files changed

+46
-47
lines changed

8 files changed

+46
-47
lines changed

Diff for: .bun-version

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1.1.40

Diff for: .github/composite/setup-bun/action.yaml

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: 'Setup Bun'
2+
description: 'Install Bun and cache dependencies'
3+
runs:
4+
using: 'composite'
5+
steps:
6+
# We cache dependencies even if Bun is fast to avoid downloading fontawesome too many times
7+
# and impacting bandwidth there.
8+
- name: Cache bun
9+
uses: actions/cache@v4
10+
with:
11+
path: ~/.bun/install/cache
12+
key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lockb') }}-${{ hashFiles('**/bun.lock') }}
13+
restore-keys: |
14+
${{ runner.os }}-bun-
15+
- name: Setup bun
16+
uses: oven-sh/setup-bun@v2
17+
with:
18+
bun-version-file: '.bun-version'

Diff for: .github/workflows/ci.yaml

+19-35
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
branches:
66
- main
77
env:
8-
NPMRC_FONT_AWESOME_TOKEN: ${{ secrets.NPMRC_FONT_AWESOME_TOKEN }}
8+
NPM_TOKEN_READONLY: ${{ secrets.NPM_TOKEN_READONLY }}
99
jobs:
1010
deploy:
1111
name: Deploy to Cloudflare Pages
@@ -22,10 +22,8 @@ jobs:
2222
steps:
2323
- name: Checkout
2424
uses: actions/checkout@v4
25-
- name: Setup bun
26-
uses: oven-sh/setup-bun@v1
27-
with:
28-
bun-version: 1.1.18
25+
- name: Setup Bun
26+
uses: ./.github/composite/setup-bun
2927
- name: Install dependencies
3028
run: bun install --frozen-lockfile
3129
env:
@@ -102,10 +100,8 @@ jobs:
102100
steps:
103101
- name: Checkout
104102
uses: actions/checkout@v4
105-
- name: Setup bun
106-
uses: oven-sh/setup-bun@v1
107-
with:
108-
bun-version: 1.1.18
103+
- name: Setup Bun
104+
uses: ./.github/composite/setup-bun
109105
- name: Install dependencies
110106
run: bun install --frozen-lockfile
111107
- name: Setup Playwright
@@ -128,10 +124,8 @@ jobs:
128124
steps:
129125
- name: Checkout
130126
uses: actions/checkout@v4
131-
- name: Setup bun
132-
uses: oven-sh/setup-bun@v1
133-
with:
134-
bun-version: 1.1.18
127+
- name: Setup Bun
128+
uses: ./.github/composite/setup-bun
135129
- name: Install dependencies
136130
run: bun install --frozen-lockfile
137131
env:
@@ -147,10 +141,8 @@ jobs:
147141
steps:
148142
- name: Checkout
149143
uses: actions/checkout@v4
150-
- name: Setup bun
151-
uses: oven-sh/setup-bun@v1
152-
with:
153-
bun-version: 1.1.18
144+
- name: Setup Bun
145+
uses: ./.github/composite/setup-bun
154146
- name: Install dependencies
155147
run: bun install --frozen-lockfile
156148
env:
@@ -162,10 +154,8 @@ jobs:
162154
steps:
163155
- name: Checkout
164156
uses: actions/checkout@v4
165-
- name: Setup bun
166-
uses: oven-sh/setup-bun@v1
167-
with:
168-
bun-version: 1.1.18
157+
- name: Setup Bun
158+
uses: ./.github/composite/setup-bun
169159
- name: Install dependencies
170160
run: bun install --frozen-lockfile
171161
env:
@@ -177,10 +167,8 @@ jobs:
177167
steps:
178168
- name: Checkout
179169
uses: actions/checkout@v4
180-
- name: Setup bun
181-
uses: oven-sh/setup-bun@v1
182-
with:
183-
bun-version: 1.1.18
170+
- name: Setup Bun
171+
uses: ./.github/composite/setup-bun
184172
- name: Install dependencies
185173
run: bun install --frozen-lockfile
186174
env:
@@ -191,16 +179,14 @@ jobs:
191179
runs-on: ubuntu-latest
192180
name: Build (Open Source)
193181
env:
194-
NPMRC_FONT_AWESOME_TOKEN: ''
182+
NPM_TOKEN_READONLY: ''
195183
steps:
196184
- name: Checkout
197185
uses: actions/checkout@v4
198-
- name: Setup bun
199-
uses: oven-sh/setup-bun@v1
200-
with:
201-
bun-version: 1.1.18
186+
- name: Setup Bun
187+
uses: ./.github/composite/setup-bun
202188
- name: Install dependencies
203-
run: bun install --frozen-lockfile
189+
run: bun install
204190
env:
205191
PUPPETEER_SKIP_DOWNLOAD: 1
206192
- run: bun run build
@@ -210,10 +196,8 @@ jobs:
210196
steps:
211197
- name: Checkout
212198
uses: actions/checkout@v4
213-
- name: Setup bun
214-
uses: oven-sh/setup-bun@v1
215-
with:
216-
bun-version: 1.1.18
199+
- name: Setup Bun
200+
uses: ./.github/composite/setup-bun
217201
- name: Install dependencies
218202
run: bun install --frozen-lockfile
219203
env:

Diff for: .github/workflows/publish.yaml

+5-9
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,8 @@ jobs:
1717
with:
1818
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
1919
fetch-depth: 0
20-
- name: Setup bun
21-
uses: oven-sh/setup-bun@v1
22-
with:
23-
bun-version: 1.1.18
20+
- name: Setup Bun
21+
uses: ./.github/composite/setup-bun
2422
- name: Install dependencies
2523
run: bun install --frozen-lockfile
2624
env:
@@ -34,7 +32,7 @@ jobs:
3432
# Using a PAT instead of GITHUB_TOKEN because we need to run workflows when releases are created
3533
# https://github.com/orgs/community/discussions/26875#discussioncomment-3253761
3634
GITHUB_TOKEN: ${{ secrets.GH_PERSONAL_TOKEN }}
37-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
35+
NPM_TOKEN_READONLY: ${{ secrets.NPM_TOKEN_READONLY }}
3836
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
3937
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
4038
release-preview:
@@ -45,10 +43,8 @@ jobs:
4543
steps:
4644
- name: Checkout Repo
4745
uses: actions/checkout@v3
48-
- name: Setup bun
49-
uses: oven-sh/setup-bun@v1
50-
with:
51-
bun-version: 1.1.18
46+
- name: Setup Bun
47+
uses: ./.github/composite/setup-bun
5248
- name: Install dependencies
5349
run: bun install --frozen-lockfile
5450
env:

Diff for: bun.lockb

224 Bytes
Binary file not shown.

Diff for: bunfig.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
[install.scopes]
2-
"awesome.me" = { token = "$NPMRC_FONT_AWESOME_TOKEN", url = "https://npm.fontawesome.com/" }
2+
"gitbook" = { token = "$NPM_TOKEN_READONLY", url = "https://registry.npmjs.org" }

Diff for: packages/icons/bin/kit.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export function getKitPath() {
1111
try {
1212
source = path.resolve(
1313
path.dirname(
14-
url.fileURLToPath(import.meta.resolve('@awesome.me/kit-a463935e93/package.json')),
14+
url.fileURLToPath(import.meta.resolve('@gitbook/fontawesome-pro/package.json')),
1515
),
1616
'icons',
1717
);

Diff for: packages/icons/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"@fortawesome/fontawesome-free": "^6.6.0"
2323
},
2424
"optionalDependencies": {
25-
"@awesome.me/kit-a463935e93": "1.0.8"
25+
"@gitbook/fontawesome-pro": "1.0.8"
2626
},
2727
"devDependencies": {
2828
"typescript": "^5.5.3"

0 commit comments

Comments
 (0)