Skip to content

Commit 4979344

Browse files
committed
ci: share Nix sticky disks per platform
Remove the cache-profile input from the setup-nix action so each OS and architecture uses one shared /nix sticky disk. The Nix store is content-addressed and safe to share within the platform scope, so keeping separate package and dev profiles only fragments the cache and doubles GC work. Simplify the weekly sticky disk GC matrix to match the shared Linux platform keys. Restore the npm publish job shape to the existing GitHub-hosted OIDC publishing flow; only the native package build jobs need the Blacksmith runner migration.
1 parent a8d686b commit 4979344

5 files changed

Lines changed: 10 additions & 72 deletions

File tree

‎.github/actions/setup-nix/action.yaml‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
name: Setup Nix
22
description: Install Nix and optionally mount a Blacksmith sticky disk for the Nix store
33
inputs:
4-
cache-profile:
5-
description: Which Nix sticky disk key scope to use
6-
default: package
74
warm-dev-shell:
85
description: Whether to instantiate the CI dev shell during setup
96
default: 'false'
@@ -21,7 +18,7 @@ runs:
2118
if: runner.os == 'Linux'
2219
uses: useblacksmith/stickydisk@d58829ad6f9be8822ec5efe74256c82cd62915ab # v1
2320
with:
24-
key: ${{ github.repository }}-nix-${{ inputs.cache-profile }}-${{ runner.os }}-${{ runner.arch }}
21+
key: ${{ github.repository }}-nix-${{ runner.os }}-${{ runner.arch }}
2522
path: /nix
2623
commit: on-change
2724

‎.github/workflows/cache-gc.yaml‎

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ permissions: read-all
99

1010
jobs:
1111
nix-store-gc:
12-
name: Nix store GC (${{ matrix.profile }}, ${{ matrix.name }})
12+
name: Nix store GC (${{ matrix.name }})
1313
runs-on: ${{ matrix.runner }}
1414
timeout-minutes: 20
1515
strategy:
@@ -18,23 +18,13 @@ jobs:
1818
include:
1919
- name: linux-arm64
2020
runner: blacksmith-32vcpu-ubuntu-2404-arm
21-
profile: package
2221
- name: linux-x64
2322
runner: blacksmith-32vcpu-ubuntu-2404
24-
profile: package
25-
- name: linux-arm64
26-
runner: blacksmith-32vcpu-ubuntu-2404-arm
27-
profile: dev
28-
- name: linux-x64
29-
runner: blacksmith-32vcpu-ubuntu-2404
30-
profile: dev
3123

3224
steps:
3325
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
3426
with:
3527
persist-credentials: false
3628
- uses: ./.github/actions/setup-nix
37-
with:
38-
cache-profile: ${{ matrix.profile }}
3929
- name: Delete Nix store paths older than 7 days
4030
run: nix-collect-garbage --delete-older-than 7d

‎.github/workflows/ci.yaml‎

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ jobs:
2828
steps:
2929
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
3030
- uses: ./.github/actions/setup-nix
31-
with:
32-
cache-profile: dev
3331
- run: nix develop ./dev#ci --command just flake-check
3432
- run: nix develop ./dev#ci --command just typecheck
3533

@@ -49,8 +47,6 @@ jobs:
4947
ref: ${{ github.event.pull_request.head.sha || github.sha }}
5048
persist-credentials: false
5149
- uses: ./.github/actions/setup-nix
52-
with:
53-
cache-profile: dev
5450
- run: nix develop ./dev#ci --command just install
5551
- name: Create default Claude directories for tests
5652
run: |
@@ -253,8 +249,6 @@ jobs:
253249

254250
- name: Setup Nix
255251
uses: ./.github/actions/setup-nix
256-
with:
257-
cache-profile: dev
258252

259253
- name: Resolve PR preview package URL
260254
env:
@@ -326,8 +320,6 @@ jobs:
326320

327321
- name: Setup Nix
328322
uses: ./.github/actions/setup-nix
329-
with:
330-
cache-profile: dev
331323

332324
- name: Resolve PR preview package URL
333325
env:

‎.github/workflows/release.yaml‎

Lines changed: 8 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -87,19 +87,23 @@ jobs:
8787
path: ccusage-native-${{ matrix.platform }}-${{ matrix.arch }}.tar
8888
if-no-files-found: error
8989

90-
npm-pack:
90+
npm:
9191
needs:
9292
- build-native-packages
93-
runs-on: blacksmith-32vcpu-ubuntu-2404-arm
93+
runs-on: ubuntu-24.04-arm
9494
timeout-minutes: 10
9595
permissions:
96-
actions: read
9796
contents: read
97+
id-token: write
9898
steps:
9999
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
100100
with:
101101
fetch-depth: 0
102102
- uses: ./.github/actions/setup-nix
103+
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
104+
with:
105+
registry-url: 'https://registry.npmjs.org'
106+
node-version: lts/*
103107
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
104108
with:
105109
pattern: ccusage-native-*
@@ -111,46 +115,7 @@ jobs:
111115
tar -xf "$archive"
112116
done
113117
- run: nix develop ./dev#ci --command just install
114-
- name: Pack npm packages
115-
run: |
116-
mkdir -p "$RUNNER_TEMP/npm-packages"
117-
nix develop ./dev#ci --command pnpm --filter='./apps/ccusage' --filter='./packages/ccusage-*' pack --pack-destination "$RUNNER_TEMP/npm-packages"
118-
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
119-
with:
120-
name: npm-packages
121-
path: ${{ runner.temp }}/npm-packages/*.tgz
122-
if-no-files-found: error
123-
124-
npm:
125-
needs:
126-
- npm-pack
127-
runs-on: ubuntu-24.04-arm
128-
timeout-minutes: 10
129-
permissions:
130-
actions: read
131-
contents: read
132-
id-token: write
133-
steps:
134-
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
135-
with:
136-
fetch-depth: 0
137-
persist-credentials: false
138-
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
139-
with:
140-
registry-url: 'https://registry.npmjs.org'
141-
node-version: lts/*
142-
package-manager-cache: false
143-
- run: corepack enable pnpm
144-
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
145-
with:
146-
name: npm-packages
147-
path: ${{ runner.temp }}/npm-packages
148-
- name: Publish npm packages
149-
shell: bash
150-
run: |
151-
while IFS= read -r package; do
152-
pnpm publish "$package" --provenance --no-git-checks --access public
153-
done < <(find "$RUNNER_TEMP/npm-packages" -name '*.tgz' -type f | sort)
118+
- run: nix develop ./dev#ci --command pnpm --filter='./apps/ccusage' --filter='./packages/ccusage-*' publish --provenance --no-git-checks --access public
154119

155120
release:
156121
needs:
@@ -163,8 +128,6 @@ jobs:
163128
with:
164129
fetch-depth: 0
165130
- uses: ./.github/actions/setup-nix
166-
with:
167-
cache-profile: dev
168131
- run: nix develop ./dev#ci --command just install
169132
- run: nix develop ./dev#ci --command pnpm changelogithub
170133
env:

‎.github/workflows/update-pricing.yaml‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ jobs:
1818
with:
1919
persist-credentials: false
2020
- uses: ./.github/actions/setup-nix
21-
with:
22-
cache-profile: dev
2321
- name: Capture current LiteLLM pricing JSON
2422
run: |
2523
rev="$(jq -r '.nodes.litellm.locked.rev' flake.lock)"
@@ -91,8 +89,6 @@ jobs:
9189
with:
9290
persist-credentials: false
9391
- uses: ./.github/actions/setup-nix
94-
with:
95-
cache-profile: dev
9692
- name: Update models.dev input
9793
run: |
9894
nix flake update models-dev

0 commit comments

Comments
 (0)