v1.2.12 #28
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: | |
| release: | |
| types: | |
| - published | |
| permissions: | |
| id-token: write | |
| contents: read | |
| jobs: | |
| deploy: | |
| runs-on: ${{ matrix.os }} | |
| env: | |
| TERM: xterm | |
| strategy: | |
| matrix: | |
| os: | |
| - ubuntu-24.04 | |
| node-version: | |
| - '20' | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install node ${{ matrix.node-version }} | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| registry-url: https://registry.npmjs.org | |
| cache: npm | |
| always-auth: true | |
| - name: Install dependencies | |
| run: npm clean-install --prefer-offline --frozen-lockfile | |
| - name: Lint code | |
| run: npm run lint | |
| - name: Run unit tests | |
| run: npm run test:unit | |
| - name: Prepare release | |
| uses: lando/prepare-release-action@v3 | |
| with: | |
| lando-plugin: true | |
| sync-email: [email protected] | |
| sync-token: ${{ secrets.RTFM47_COAXIUM_INJECTOR }} | |
| sync-username: rtfm-47 | |
| - name: Upgrade npm for trusted publishing | |
| run: npm install -g "npm@^11.5.1" | |
| - name: Publish to npm | |
| run: | | |
| VERSION=$(node -p "require('./package.json').version") | |
| PACKAGE=$(node -p "require('./package.json').name") | |
| if [ "${{ github.event.release.prerelease }}" == "false" ]; then | |
| npm publish --access public --dry-run | |
| npm publish --access public | |
| npm dist-tag add "$PACKAGE@$VERSION" edge | |
| echo "::notice title=Published $VERSION to $PACKAGE::This is a stable release published to the default 'latest' npm tag" | |
| echo "::notice title=Updated latest tag to $VERSION::The stable tag now points to $VERSION" | |
| echo "::notice title=Updated edge tag to $VERSION::The edge tag now points to $VERSION" | |
| else | |
| npm publish --access public --tag edge --dry-run | |
| npm publish --access public --tag edge | |
| echo "::notice title=Published $VERSION to $PACKAGE::This is a prerelease published to the 'edge' npm tag" | |
| echo "::notice title=Updated edge tag to $VERSION::The edge tag now points to $VERSION" | |
| fi | |