diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..2a5af89 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,38 @@ +name: Publish + +on: + release: + types: [ created ] + +jobs: + lint: + runs-on: ubuntu-latest + permissions: + contents: read + id-token: write + + steps: + - uses: actions/checkout@v4 + + - name: Setup Node v20.x + uses: actions/setup-node@v3 + with: + node-version: 20.x + registry-url: 'https://registry.npmjs.org' + + - name: Setup npm + run: npm install -g npm + + - name: Clean Install Dependencies + run: npm ci + + - name: Run ESLint + run: npm run lint + + - name: Run tests + run: npm run test:once + + - name: Publish to npm + run: npm publish --provenance + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}