Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -265,13 +265,15 @@ jobs:
build-cli-pr:
if: github.event_name == 'pull_request'
needs: [release-test]
runs-on: ubuntu-latest
runs-on: namespace-profile-linux-amd64-16gb
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-mise
- run: mise run codegen
- run: deno task pack
working-directory: ${{ github.workspace }}/packages/cli/
env:
CONCURRENCY: "3"
- uses: actions/upload-artifact@v4
with:
name: cli-pr-${{ github.event.pull_request.number }}
Expand Down Expand Up @@ -322,14 +324,16 @@ jobs:
build-cli:
if: github.event_name == 'push'
needs: [test, test-node, test-bun, test-cfworkers, lint, release-test, determine-version]
runs-on: ubuntu-latest
runs-on: namespace-profile-linux-amd64-16gb
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-mise
- uses: ./.github/actions/determine-version
- run: mise run codegen
- run: deno task pack
working-directory: ${{ github.workspace }}/packages/cli/
env:
CONCURRENCY: "3"
- uses: actions/upload-artifact@v4
with:
name: cli
Expand Down
20 changes: 16 additions & 4 deletions packages/cli/scripts/pack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,28 @@ async function pack(os: OS, arch: Arch): Promise<void> {
const osFilter = Deno.env.get("OS")?.toLowerCase();
const archFilter = Deno.env.get("ARCH")?.toLowerCase();

const promises: Promise<void>[] = [];
const tasks: Array<() => Promise<void>> = [];
for (const osKey in triplets) {
const os = osKey as OS;
if (osFilter != null && osFilter !== os) continue;
for (const arch in triplets[os]) {
if (archFilter != null && archFilter !== arch) continue;
const promise = pack(os, arch as Arch);
promises.push(promise);
tasks.push(() => pack(os, arch as Arch));
}
}
await Promise.all(promises);
const maxConcurrency = parseInt(
Deno.env.get("CONCURRENCY") ?? `${tasks.length}`,
);
const executing = new Set<Promise<void>>();
for (const task of tasks) {
const p = task().then(() => {
executing.delete(p);
});
executing.add(p);
if (executing.size >= maxConcurrency) {
await Promise.race(executing);
}
}
await Promise.all(executing);

// cSpell: ignore cfvz
Loading