From 4451e894105b852443e93a6bbf6be4f95f88dca6 Mon Sep 17 00:00:00 2001 From: Arthurk12 Date: Tue, 23 Jun 2026 12:41:20 -0300 Subject: [PATCH 1/2] ci: add .nvmrc (Node 22) and reference it on workflows --- .github/workflows/publish.yml | 2 +- .github/workflows/storybook-deploy.yml | 2 +- .github/workflows/tag_and_release.yml | 2 +- .github/workflows/ts-code-compilation.yml | 2 +- .github/workflows/ts-code-validation.yml | 2 +- .nvmrc | 1 + README.md | 1 + 7 files changed, 7 insertions(+), 5 deletions(-) create mode 100644 .nvmrc diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 7390195..37c7be8 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -20,7 +20,7 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v4 with: - node-version: 'lts/*' + node-version-file: '.nvmrc' registry-url: 'https://registry.npmjs.org' - name: Install Dependencies diff --git a/.github/workflows/storybook-deploy.yml b/.github/workflows/storybook-deploy.yml index 33d4203..e44199c 100644 --- a/.github/workflows/storybook-deploy.yml +++ b/.github/workflows/storybook-deploy.yml @@ -22,7 +22,7 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v4 with: - node-version: '20' + node-version-file: '.nvmrc' cache: 'npm' - name: Install dependencies diff --git a/.github/workflows/tag_and_release.yml b/.github/workflows/tag_and_release.yml index f25b69b..4a791a6 100644 --- a/.github/workflows/tag_and_release.yml +++ b/.github/workflows/tag_and_release.yml @@ -23,7 +23,7 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v4 with: - node-version: '20' + node-version-file: '.nvmrc' - name: Generate Changelog and Tag id: changelog diff --git a/.github/workflows/ts-code-compilation.yml b/.github/workflows/ts-code-compilation.yml index 030dcba..608e6c3 100644 --- a/.github/workflows/ts-code-compilation.yml +++ b/.github/workflows/ts-code-compilation.yml @@ -16,7 +16,7 @@ jobs: - name: install node uses: actions/setup-node@v4 with: - node-version: 20.x + node-version-file: '.nvmrc' - name: run npm install shell: bash run: npm install diff --git a/.github/workflows/ts-code-validation.yml b/.github/workflows/ts-code-validation.yml index d948160..edb83b4 100644 --- a/.github/workflows/ts-code-validation.yml +++ b/.github/workflows/ts-code-validation.yml @@ -17,7 +17,7 @@ jobs: - name: install node uses: actions/setup-node@v4 with: - node-version: 20.x + node-version-file: '.nvmrc' - name: run npm install shell: bash run: npm install diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 0000000..2bd5a0a --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +22 diff --git a/README.md b/README.md index 11b4da3..df53130 100644 --- a/README.md +++ b/README.md @@ -121,6 +121,7 @@ If you want to build the library locally or contribute: ### Building the bundle ``` +nvm use npm install npm run build ``` From 984ed8490ba82ccbbb4ae160a38a22822291ae26 Mon Sep 17 00:00:00 2001 From: Arthurk12 Date: Tue, 23 Jun 2026 13:45:41 -0300 Subject: [PATCH 2/2] ci: move sync-develop trigger to tag_and_release and fix tag ref --- .github/workflows/publish.yml | 6 ------ .github/workflows/sync-develop.yml | 7 ++++--- .github/workflows/tag_and_release.yml | 7 +++++++ 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 37c7be8..2ecabaf 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -32,9 +32,3 @@ jobs: - name: Publish to NPM run: npm publish --provenance --access public - sync: - needs: publish - uses: ./.github/workflows/sync-develop.yml - permissions: - contents: write - pull-requests: write diff --git a/.github/workflows/sync-develop.yml b/.github/workflows/sync-develop.yml index c79931c..52469e4 100644 --- a/.github/workflows/sync-develop.yml +++ b/.github/workflows/sync-develop.yml @@ -23,7 +23,8 @@ jobs: uses: actions/github-script@v7 with: script: | - const tag = context.ref.replace('refs/tags/', ''); + const isTag = context.ref.startsWith('refs/tags/'); + const tag = isTag ? context.ref.replace('refs/tags/', '') : null; const { owner, repo } = context.repo; // Check if develop branch exists @@ -64,8 +65,8 @@ jobs: await github.rest.pulls.create({ owner, repo, - title: `chore: sync ${tag} from main into develop`, + title: tag ? `chore: sync ${tag} from main into develop` : 'chore: sync main into develop', head: 'main', base: 'develop', - body: `Automated back-merge after release ${tag}.`, + body: tag ? `Automated back-merge after release ${tag}.` : 'Automated back-merge from main into develop.', }); diff --git a/.github/workflows/tag_and_release.yml b/.github/workflows/tag_and_release.yml index 4a791a6..eb74386 100644 --- a/.github/workflows/tag_and_release.yml +++ b/.github/workflows/tag_and_release.yml @@ -46,3 +46,10 @@ jobs: tag_name: ${{ steps.changelog.outputs.tag }} body: ${{ steps.changelog.outputs.clean_changelog }} generate_release_notes: true + + sync: + needs: release + uses: ./.github/workflows/sync-develop.yml + permissions: + contents: write + pull-requests: write