From a4fb1ca1cc2db60f3d5a12f50245c9c824903079 Mon Sep 17 00:00:00 2001 From: Gregg Tavares Date: Sun, 5 Jan 2025 19:37:17 -0800 Subject: [PATCH] try if ref --- .github/workflows/build.yml | 6 +++++- README.md | 3 ++- build/build.js | 27 --------------------------- 3 files changed, 7 insertions(+), 29 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 745bada..8aaf682 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -61,6 +61,7 @@ jobs: run: | echo github.event.action: ${{ github.event.action }} echo github.event_name: ${{ github.event_name }} + echo github.ref: ${{ github.ref }} - name: Install dependencies on windows if: startsWith(matrix.config.os, 'windows') @@ -98,6 +99,7 @@ jobs: shell: bash run: | npm ci + echo "${{ github.event_name }}" npm run build - name: Upload Artifact ⬆️ @@ -117,7 +119,7 @@ jobs: needs: build name: package-and-publish runs-on: ubuntu-latest - if: github.event_name == 'release' + if: ${{ startsWith(github.ref, 'refs/tags/') }} steps: - name: Checkout uses: actions/checkout@v4 @@ -133,6 +135,8 @@ jobs: run: | echo github.event.action: ${{ github.event.action }} echo github.event_name: ${{ github.event_name }} + echo github.ref: ${{ github.ref }} + echo github.ref_type: ${{ github.ref_type }} - name: Download artifacts uses: actions/download-artifact@v4 diff --git a/README.md b/README.md index e318423..68bac96 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,8 @@ Provides webgpu to node [Dawn](https://dawn.googlesource.com/dawn) is an implementation of [WebGPU](https://gpuweb.github.io/gpuweb/). -It includes a node plugin and this repo builds that plugin. +It includes a node plugin and this repo builds that plugin and publishes +it on npm. ## Usage diff --git a/build/build.js b/build/build.js index 2194e52..5e959ed 100644 --- a/build/build.js +++ b/build/build.js @@ -17,19 +17,6 @@ prependPathIfItExists(depotToolsPath); appendPathIfItExists('/Applications/CMake.app/Contents/bin'); appendPathIfItExists('C:\\Program Files\\CMake\\bin'); -function fixupPackageJson(filename) { - const pkg = JSON.parse(fs.readFileSync('package.json', {encoding: 'utf8'})); - const vsPkg = JSON.parse(fs.readFileSync(filename, {encoding: 'utf8'})); - const newPkg = { - ...pkg, - ...vsPkg, - type: "commonjs", - scripts: {}, - version: pkg.version, - }; - fs.writeFileSync(filename, JSON.stringify(newPkg, null, 2)); -} - async function buildDawnNode() { try { process.env.DEPOT_TOOLS_WIN_TOOLCHAIN = '0' @@ -58,20 +45,6 @@ async function buildDawnNode() { } } -async function packageExtension(target) { - try { - process.chdir(buildPath); - await execute('npm', ['install']); - await execute(`${cwd}/node_modules/.bin/vsce`, [ - 'package', - '--allow-star-activation', - '--target', target, - ]); - } finally { - process.chdir(cwd); - } -} - async function copyResult(filepath, target) { const srcFilename = path.join(...[filepath, ...addElemIf(isWin, 'Debug'), 'dawn.node']); const dstFilename = path.join('dist', `${target}.dawn.node`);