diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..18faaa9 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,42 @@ +name: Publish Package + +on: + push: + tags: + - "v*" + +permissions: + id-token: write # Required for OIDC + contents: write # Required to create git tags + +jobs: + release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v5 + + # Uses NPM Trusted Publishers for access to the registry + # See https://docs.npmjs.com/trusted-publishers + - uses: actions/setup-node@4 + with: + node-version-file: .node-version + registry-url: "https://registry.npmjs.org" + + # Ensure npm 11.5.1 or later is installed + - name: Update npm + run: npm install -g npm@11.6.1 + + - name: Install + run: npm ci + + - name: Build + run: npm run build + + - name: Test + run: npm test + + - name: Version + run: npm version ${{ inputs.version }} + + - name: Publish + run: npm publish --provenance --access public