diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 789c744..acca6a3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -78,7 +78,7 @@ jobs: if: startsWith(matrix.config.os, 'windows') uses: GuillaumeFalourd/setup-windows10-sdk-action@v2 with: - sdk-version: 26100 + s dk-version: 26100 - name: Install dependencies on ubuntu if: startsWith(matrix.config.name, 'Ubuntu') @@ -133,8 +133,13 @@ jobs: echo github.event.action: ${{ github.event.action }} echo github.event_name: ${{ github.event_name }} + - name: Download artifacts + uses: actions/download-artifact@v4 + with: + path: dist + - name: Build shell: bash run: | + ls -R npm ci - node build/download-run-artifacts.js "--repo=${{ github.repository }}" "--run_id=${{ github.run_id }}" diff --git a/build/download-run-artifacts.js b/build/download-run-artifacts.js index bca7123..019e9fc 100644 --- a/build/download-run-artifacts.js +++ b/build/download-run-artifacts.js @@ -8,13 +8,19 @@ import { } from './utils.js' async function downloadFileFromZip(url, filepath) { + console.log('downloading:', url); const res = await fetch(url); + if (res.status !== 200) { + const text = await res.text(); + throw new Error(`url: ${url}\n${text}`); + } + console.log(res.status, res.bytes); const zipData = await res.arrayBuffer(); const {entries} = await unzip(zipData); return Promise.all(Object.entries(entries).map(async ([name, entry]) => { const data = await entry.arrayBuffer(); const filename = path.join(filepath, name); - console.log('downloaded:', filename); + console.log('extracted:', filename); fs.mkdirSync(filepath, {recursive: true}); fs.writeFileSync(filename, new Uint8Array(data)); return filename; @@ -90,6 +96,8 @@ const data = { } ] } + +https://github.com/greggman/node-webgpu/actions/runs/12618872732/artifacts/2387232364 */ const [owner, repo] = args.repo.split('/'); @@ -101,5 +109,8 @@ const data = await github.getRunArtifacts({ const filenames = await Promise.all( data.artifacts .filter(({name}) => name?.endsWith('.node')) - .map(({archive_download_url}) => downloadFileFromZip(archive_download_url, 'dist')) + .map(({id}) => { + const url = `https://github.com/${owner}/${repo}/actions/runs/${args.run_id}/artifacts/${id}`; + return downloadFileFromZip(url, 'dist'); + }) );