diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 00000000..1fd8cfdc --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,35 @@ +name: Publish to npm + +on: + push: + tags: + - '[0-9]*.[0-9]*.[0-9]*' + +permissions: + id-token: write + contents: read + +jobs: + release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: 24 + registry-url: 'https://registry.npmjs.org' + + - name: Install dependencies + run: npm install + + - name: Build + run: npm run build + + - name: Publish to NPM + run: | + if [[ "${{ github.ref_name }}" == *"-beta"* ]]; then + npm publish --access public --tag beta + else + npm publish --access public + fi