From 13df6652aed9a6bccf1992992f647ffd5b2d404f Mon Sep 17 00:00:00 2001 From: Ben Doherty Date: Mon, 18 Sep 2023 15:11:58 -0700 Subject: [PATCH] Add npm deploy GitHub workflow (#7184) --- .github/workflows/npm-deploy.yml | 33 ++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/npm-deploy.yml diff --git a/.github/workflows/npm-deploy.yml b/.github/workflows/npm-deploy.yml new file mode 100644 index 0000000000..50d27341b8 --- /dev/null +++ b/.github/workflows/npm-deploy.yml @@ -0,0 +1,33 @@ +name: Npm Deploy + +on: + workflow_dispatch: + inputs: + release_tag: + description: 'Release tag to deploy (e.g., v1.42.2)' + required: true + default: 'v1.42.2' + +jobs: + npm-deploy: + name: npm-deploy + runs-on: macos-latest + steps: + - uses: actions/checkout@v3.3.0 + with: + ref: ${{ github.event.inputs.release_tag }} + # Setup .npmrc file to publish to npm + - uses: actions/setup-node@v3 + with: + node-version: '18.x' + registry-url: 'https://registry.npmjs.org' + - name: Run build script + run: | + cd build/web && printf "y" | ./build.sh release + - name: Deploy to npm + run: | + cd out/cmake-webgl-release/web/filament-js + npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} +