Merge pull request #36 from muhammedaksam/develop #9
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Publish Package (Trusted Publishing) | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| permissions: | |
| id-token: write # Required for OIDC trusted publishing | |
| contents: read | |
| jobs: | |
| publish: | |
| name: Publish to npm with Trusted Publishing | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 10.23.0 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: '22.x' | |
| cache: 'pnpm' | |
| registry-url: 'https://registry.npmjs.org' | |
| # Ensure npm 11.5.1 or later is installed for trusted publishing support | |
| - name: Update npm to latest version | |
| run: npm install -g npm@latest | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Run linting | |
| run: pnpm run lint | |
| - name: Check formatting | |
| run: pnpm run format:check | |
| - name: Run tests | |
| run: pnpm run test | |
| - name: Build project | |
| run: pnpm run build | |
| - name: Verify build artifacts | |
| run: | | |
| if [ ! -f "dist/index.js" ]; then | |
| echo "ERROR: Build artifacts missing in dist/" | |
| exit 1 | |
| fi | |
| echo "✓ Build artifacts verified" | |
| # Publish using OIDC authentication (no NPM_TOKEN needed) | |
| # Provenance is automatically generated for public packages from public repos | |
| - name: Publish to npm | |
| run: pnpm publish --access public --no-git-checks |