diff --git a/.github/scripts/pre-commit.js b/.github/scripts/pre-commit.js new file mode 100644 index 0000000..a1b838a --- /dev/null +++ b/.github/scripts/pre-commit.js @@ -0,0 +1,12 @@ +const { execSync } = require('child_process'); + +// Called by TriPSs/conventional-changelog-action right after it bumps the +// version in package.json/package-lock.json, before committing the release. +// The action only text-replaces the top-level "version" field, so +// package-lock.json's nested packages[""] entry (its own copy of the root +// version) is left stale, requiring a manual fix after every release: +// https://github.com/bigbluebutton/bbb-ui-components-react/commit/2ff2bbb617197a4af5495961d57c17ca11d13356?diff=split#diff-053150b640a7ce75eff69d1a22cae7f0f94ad64ce9a855db544dda0929316519R9 +// Regenerating the lockfile here keeps it in sync before the release commit. +exports.preCommit = () => { + execSync('npm install --package-lock-only', { stdio: 'inherit' }); +}; diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 2ecabaf..19f8df4 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -15,12 +15,12 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v5 - name: Setup Node.js - uses: actions/setup-node@v4 + uses: actions/setup-node@v5 with: - node-version-file: '.nvmrc' + node-version: '24.x' registry-url: 'https://registry.npmjs.org' - name: Install Dependencies diff --git a/.github/workflows/storybook-deploy.yml b/.github/workflows/storybook-deploy.yml index e44199c..9d9af42 100644 --- a/.github/workflows/storybook-deploy.yml +++ b/.github/workflows/storybook-deploy.yml @@ -17,10 +17,10 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@v5 - name: Setup Node.js - uses: actions/setup-node@v4 + uses: actions/setup-node@v5 with: node-version-file: '.nvmrc' cache: 'npm' diff --git a/.github/workflows/sync-develop.yml b/.github/workflows/sync-develop.yml index 52469e4..78e13cd 100644 --- a/.github/workflows/sync-develop.yml +++ b/.github/workflows/sync-develop.yml @@ -14,7 +14,7 @@ jobs: pull-requests: write steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v5 with: fetch-depth: 0 token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/tag_and_release.yml b/.github/workflows/tag_and_release.yml index eb74386..fb4a636 100644 --- a/.github/workflows/tag_and_release.yml +++ b/.github/workflows/tag_and_release.yml @@ -16,12 +16,12 @@ jobs: contents: write # Required to push commits and tags steps: - name: Checkout Code - uses: actions/checkout@v4 + uses: actions/checkout@v5 with: fetch-depth: 0 # Fetches all history for accurate changelog generation - name: Setup Node.js - uses: actions/setup-node@v4 + uses: actions/setup-node@v5 with: node-version-file: '.nvmrc' @@ -38,6 +38,7 @@ jobs: skip-ci: 'false' tag-prefix: 'v' version-file: './package.json, ./package-lock.json' + pre-commit: './.github/scripts/pre-commit.js' - name: Create GitHub Release if: ${{ github.event.inputs.create_github_release == 'true' && steps.changelog.outputs.skipped == 'false' }} diff --git a/.github/workflows/ts-code-compilation.yml b/.github/workflows/ts-code-compilation.yml index 608e6c3..0846e13 100644 --- a/.github/workflows/ts-code-compilation.yml +++ b/.github/workflows/ts-code-compilation.yml @@ -6,7 +6,7 @@ jobs: ts-code-compilation: runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 with: fetch-depth: 1 # Merges the base branch (e.g. develop) into the PR branch so compilation @@ -14,7 +14,7 @@ jobs: - name: Merge branches uses: ./.github/actions/merge-branches - name: install node - uses: actions/setup-node@v4 + uses: actions/setup-node@v5 with: node-version-file: '.nvmrc' - name: run npm install diff --git a/.github/workflows/ts-code-validation.yml b/.github/workflows/ts-code-validation.yml index edb83b4..1e1aa5c 100644 --- a/.github/workflows/ts-code-validation.yml +++ b/.github/workflows/ts-code-validation.yml @@ -7,7 +7,7 @@ jobs: ts-code-validation: runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 with: fetch-depth: 1 # Merges the base branch (e.g. develop) into the PR branch so validation @@ -15,7 +15,7 @@ jobs: - name: Merge branches uses: ./.github/actions/merge-branches - name: install node - uses: actions/setup-node@v4 + uses: actions/setup-node@v5 with: node-version-file: '.nvmrc' - name: run npm install