Skip to content

Commit

Permalink
try if ref
Browse files Browse the repository at this point in the history
  • Loading branch information
greggman committed Jan 6, 2025
1 parent b5cb1cb commit a4fb1ca
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 29 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -98,6 +99,7 @@ jobs:
shell: bash
run: |
npm ci
echo "${{ github.event_name }}"
npm run build
- name: Upload Artifact ⬆️
Expand All @@ -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
Expand All @@ -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
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
27 changes: 0 additions & 27 deletions build/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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`);
Expand Down

0 comments on commit a4fb1ca

Please sign in to comment.