Bump @types/node (#4185) #1678
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 web-features@next | |
| on: | |
| push: | |
| branches: | |
| - "main" | |
| paths: | |
| - features/** | |
| - groups/** | |
| - packages/web-features/** | |
| - snapshots/** | |
| - index.ts | |
| - scripts/build.ts | |
| permissions: {} | |
| env: | |
| package: "web-features" | |
| package_dir: "packages/web-features" | |
| dist_tag: "next" | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - uses: actions/checkout@v7.0.0 | |
| - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 | |
| with: | |
| node-version-file: .node-version | |
| cache: npm | |
| - run: npm ci | |
| - run: npm test | |
| publish: | |
| if: github.repository == 'web-platform-dx/web-features' | |
| runs-on: ubuntu-latest | |
| needs: "test" | |
| permissions: | |
| contents: write | |
| # Required for OIDC and trusted publishing. See: | |
| # - https://docs.npmjs.com/trusted-publishers | |
| # - https://docs.github.com/en/actions/concepts/security/openid-connect | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@v7.0.0 | |
| - name: Get timestamp and short hash | |
| id: timestamp_and_hash | |
| run: | | |
| echo "TIMESTAMP=$(date +'%Y%m%d%H%M%S')" >> $GITHUB_OUTPUT | |
| echo "SHORT_HASH=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT | |
| - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 | |
| with: | |
| node-version-file: .node-version | |
| cache: npm | |
| registry-url: "https://registry.npmjs.org" | |
| # A two-step install is required to work around a bad `npm` version that | |
| # comes bundled with Node 22.22. | |
| # See https://github.com/npm/cli/issues/9151#issuecomment-4129185112 | |
| # And we can't yet use npm@12 due to a bug: | |
| # See https://github.com/npm/cli/issues/9722 | |
| - run: | | |
| npm install -g 'npm@10' | |
| npm install -g 'npm@^11.5.1' # required for trusted publishing | |
| - run: npm ci | |
| - run: npm run build | |
| - name: Get package.json version | |
| id: version | |
| run: echo "VERSION=$(npm version --json | jq --raw-output '.["${{ env.package }}"]')" >> $GITHUB_OUTPUT | |
| working-directory: ${{ env.package_dir }} | |
| - run: npm install | |
| working-directory: ${{ env.package_dir }} | |
| - run: npm version --no-git-tag-version "$VERSION-dev-$TIMESTAMP-$SHORT_HASH" | |
| # The version string template is: <package.json version>-dev-<timestamp>-<commit-hash> | |
| # Why not use SemVer build metadata with a plus sign for some of this? | |
| # Because npm completely ignores it. 😒 | |
| working-directory: ${{ env.package_dir }} | |
| env: | |
| VERSION: ${{ steps.version.outputs.VERSION }} | |
| TIMESTAMP: ${{ steps.timestamp_and_hash.outputs.TIMESTAMP }} | |
| SHORT_HASH: ${{ steps.timestamp_and_hash.outputs.SHORT_HASH }} | |
| - run: npm publish --tag ${{ env.dist_tag }} | |
| working-directory: ${{ env.package_dir }} | |
| - name: Set existing release to draft | |
| run: gh release edit --draft "$TAG" | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| TAG: ${{ env.dist_tag }} | |
| - name: Update the tag | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| git tag --force "$TAG" | |
| git push --force origin "$TAG" | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| TAG: ${{ env.dist_tag }} | |
| - name: Publish pre-release on GitHub | |
| run: | | |
| gh release edit \ | |
| --verify-tag \ | |
| --title "$PACKAGE@$TAG" \ | |
| --notes "$NOTES" \ | |
| --prerelease \ | |
| --draft=false \ | |
| "$TAG" | |
| gh release upload --clobber "$TAG" $ARTIFACTS | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| PACKAGE: ${{ env.package }} | |
| TAG: ${{ env.dist_tag }} | |
| NOTES: This is a continuously-updated prerelease generated from `main` (currently at ${{ steps.timestamp_and_hash.outputs.SHORT_HASH }}). | |
| ARTIFACTS: > | |
| ${{ env.package_dir }}/data.json | |
| data.extended.json | |
| schemas/data.schema.json | |
| data.proposed.json | |
| schemas/data.proposed.schema.json |