diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml new file mode 100644 index 00000000000..8479d26b948 --- /dev/null +++ b/.github/workflows/publish.yaml @@ -0,0 +1,31 @@ +name: Publish to npm + +on: + push: + tags: + - '*' + +jobs: + publish-npm: + runs-on: ubuntu-latest + steps: + - name: Check out code + uses: actions/checkout@v4 + + - name: Set up Node.js 18.x + uses: actions/setup-node@v4 + with: + node-version: 18.x + cache: 'npm' + registry-url: 'https://registry.npmjs.org/' + + - name: Install Dependencies + run: npm install + + - name: Build PlayCanvas + run: npm run build:publish + + - name: Publish to npm + run: npm publish --DRY-RUN + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} \ No newline at end of file