Use True North Compass #40
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 | |
| name: Publish to NPM | |
| on: | |
| push: | |
| branches: | |
| - master | |
| permissions: | |
| id-token: write | |
| contents: read | |
| 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 publish --provenance | |
| if: steps.version.outputs.changed == 'true' |