Merge pull request #130 from smarty/ryan/hello_types #13
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 to npm | |
| on: | |
| push: | |
| tags: | |
| - "*" | |
| permissions: | |
| id-token: write # Required for OIDC | |
| contents: read | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: "20.x" | |
| registry-url: "https://registry.npmjs.org" | |
| - name: Update npm | |
| run: npm install -g npm@'>=11.5.1' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build | |
| run: npm run build | |
| - name: Run tests | |
| run: npm test | |
| - name: Set version from tag | |
| run: | | |
| VERSION=${GITHUB_REF#refs/tags/} | |
| sed -i 's/"version": "0\.0\.0"/"version": "'"$VERSION"'"/g' package.json | |
| sed -i 's/"version": "0\.0\.0"/"version": "'"$VERSION"'"/g' package-lock.json | |
| - name: Publish to npm | |
| run: npm publish | |
| env: | |
| NPM_CONFIG_PROVENANCE: true | |
| NPM_TOKEN: "" |