Bug fix #9
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
| # https://docs.npmjs.com/trusted-publishers | |
| # | |
| # SETUP (one-time) | |
| # ───────────────────────────────────────────────────────────────────────────── | |
| # On npmjs.com, open the @ogis/icons package → Settings → Publishing → | |
| # Trusted Publishers → Add a publisher: | |
| # Provider: GitHub Actions | |
| # Repository: OpenGIS/icons | |
| # Workflow file: publish.yml | |
| # ───────────────────────────────────────────────────────────────────────────── | |
| name: Publish to npm | |
| on: | |
| push: | |
| branches: | |
| - master | |
| permissions: | |
| contents: read | |
| id-token: write # required for npm Trusted Publisher (OIDC) | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 2 | |
| - name: Check if version changed | |
| id: version | |
| run: | | |
| if git diff HEAD~1 HEAD -- package.json | grep -q '"version"'; then | |
| echo "changed=true" >> $GITHUB_OUTPUT | |
| else | |
| echo "changed=false" >> $GITHUB_OUTPUT | |
| fi | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '24' | |
| registry-url: 'https://registry.npmjs.org' | |
| - run: npm ci | |
| - run: npm run build | |
| - run: npm publish --provenance | |
| if: steps.version.outputs.changed == 'true' | |